Moving mails to different servers

Is it fate or simply bad karma that I’m always bothered with mailserver boxes? Or is it that they just cannot find anyone else crazy enough to even give it a try?

I’m not sure, but it’s me again, pushing mailboxes from one machine to another one. To make things right, I start doing things via imap and the good old toy ‘imapsync’, which just decided to discard about 90% of the messages showing the following error message:

flags from : [\Seen NonJunk][“02-Feb-2009 13:00:30 -0400”]
Error trying to append string: 58 NO APPEND Invalid flag list

Usually this is the moment to search for something eloquent like ‘fuck’ – but by now I am used to error messages and so I just read it again.

We’re on IMAP – so all the messages are kept on the server boxes and if we have read it on one machine, all other machines should give us the same result which is that the message was read, right? Such a thing is done by using message flags, which should start with a \ – if we can trust RFC.

But honestly, do the manufacturers of mailservers care? Hell no! As you can read, someone introduced the Flag named ‘NonJunk’ which does not start with a backslash which makes the mail server bail out. So why is that our business? Because we want to copy the message to the new server. So let’s do some regular expressions. I have decided to drop the flag as it is not RFC by using the regexflag parameter:

–regexflag ‘s/NonJunk//g’

Now the synchronization runs smoothly and without error messages. But it’s quite funny regarding what you see in a sysadmins life, guys.

Author:

2 thoughts on “Moving mails to different servers”

  • Dich schickt der Himmel!!

    Der kleine Tipp hat mir hier gerade den Tag gerettet und mein Problem vom Wochenende gelöst. Was macht man aber, wenn zuviele Flags spinnen?

Leave a Reply

Your email address will not be published. Required fields are marked *