<div dir="ltr">Hi,<div>I'm really happy that actually someone answer!</div><div><br></div><div>I just put the script on github, you are free to contribute : <a href="https://github.com/kidpixo/pymimedetacher" target="_blank">https://github.com/kidpixo/pymimedetacher</a></div><div><br></div><div>It is a pretty naive approach, but it could :</div><div>- read a maildir directory</div><div>- cycle all the message, if there is a part the is neither text or multipart ></div><div>    - decode the attachment</div><div>    - set the attachment to plain/text with a note on the file position</div><div>    - save the attachment in FOLDER/MAIL_NAME/ATTACHMENTS<br></div><div> </div><div>There are a lot of thing to improve, but the first is to sync the modified mails to the server.</div><div><br></div><div>In principle I would like to leave each mail in the same state it was, I don't want to find a bunch of random unread.</div><div>But thinking about it, it make sense because I create a new mail message...<br></div><div><br></div><div>Actually, this is the normal behaviour opening the mail with </div><div><br></div><div><div>src_mbox = mailbox.Maildir('maildir-mbox', factory=mailbox.MaildirMessage)</div></div><div><br></div><div>see [1].</div><div><br></div><div>I use  to use "factory=None" exactly for this reason, see discussion here [2]</div><div><br></div><div>Cheers,</div><div>Mario</div><div><br></div><div>[1]: <a href="http://www.onlamp.com/pub/a/python/2007/06/28/processing-mailbox-files-with-mailboxpy.html" target="_blank">http://www.onlamp.com/pub/a/python/2007/06/28/processing-mailbox-files-with-mailboxpy.html</a></div><div>[2]: <a href="http://stackoverflow.com/questions/13444175/how-can-i-get-pythons-maildir-to-read-the-updated-state/13445253#13445253" target="_blank">http://stackoverflow.com/questions/13444175/how-can-i-get-pythons-maildir-to-read-the-updated-state/13445253#13445253</a></div></div>