From: SourceForge.net <no...@so...> - 2010-08-09 10:37:34
|
Patches item #1918937, was opened at 2008-03-19 00:36 Message generated for change (Settings changed) made by nikosch You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=456912&aid=1918937&group_id=49630 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Christian (chrisbra) Assigned to: Nobody/Anonymous (nobody) Summary: recursively archive all mails from an imap server Initial Comment: Hi, I thought, it would be nice, if archivemail could automatically archive messages from all folders in an imap server. This could for example be used for migrating all mails from one imap-server to another server. Attached is my first try to achieve this. I am not sure, how stable it is, especially the naming of the final archive could probably be improved and I am not sure how well this works with other imap servers beside cyrus, with which I've tested it. Greetings, C.Brabandt ---------------------------------------------------------------------- Comment By: Nikolaus Schulz (nikosch) Date: 2010-08-09 12:37 Message: Feature implemented in archivemail 0.8.0. ---------------------------------------------------------------------- Comment By: Christian (chrisbra) Date: 2008-03-19 22:13 Message: Logged In: YES user_id=1928606 Originator: YES Oh well, that was what I meant with "...especially the naming of the final archive could probably be improved..." (without that line all messages would be archived into the same archive, which is probably not what would be expected, so I thought of a way to add the folder. This was a quick and dirty solution to create a new archive for each folder without adding too much complexitiy by refactoring the code for determining the final_archive_name. I was not sure how else to create an appropriate name for each subfolder. May be one can find a much better solution. Perhaps one can simply append the folder name to final_archive_name, of course the folder_name must at least be matched against "/" which needs to be replaced. Besides I noticed one probably needs to change the way, how the subfolders are determined. So this line: result, response = imap_server.list() should probably take the submitted folder_name into account, like this: result, response = imap_server.list(folder_name+"*") to take into account that the use only wants the subfolders below the one he specified and not all subfolders that exist. So I see your point, and the patch was kind of a starting point which I created quickly yesterday ;) Thanks for your comments, I'd obviously like to see this feature implemented ;) regards, Christian ---------------------------------------------------------------------- Comment By: Nikolaus Schulz (nikosch) Date: 2008-03-19 21:02 Message: Logged In: YES user_id=1594781 Originator: NO Hm, okay, I see that this can be convenient. I'm not convinced that it's worth adding more complexity and yet another option to archivemail, though... I would expect that typically, mailboxes are pretty static objects; you don't create them often or move them around a lot, so the benefit of recursive archiving seems pretty small. By the way, this has already been requested a long time ago before I was involved with archivemail, but the tracker was closed by the maintainer for some reason, see Feature request #649607. Finally, can you please explain the following line from your patch? final_archive_name = "INBOX" + folder.replace("INBOX","") + o_fan.replace("INBOX","") First, this looks like you're assuming that all folders are below INBOX, which need not be the case. Also, one would have to catch if 'folder' in the assignment contains slashes. But leaving that aside, I don't understand it. :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=456912&aid=1918937&group_id=49630 |