Skip to content

Commit

Permalink
Remove envelope line from message
Browse files Browse the repository at this point in the history
This appears in Python 2 and not in Python 3 for some reason
  • Loading branch information
Mortal committed May 1, 2015
1 parent 6321da2 commit 911f831
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions emailtunnel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ def process_message(self, peer, mailfrom, rcpttos, str_data):
"""

data = str_data.encode('latin1')
if six.PY2:
if data.startswith('From nobody'):
# Remove first line which contains useless envelope info
nl = data.index('\n')
data = data[nl+1:]

try:
ipaddr, port = peer
Expand Down

0 comments on commit 911f831

Please sign in to comment.