Difference between revisions of "Plobbes-Handling-System-Mail"

Line 5: Line 5:
 
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.
 
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.
  
==Update /etc/mail/submit.mc==
+
==Sendmail==
 +
 
 +
Update /etc/mail/submit.mc
  
 
   [rhel:/etc/mail]$ diff -u submit.mc.ORIG submit.mc
 
   [rhel:/etc/mail]$ diff -u submit.mc.ORIG submit.mc
Line 19: Line 21:
 
   +define(`confDOMAIN_NAME', `my.domain')dnl
 
   +define(`confDOMAIN_NAME', `my.domain')dnl
  
==Update submit.mc==
+
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
 
   [rhel:/etc/sysconfig]$ diff -u sendmail.ORIG sendmail
Line 30: Line 34:
 
   +QUEUE=15m
 
   +QUEUE=15m
  
==Restart sendmail==
+
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
 
   /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

Revision as of 22:08, 9 February 2009

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