I decided that seeing as I’m making a serious crack at using Ubuntu, one of the serious issues is getting at my email.
To that end, I’ve finally got around to setting up fetchmail to grab my personal emails for me. For my work emails, I’ll still be using E.F.S., as that’s running on the mail server itself and is effectively 24/7.
So, here’s a guide to getting the thing set up quickly and with minimal effort, and keep it running on the system while turned on.
Step 1 – Create a configuration file for fetchmail
Because I’m not going to go into all of the parameters for fetchmail here (they are well documented), we’ll be using fetchmailconf, which is a GUI for configuring fetchmail configuration files.
Open the terminal and enter fetchmailconf. This will open up the fetchmail launcher.
Click ‘Configure fetchmail’ and run through either the Novice or Expert configuration. Once you have completed the setup, make sure that fetchmail works by clicking the first ‘Run fetchmail’ button on the configuration menu.
NOTE: It’s a good idea to select ‘Suppress deletion of messages after reading’ while testing so that your emails are not lost.
Step 2 – Copy your configuration file to the system settings
Back to the terminal window, and do the following:
- more .fetchmailrc – this should print the configuration file to the screen. If it does then great, we’re on the way. You should be able to recognise the settings that you have made
- sudo cp .fetchmailrc /etc/fetchmailrc – this copies your configuration file to the system area for the fetchmail daemon to use
- sudo chown fetchmail /etc/fetchmailrc
- sudo chmod 600 /etc/fetchmailrc – these last two command set the file permissions for the fetchmail user to access the file, but otherwise keep your email password secure.
Step 3 – Set fetchmail to run when the system is booted
Now we’re just going to make sure that fetchmail is set to run in the background, and will run when the machine is booted up.
- sudo gedit /etc/default/fetchmail
- In gedit, change the line START_DAEMON=no to START_DAEMON=yes. Save and close gedit.
- Back to the terminal
- sudo /etc/init.d/fetchmail start – this will start the fetchmail daemon, while will run in the background on your Ubuntu system.
That’s it! Load up your email application and check that the email you expect to be downloaded arrives.
If you want to check that fetchmail is running, enter ps -A | grep fetchmail in the terminal. If fetchmail is running, you’ll see a line like this:
11985 ? 00:00:01 fetchmail
That wasn’t so hard, was it?