strip email signature
This commit is contained in:
parent
c959e761cd
commit
839c9a52ef
1 changed files with 9 additions and 0 deletions
|
@ -18,6 +18,7 @@ logger = logging.getLogger()
|
||||||
def parse(data, pnut, mstdn):
|
def parse(data, pnut, mstdn):
|
||||||
body = ""
|
body = ""
|
||||||
attachments = []
|
attachments = []
|
||||||
|
msg = []
|
||||||
|
|
||||||
for part in data.walk():
|
for part in data.walk():
|
||||||
disposition = part.get_content_disposition()
|
disposition = part.get_content_disposition()
|
||||||
|
@ -53,6 +54,14 @@ def parse(data, pnut, mstdn):
|
||||||
logger.debug(data['Subject'])
|
logger.debug(data['Subject'])
|
||||||
logger.debug(body)
|
logger.debug(body)
|
||||||
logger.debug(len(attachments))
|
logger.debug(len(attachments))
|
||||||
|
|
||||||
|
parsebody = body.split('\n')
|
||||||
|
for line in parsebody:
|
||||||
|
if line == "-- ":
|
||||||
|
break
|
||||||
|
msg.append(line)
|
||||||
|
body = '\n'.join(msg)
|
||||||
|
|
||||||
if pnut:
|
if pnut:
|
||||||
post_pnut(data['Subject'], body, attachments)
|
post_pnut(data['Subject'], body, attachments)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue