Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got several POP3 accounts that need to be collected and handed to an IMAP server.

This must be safe, so anything racey or non-atomic won't work. How should I do this?

share|improve this question
Do you have an archive you can access via POP3 or will you need to empty the POP3 box at a given interval from an external server, and place it in IMAP folders? – Frands Hansen Jan 27 '12 at 22:28

Can clarify what you mean by "handed" to an IMAP server?

Are you trying to consolidate messages stored in several POP email accounts into one IMAP account? Is this a one time deal or ongoing?

One-time deal: Use a desktop client like Thunderbird. Add each pop3 account in turn (you can give each one their own "inbox"), as well as the imap account. Download all your pop3 messages. Then highlight all of a pop3's account messages and drag them to a folder on your imap account.

Another way to do this from the command line is "pop2imap" (README). This is a perl script, so you'll need a system with perl installed, which most linux distros do, but not so much with MS Windows.

If you are running an email server with IMAP and you want it to fetch from POP3 accounts on an ongoing basis, or you don't mind using SMTP to get the messages to the IMAP server, then you should look into fetchmail.

share|improve this answer
I have an IMAP server for which I need to regularly and continuously fetch pop3 mail from other servers. Is fetchmail safe for this, in terms of a message not being visible to the imap server before it's safe to be visible? (fully downloaded, etc.) – Bill T Jan 28 '12 at 9:22
Fetchmail will download the message and send it via smtp. So it could run independently of the imap server and connect directly to the imap server on port 25 (or an encrypted submission port). The message would go from where fetchmail is running to imap's smtp server. I think the pop2imap is the better choice for you. It would download the pop3 email and then connect directly to imap to inject the message into a folder. – ytjohn Jan 29 '12 at 1:58
Just what I was looking for - thanks! – Bill T Feb 2 '12 at 13:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.