Fetchmail with Lotus Domino Article
Anthony Barker

 

Fetchmail is a one-stop solution to the remote mail retrieval problem
for Unix machines, quite useful to anyone with an intermittent
Internet connection to a remote mailserver. It can collect mail using
any variant of POP or IMAP and forwards via port 25 to Domino, which
can be on the same machine or another machine. Fetchmail is an
industrial-strength tool capable of transparently handling every
retrieval demand from those of a simple single-user ISP connection up
to mail retrieval and rerouting for an entire client domain. Fetchmail
in normal operation doesn't touch the disk at all, except to read the
configuration file; that job is left up to the MTA or MDA the
fetchmail talks to. Fetchmail's performance is usually bottlenecked by
latency on the POP server or (less often) on the TCP/IP link to the
server and performs far better than LotusScript based POP3 retreival
solutions.

Steps to installation

1. Check Installation

Make sure fetchmail is installed ( default in RedHat server install)

type

locate fetchmail


/usr/bin/fetchmail
/usr/doc/fetchmail-5.0.0
/usr/doc/fetchmail-5.0.0/COPYING
/usr/doc/fetchmail-5.0.0/FAQ
/usr/doc/fetchmail-5.0.0/FEATURES
/usr/doc/fetchmail-5.0.0/INSTALL
/usr/doc/fetchmail-5.0.0/NEWS
/usr/doc/fetchmail-5.0.0/NOTES
/usr/doc/fetchmail-5.0.0/README
/usr/doc/fetchmail-5.0.0/design-notes.html
/usr/doc/fetchmail-5.0.0/fetchmail-FAQ.html
/usr/doc/fetchmail-5.0.0/fetchmail-features.html
/usr/doc/fetchmail-5.0.0/sample.rcfile
/usr/man/man1/fetchmail.1

You can see the executable in the /usr/bin/fetchmail directory, the
documentation in the /usr/doc/ directory and the man page (type "man
fetchmail" for the man pages).


1 a) how to install on redhat
If you don't have it installed grab the source or the rpm from CD or
web and install it. Make sure you are root...


cd /tmp
wget http://www.tuxedo.org/~esr/fetchmail/fetchmail-5.8.6-1.i386.rpm
rpm -ivh fetchmail-5.8.6-1.i386.rpm

For other distributions consult the documentation or go the fetchmail
website

1b ) check your hostname


hostname
nexus.xminc.com

(info is kept in "/etc/HOSTNAME")

cat /etc/hosts
127.0.0.1 localhost nexus
64.5.205.99 nexus.xminc.com nexus

2. Create the configuration file
(again as root)
choose the text editor of your choice to create the /root/.fetchmailrc
file
for newbies I recommend


pico ~/.fetchmailrc

more advanced


vi ~/.fetchmailrc


Note "." files are like .ini files in windows - they contain all your
settings. To see them you must use ls -al, not the typical ls command.
Also ~ stands for home directory in the bash shell

type or paste in the following and modifiy it to meet your needs

set daemon 600
#sets fetchmail to run in deamon mode (in the background) and polling
time to every 600 seconds

set postmaster anthony_barker@nospam.com
# make sure the postmaster is at least initially not on the domino
server - if you have a problem this will create a loop

set logfile /var/log/fetchmail
# log file - you can type "tail -40 /var/log/fetchmail" to have a look
at it

set no bouncemail
# make sure mail does not go back to senders - at least initially, you
can change this later

defaults
protocol pop3
smtphost nexus.xminc.com nexus
smtpaddress nexus.xminc.com
# server settings before user settings - make sure you put the change
the server settings here
keep
# at least initially keep the pop3 messages on the server so they
don't disappear
forcecr
# needed for Domino

#defaults for users
poll 9cast.com
#server to poll
user abarker pass ***** is abarker here
#note you don't need "is abarker here" if the shortname field in the
person doc matches the name in the pop3 server

The comments with # are not required and you can remove these

You could set the daemon to poll more frequently (say 30 for every 30
seconds while you are setting it up)


Note I found the documentation recommended using localhost instead of
the servername. For me the actual server name worked. If I used
localhost it would append the localhost to the server name and look
like this : abarker@localhost.nexus.xminc.com, which would be
bounced.

Also depending on your environment there are hundreds (if not
thousands) of other parameters that you can use. Check the man pages
for more info.

3) To set the ownership of the file

chmod 0710 ~/.fetchmailrc
According to the man pages the .fetchmailrc file should have
permissions no more open than 0600 (u=rw,g=,o=) . But I found that on
0710 worked for me.
4) Run fetchmail
/usr/bin/fetchmail -v -v -k -f /root/.fetchmailrc

The -v is verbous
-v -v is extra verbous and should not be normally used
-k is for keep (note we already have this in the .fetchmailrc - I just
put it here for good measure)
-f points to the configuration file

5) Check the look at the log file
tail -f /var/log/fetchmail

You can mail the test ID you setup a message to check that it is
working

6) Cleanup Config and set to autostart

Once you are happy that everything is working fine clean up your
.fetchmailrc and add the fetchmail program to your
/etc/init.d/rc.local
(boot file) or your PPP logon script or your Domino startup script.

to stop fetchmail

ps -ef | grep fetchmail
kill -9 PID

where PID is the process ID shown from the first commmand

For more information check the documentation or search the web.

Good Luck and Happy Linux + Dominoing
"The best combo"
Anthony Barker
Linux + Domino + App Dev Guru

>>> Back