This will show you how to configure a Movemail account in Thunderbird. The setup works by using Fetchmail to grab the email from remote mailboxes and giving it to Procmail to put into a local file on the users system. Thunderbird will then grab (move) the mail from the file to the users home dir under the .thunderbird dir.
Why do this? Well, if you have a bad connection to an IMAP server that goes up and down all the time along with other POP and IMAP accounts this pulls in all your mail from all your accounts and keeps it locally. If you have ever used Thunderbird with IMAP connecting over a bad network (lot's of packet loss) then you will appreciate this. You can only crank the timeout to the server up or down. You can not turn it off. The box that pops up every time it can not connect is an annoyance. Using the stop button is the only way to kill the connect. This install was done using CentOS 4.
First make sure Procmail and Fetchmail are installed on the machine. If it's a machine with a rpm package manager then try the following to see if they are installed.
rpm -qa |grep fetchmail
rpm -qa |grep procmail
If nothing shows up for one or the other install them. On a CentOS machine with yum installed just execute the following. Use sudo with the commands below if need be.
yum install fetchmail
yum install procmail
It's assumed Thunderbird is installed already. Lets configure Fetchmail first. Put the following configuration file in the your home dir and call it .fetchmailrc. Then chmod the .fetchmailrc file you just made to 0710 (chmod 0710 .fetchmailrc).
set daemon 240 set logfile /home/local_login_name/fetchmail.log poll pop3.domain.com proto POP3 user "pop3_username" pass "pop3_password" is "local_login_name" ssl fetchall no keep no rewrite mda "/usr/bin/procmail -d %T"; poll imap.domain.com proto IMAP user "imap_username" pass "imap_password" is "local_login_name" ssl fetchall no keep no rewrite mda "/usr/bin/procmail -d %T";
"set daemon 240" sets Fetchmail to get mail every 240 secs. "set logfile" is where the logfile will go (take it out if you don't want a logfile). The "poll" line is for the mail server and protocol info. The "user" entry is the users username on the mail server. The "pass" entry is their password on the server. The "is" line is the login name you use on that linux/unix workstation. Both connections use SSL to get the mail. Remove the ssl lines if your provider does not support it. See the Fetchmail man page for more details. The settings in the file will get the mail from the server and give it to Procmail to deliver it. Then it will send the command to remove the mail from the server. No mail will be left on the server after this! All mail will be local and the you will not be able to see it in any webmail system the ISP runs. If you want to see it in a webmail system you will have to kill Fetchmail so it stops removing the mail from the server (killall fetchmail).
Procmail does not need any special settings as it will deliver the mail to /var/mail/local_login_name by default. Thunderbird will pick up the mail from that file and move it to it's own dir.
Now to make a Movemail account in Thunderbird. Open Thunderbird and go to the top menu and select File->New->Account. You will get the new account dialog box. If you are opening Thunderbird for the first time then this box is already up. In the new account box choose "Unix Mailspool (Movemail)" then click the next button. Put in the users name and email address then click the next button. Uncheck the "Use Global Inbox (store mail in Local Folders) box. This will put the mail in the global Inbox for all accounts. Then click next. Put in a name for the account (what it will be called in the config menu and in the left hand pane). Go to Edit->Account Settings. Go to the name of the account you just choose to set some configuration settings. Fill in the "Reply-To" address with the users email address. Click on "Server Settings" and choose the check for messages times. Then click on the next item "Copies & Folders". Select each drop down box and choose "Local Folders" for each. Set the rest of the settings to your preference.
Now start Fetchmail by going to a command prompt and typing "fetchmail". It should start. To watch the mail come in you can watch (tail -f ) the /home/local_login_name/fetchmail.log file that we specified in the config file. When mail comes in it is shown in the logfile along with any errors. Once an email comes in you can hit the "Get Mail" button in Thunderbird and it will get the mail from the /var/mail/local_login_name dir and put it in /home/local_login_name/.thunderbird/xxxxx.default/Mail/localhost. You should see the mail come up in Thunderbird.
Now let's make sure Fetchmail starts on boot. Put the line "/usr/bin/fetchmail" in the /etc/rc.local file. That is if you have or can use that file on start up. Most Unixes have this. That will make it start on boot. At anytime you want to make Fetchmail get mail just execute "fetchmail" from the command line and it will try and retrieve mail.