Description ----------- This script is to add relayers to Sendmail's access database after a user has authenticated via POP. Requirements ------------ - You must be using qpopper configured in one of the following ways: 1. built with the --enable-log-login feature 2. having it started without reverse lookups and with statistics logging. For example in your inetd.conf: pop-3 stream tcp nowait root /usr/local/sbin/popper qpopper -R -s - Redhat 6.2 (or modify the script as described below) - File::Tail PERL module installed (tested with File-Tail-0.98). File::Tail also requires Time::Hires. How it works ------------ /var/log/maillog is watched for successful qpopper connections. An entry is then added to Sendmail's access files to allow relaying for that user's IP. The program maintains relay-ability for a user for a specified number of minutes, after which it is expired. Setup ----- If you are not using Redhat 6.2, you will have to modify how the .db files are created. Right now the procedure is to cd to /etc/mail and call /usr/bin/make. Redhat comes with a nice Makefile to do the makemap updates. Most likely all Redhat version >6.2 will have this. If not, make changes to the rebuild_map() function in the script and possibly any pathnames. Edit the script and modify the following: @ignore_ips = list of IP prefixes to always ignore from processing. Usually you want to put some local IPs here that already exist in your current access file. Otherwise they will be unnecessarily added as relayers. $MAX_TIME = # of minutes a user is allowed to relay Next copy /etc/mail/access to /etc/mail/access.template. This template file will be used to regenerate /etc/mail/access with the relay additions. Note that you should not modify /etc/mail/access when popb4smtp.pl is running because any changes you make to that file will be overwritten. If you want changes to stay, modify the template file. Start the script as root like this: nohup ./popb4smtp.pl >/dev/null & Bugs ---- This is not meant to be used in high-volume environments. One can easily see the case where a sendmail SMTP process starts at the exact time the access.db is regenerated. Then there may be problems. Though I believe makemap does file locking, I don't know the consequences of running it very often. Pleae report bugs/suggestions to valankar@bigfoot.com