bluebird75 / maildir2mbox

Convert mailbox from maildir format to mbox format
The Unlicense
111 stars 19 forks source link

Long road to make it true #4

Closed sergeevabc closed 4 years ago

sergeevabc commented 4 years ago

Windows 7 x64, Python 3.8.1, script has been downloaded to C:\Python\Scripts, then

$ py maildir2mbox.py c:\MailOld\Trash c:\MailNew\Trash
2020-03-15 15:09:27 Russia TZ 2 Standard Time [INFO ] c:\MailOld\Trash -> c:\MailNew\Trash          
Traceback (most recent call last):                                                                  
  File "maildir2mbox.py", line 131, in <module>                                                     
    main(args.maildir_path, args.mbox_filename)                                                     
  File "maildir2mbox.py", line 86, in main                                                          
    maildir2mailbox(dirname, mboxname)                                                              
  File "maildir2mbox.py", line 42, in maildir2mailbox                                               
    mails = len(maildir)                                                                            
  File "C:\Python\lib\mailbox.py", line 412, in __len__                                             
    self._refresh()                                                                                 
  File "C:\Python\lib\mailbox.py", line 529, in _refresh                                            
    mtime = os.path.getmtime(self._paths[subdir])                                                   
  File "C:\Python\lib\genericpath.py", line 55, in getmtime                                         
    return os.stat(filename).st_mtime                                                               
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'c:\\MailOld\\Trash\\new'

Contents

MailOld
└── Trash   
    ├── cur
    │   └── zyedidia%2fmicro%2freleases%2f24272788@github.com.eml
    └── tmp 

How do I proceed?

H0pp3rD3v commented 4 years ago

Create a "new" directory within the Trash directory. cur tmp and new are all expected within your MailDir Directory

sergeevabc commented 4 years ago

@H0pp3rD3v, hooray, it worked, however a more human-readable error message would be helpful. Now I have a file called Trash (the very MBOX) and an empty folder Trash.sbd. Should I delete the latter or it will be required later by Thunderbird?

bluebird75 commented 4 years ago

Current version has been improved with much better human readable messages.