Packages such as gcc, make, binutils ... are assumed already installed.
If you are using 8.11.x or lower, skip step 1
-r-xr-sr-x root smmsp ... /PATTH/TO/sendmail drwxrwx--- smmsp smmsp ... /var/spool/clientmqueue drwx------ root dt164 ... /var/spool/mqueue -r--r--r-- root dt164 ... /etcc/mail/sendmail.cf -r--r--r-- root dt164 ... /etcc/mail/submit.cf
$ tar xzf db-4.0.14.tar.gz $ cd db-4.0.14 $ cd build_unix $ ../dist/configure $ make ( must be root to do make install ) $ make install
$ tar xzf sendmail.8.11.6.tar.gz $ cd sendmail.8.11.6/devtools/Site Create a file called site.config.m4 in devtools/Site with the following content: define(`confMAPDEF', `-DNEWDB')dnl define(`confINCDIRS',`-I/usr/local/BerkeleyDB.4.0/include')dnl define(`confLIBDIRS',`-L/usr/local/BerkeleyDB.4.0/lib')dnl $ cd ../.. $ LD_LIBRARY_PATH=/usr/local/lib:/usr/local/BerkeleyDB4.0/lib $ export LD_LIBRARY_PATH $ sh Build $ sh Build installOn Solaris 8, the last step will not copy mail.local to /usr/lib. I did it manually. See mail.local/README for more details.
include(`../m4/cf.m4')dnl OSTYPE(`solaris8')dnl <--( change this to your OS ) FEATURE( `access_db')dnl FEATURE( `use_cw_file')dnl HACK(`popauth')dnl MAILER( `smtp')dnl $ m4 myconfig.mc > sendmail.cf $ cp sendmail.cf /etc/mailEdit /etc/mail/local-host-names that contains the domains that this sendmail server manages, each domain per lines. Of course, you must have MX records declared on DNS server.
For sendmail 8.12
/usr/lib/sendmail -L sm-mta -bd -q1h
/usr/lib/sendmail -L sm-msp-queue -Ac -q30m
If you see some permission errors here, be sure that there is no write permission for group/other on /etc/mail.
To know if your sendmail works, try this.
$ tar xzf qpopper4.0.3.tar.gz $ cd qpopper4.0.3 $ ./configure --enable-specialauth --enable-log-login $ make $ cp popper/popper /usr/local/binPrepare the inetd.conf
pop3 stream tcp nowait root /usr/local/sbin/popper qpopper -sthen restart inetd daemon by sending it a -HUP signal.
Note for Redhat 7 or later: RH7 uses xinetd instead of inetd. You need to create a xinetd control file for qpopper in
/etc/xinetd.d as
service pop3 { disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/local/sbin/popper server_args = qpopper -s log_on_failure += USERID }
If you use imap4, then it will be mail.info.
mail.info /var/log/mail
create an empty /var/log/mail ( by using touch /var/log/mai; ) and then restart syslog.
Check if your pop3 server works.
Check if your imap4 server works.
Now grab this mailwatch source and compile it ( gcc -o mailwatch mailwatch.c ). Copy the binary mailwatch into /usr/local/bin, create directory /etc/mail/popipspool, then create the initscript mailwatch for loading mailwatch at startup:
case "$1" in start) # first parm: log file # 2nd parm : ip spool directory # 3rd parm : timeout of ip addresses /usr/local/bin/mailwatch /var/log/mail /etc/mail/popipspool 900 ;; stop) kill -9 `cat /etc/mailwatch.pid` ;; *) echo "popwatch start | stop" ;; esac exit 0Copy this script file mailwatch into /etc/init.d ( for Solaris ) or /etc/rc.d/init.d ( for Linux ), change its permission to executable then create the corresponding symlink depending on init-level that your server starts.For example
Run this script
Check if pop3/imapd logs to syslog by loggin in to pop3 or imapd server to see if /var/log/mail
consists of the logs like:
Dec 30 14:47:50 sun1 qpopper[6760]: (v4.0.3) POP login by user "dt164" at (ppp07-294.algx-houston.pdq.net) 209.196.109.40 Dec 30 14:47:50 sun1 qpopper[6760]: Stats: dt164 0 0 0 0 ppp07-294.algx-houston.pdq.net 209.196.109.40Check if mailwatch works by logging in pop3/imapd server and see if /etc/mail/pophash.tmp contains lines like
68.215.181.130 OK 209.196.109.40 OK