Configuring Fetchmail Ubuntu Gutsy

From Scalix Wiki
Jump to: navigation, search

Important Note

Please note that these manual installation instructions should only be used on Ubuntu distributions, such as Ubuntu Gutsy Gibbon 7.10 server, the distribution the document was written for. If you install Scalix on an unsupported platform, this invalidates your ability to receive Scalix support. Also the usage of third party tools like fetchmail might not be supported. Thank you for your understanding and compliance.

This document might be inaccurate and under construction. Do not trust this document.


Installing and configuring fetchmail on Ubuntu 7.10 Server (Gutsy Gibbon)

As Ubuntu 7.10 is an unsupported platform there is currently no manual describing the installation of fetchmail (a tool that can be used to retrieve and forward email) to be used in combination with Scalix. As I managed to get Scalix it up and running and I already documented and shared this with the community (here), I thought it would be useful to share my experiences regarding the fetchmail configuration as well.

So below you'll find a how-to that describes the installation and configuration of fetchmail to be used with Scalix on a Ubuntu 7.10 server.

Fetchmail is a mail-retrieval and forwarding utility that can fetch mail from remote mailservers (e.g. pop3 and imap) and forwards it to your local machine’s delivery system (Scalix in this case). The fetchmail utility can be run in a daemon mode to repeatedly poll one or more systems at a specified interval, and that's what this how-to will describe.

I used several sources of information on the web. I listed the ones I can remember at the end of the document under Sources.


Applicable Environments

These Installation instructions have been tested with

  • Scalix CE 11.3.0
  • Ubuntu 7.10 Server (Gutsy Gibbon)

They might not apply unmodified to any other version of Scalix or Ubuntu.


Install the fetchmail software

Fetchmail is Open Source Software available on the internet here. Under Ubuntu we have a package available that can be installed directly with apt-get. So install the fetchmail package:

sudo apt-get install fetchmail


Configure fetchmail

To make fetchmail run in daemon mode and have it poll for mail from several pop3 or imap servers frequently, you have to edit two configuration files: /etc/fetchmailrc and /etc/default/fetchmail.

In the file /etc/default/fetchmail you have to change the START_DAEMON directive from no into yes. After that the file should look like this:

# This file will be used to declare some vars for fetchmail
#
# Uncomment the following if you don't want localized log messages
# export LC_ALL=C

# If you want to specify any additional OPTION to the start
# scripts specify them here
# OPTIONS=...

# Declare here if we want to start fetchmail. 'yes' or 'no'
START_DAEMON=yes

This makes sure the fetchmail will be able start in daemon modus. It will also make sure that the fetchmail daemon will start automatically when the system starts.

The file /etc/fetchmailrc should be created as it does not exist yet. So use your favorite text editor and create a file that looks like this:

set syslog;
set daemon 90;
set postmaster "my.email@mydomain.com";

poll "pop.provider.com"
with protocol pop3
user "popuser" password "poppassword"
smtphost "server.mydomain.com" smtpname "my.email@mydomain.com"

poll "imap.provider.com"
with protocol imap
user "imapuser" password "imappassword"
smtphost "server.mydomain.com" smtpname "my.email@mydomain.com"

Where:

  • pop.provider.com is a pop3 mail server you want to poll for messages
  • popuser is the user for the named pop3 server
  • poppassword is the password for the user on the named pop3 server
  • imap.provider.com is an imap mail server you want to poll for messages
  • imapuser is the user for the named imap server
  • imappassword is the password for the user on the named imap server
  • server.mydomain.com is the fully qualified domain name (fqdn) of your Scalix server
  • my.email@mydomain.com is your email address on your Scalix server


The directive set syslog; tells fetchmail to use the syslog system to log it's activities and possible errors.

The directive set daemon 90; tells fetchmail the interval to poll for new messages on the servers, in this example it is set to 90 seconds.

The directive set postmaster "my.email@mydomain.com"; provides fetchmail with an email address to send error messages and message that cannot be delivered to.

You may add as much servers a you like to the fetchmailrc file. They will all be polled for messages subsequently.


Start fetchmail and check the fetchmail configuration

To make sure your configuration is all right, start fetchmail. To do so, use this command:

sudo /etc/init.d/fetchmail start

Next, to check the configuration, have a look at the log file /var/log/mail.log. You can check it by using:

tail -400 /var/log/mail.log

If there's something wrong, have a look at the exact error message and fix the problem. If everything is all right, then you're done: congratulations!


Note: Fetch mail from a Gmail account

If you would like to fetch your email from your Gmail account into your Scalix instance have a look at this website:


Sources


The author

The origin for this document was written by Max Wiertz. As a Scalix newbie, I invested a lot of work in getting Scalix together with fetchmail to work for me on Ubuntu. I felt like sharing this with all of you, so you can probably take advantage of it.

If you have any questions, remarks, comments or suggestions regarding this document, do not hesitate to contact me by e-mail: mailto:max_DOT_wiertz_AT_gmail_DOT_com.