Plobbes-Handling-System-Mail

Revision as of 13:18, 24 March 2015 by Jorge de la Cruz (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Handling System Mail

When setting up ZCS servers one probably should not ignore setting up either sendmail, postfix or your favorite MTA for handling local UNIX/system mail which can be generated by cron or other system services.

Here is one way that you can setup sendmail on RHEL to send all locally generated messages to a specific host (smtp-lb.my.domain in this example). With these modifications made to the default RHEL configuration, sendmail will not listen on port 25 but it will watch local queues in case the host 'smtp-lb.my.domain' is not available when the local mail is first created.

Sendmail

Update /etc/mail/submit.mc

 [rhel:/etc/mail]$ diff -u submit.mc.ORIG submit.mc
 --- submit.mc.ORIG      2006-11-28 08:59:20.000000000 -0600
 +++ submit.mc   2008-12-16 13:09:39.000000000 -0600
 @@ -27,4 +27,6 @@
  FEATURE(`use_ct_file')dnl
  dnl
  dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
 -FEATURE(`msp', `[127.0.0.1]')dnl
 +dnl FEATURE(`msp', `[127.0.0.1]')dnl
 +FEATURE(`msp', `smtp-lb.my.domain')dnl
 +define(`confDOMAIN_NAME', `my.domain')dnl

Update /etc/mail/submit.mc

These changes tell sendmail to not run as a daemon, but to still watch the submit queue for messages.

 [rhel:/etc/sysconfig]$ diff -u sendmail.ORIG sendmail
 --- sendmail.ORIG       2006-11-28 08:59:21.000000000 -0600
 +++ sendmail    2008-12-16 13:14:01.000000000 -0600
 @@ -1,2 +1,2 @@
 -DAEMON=yes
 -QUEUE=1h
 +DAEMON=no
 +QUEUE=15m

Restart sendmail

When you restart sendmail, /etc/mail/submit.cf will be automatically regenerated based on /etc/mail/submit.mc.

 /sbin/init.d/sendmail restart

If successful, you should notice a few sendmail queue runner processes running, for example:

 [rhel]$ ps -ef | grep sendmail
 root   9982  1  0  2008 ?   00:00:00 sendmail: Queue runner@00:15:00 for /var/spool/mqueue
 smmsp  9990  1  0  2008 ?   00:00:00 sendmail: Queue runner@00:15:00 for /var/spool/clientmqueue
Jump to: navigation, search