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):
|
||||
body = ""
|
||||
attachments = []
|
||||
msg = []
|
||||
|
||||
for part in data.walk():
|
||||
disposition = part.get_content_disposition()
|
||||
|
@ -53,6 +54,14 @@ def parse(data, pnut, mstdn):
|
|||
logger.debug(data['Subject'])
|
||||
logger.debug(body)
|
||||
logger.debug(len(attachments))
|
||||
|
||||
parsebody = body.split('\n')
|
||||
for line in parsebody:
|
||||
if line == "-- ":
|
||||
break
|
||||
msg.append(line)
|
||||
body = '\n'.join(msg)
|
||||
|
||||
if pnut:
|
||||
post_pnut(data['Subject'], body, attachments)
|
||||
|
||||
|
|
Loading…
Reference in a new issue