Nethence Newdoc Olddoc Lab Your IP BBDock  

Warning: those guides are mostly obsolete, please have a look at the new documentation.


Getmail configuration
Getmail v4 installation
Make sure Python is installed,
rpm -q python
which python
As root, download, compile and install getmail (,
tar xzf getmail-4.20.0.tar.gz
cd getmail-4.20.0
python build
python install
Getmail v4 configuration
As user, edit the configuration,
cd ~/
mkdir -p .getmail
cd .getmail
vi getmailrc
note. ~/.getmail/account_name alernatively
for example,
delivered_to = 0
received = 0
read_all = 0
message_log_syslog = 1
message_log_verbose = 0
verbose = 1
delete = 0
#delete messages 15 days after first seeing them,
#delete_after = 15
type = SimplePOP3Retriever
server = POP3SRV
username = LOGIN
password = PASSWORD
type = MDA_external
path = /usr/bin/procmail
arguments = ("-f", "%(sender)")
unixfrom = 1
note. 'delivered_to' and 'received' disabled to prevent getmail from adding its lines to the messages
note. 'read_all' disabled not to download the same message over again at each retrieval
note. if prefer to centralize the logs with syslog. But if you like,
#message_log = ~/.getmail/getmailrc.log
note. eventually change procmail's path
note. to ingnore message's Content-Length field add this argument to procmail,
note. if using alternate procmailrc files (other than ~/.procmailrc) add e.g. that at the end,
"-m", "/etc/procmailrc.mailuser"
note. if you need to switch user & group before delivering the messages (you need to be root for that),
#user = fred
#group = mail
Fix the perms,
cd ~/.getmail
chmod 600 getmailrc
#chmod account_name
Make sure procmail is configured and call getmail to fetch the messages,
Note. '-v' to force verbose output
Note. 'getmail -r account_name' alternatively
Once everything works, you may erase the previous downloads and finish up the configuration, making getmail more silent and delete the mail after 15 days,
cd ~/.getmail
vi getmailrc
verbose = 0
delete = 0
#delete messages 15 days after first seeing them,
delete_after = 15
Two solutions depending on your needs.
Server needs
Make it happen periorically,
crontab -e
add e.g.,
*/5 * * * * /usr/bin/getmail
Workstation needs
For workstation usage, it's useless to look for messages all the time if you're not there. Use this script instead,
vi ~/bin/getmail.ksh
like e.g.,
set -e
while true; do
  getmail -v
  #-r account_name
  sleep 60
fix perms,
chmod +x getmail.ksh
Note. eventually keep this in a screen window,
(screen) ^A c
Note. or use nohup and kill the process when quitting,
nohup getmail.ksh > /dev/null
#pkill or kill when you leave

(obsolete, see the new doc)