Fetchmail Ubuntu Server 10.04

Ubuntu Linux Specific Guides
Post Reply
User avatar
Site Admin
Posts: 69
Joined: Wed Mar 15, 2006 8:28 pm

Fetchmail Ubuntu Server 10.04

Post by dedwards » Sun Jan 23, 2011 10:12 am

This guide will help you setup a system wide configuration of fetchmail service in order to receive email from other email servers.

1. Install Fetchmail

Code: Select all

sudo apt-get install fetchmail

2. Edit "/etc/default/fetchmail" and enable the fetchmail service

Code: Select all

vi /etc/default/fetchmail

Uncomment the "#START_DAEMON=yes" line and save the file.

3. Create the "/etc/fetchmailrc" file and set it as follows:

Code: Select all

set syslog
set daemon 180

poll pop.gmail.com proto pop3 port 995 user 'someone@gmail.com' password 'password' smtpname 'someone@yourdomain.tld' keep smtphost 192.168.xxx.xxx antispam 501 ssl

The "set syslog" and the "set daemon 180" lines must be on the top of the "/etc/fetchmailrc" file. The "set daemon 180" specifies how often (in seconds) the fetchmail service checks for email. The example given is for checking a gmail account. Adjust to your needs as necessary.

poll = Remote mail server to be polled

proto = Remote mail server protocol to use (pop3, imap)

port = Remote mail server port number to use

user = Remote mail server username

password = Remote mail server password

smtpname = Local email address to deliver email

keep = Keep mail at remote mail server (do not delete)

smtphost = Optional, if your mail server relays email to another host, you put the hostname/ip address of the email server to forward the fetched email

antispam = Tells fetchamail to run fetched email through spam filter if one is indeed installed locally

ssl = Tells fetchmail to use ssl when polling remote mail server

Save the file and restart fetchmail service:

Code: Select all

/etc/init.d/fetchmail restart
Post Reply