Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Eudora2Mbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ def handle_attachment( line, target, message ):
if not os.path.isabs( target ):
filename = os.path.join( os.environ['HOME'], filename )

# Trim NULL bytes from filenames (found in old Eudora 2.x mailboxes)
filename = filename.replace(b'\x00', '')

if not os.path.exists(filename):
if name.startswith('OutboundG4:'):
name = name[11:]
Expand Down Expand Up @@ -861,7 +864,9 @@ def handle_attachment( line, target, message ):

if cleaner_match:
filename = cleaner_match.group(1)

# Trim any NULL bytes we might have pulled in
filename = filename.replace(b'\x00', '')

mimeinfo = mimetypes.guess_type(filename)

if not os.path.exists(filename):
Expand Down Expand Up @@ -984,7 +989,7 @@ def handle_embedded( cid, filename, message ):
if len( args ) < 1 or len( args[0].strip() ) == 0:
sys.exit( 1 )

convert( args[0], opts )
convert( args[0], opts=opts )
except getopt.GetoptError:
exit_code = 1
sys.exit( exit_code )
Expand Down
Loading