A nightmare over several days. I had set my mind that a local store was no good, because I needed to be able to access my email from outside the apartment, and decided that IMAP would be the way to go.
Technically, what I needed to do was to take the mail I got from my outside provider and download it to my server (this one). Then I needed to pass that email to an IMAP server, finally to get to it from the outside world. This seems stupid at first, but I run a dozen filters on my email, so that it makes very little sense for me to access the email directly on my ISP’s site.
I set my mind on the following flow (that pretty much was determined by the way SuSE does things):
- fetchmail would download the email from the ISP in a cron job
- postfix would deliver said email on
- cyrus-imapd would make it available
As mentioned, after a few days everything started running smoothly – but initially it was quite the ordeal.
Fetchmail configuration was pretty straightforward. That’s probably because I have done it before; but even where not, you really need to know only one thing in addition to the mailbox credentials: the syntax of the configuration file.
Check the files /etc/fetchmailrc or ~/.fetchmailrc (as root). There you probably will already find a line that looks like this:
poll "server.domain.com" protocol AUTO : user "john" there with password "pwd" is "smith" here ;
The only thing you need to watch out for is that the remote user and password match what you enter when you check email on the remote server. The here account ("smith" in the example) is the local user you would like email delivered to.
Once you have written the file, use cron to check for email on a regular basis. Check the man page, or simply follow these exact steps:
- type ‘crontab -e’
- type ‘i’ (for insert)
- type ‘* * * * * fetchmail’
- hit Escape
- type ‘:wq’
That’s five stars in the fetchmail line. If you are not familiar with UNIX, you probably have no idea what you just did, but that really doesn’t matter.