[DRBD-user] Sendmail and drbd config question

Diego Julian Remolina dijuremo at ibb.gatech.edu
Wed Jul 20 17:32:50 CEST 2005

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Tuesday 19 July 2005 16:04, Eric Mercer wrote:
> I'm assuming that the secondary node does nothing but wait until it is
> needed to be primary.  That seems to fit your description.  If you've
> set up an active-active configuration, my logic probably won't fit.
>
> The secondary should be able to *send* email without having sendmail
> running.  You only need sendmail running to receive email, which the
> secondary probably shouldn't be doing.

I tried forcing it to send e-mail as Brandon Poyner suggested with the 
command:  sendmail -Ac -q, but mail was still not going out.

The problem here seems to be that submit.cf by default (on RHEL4) points to 
use MSP on 127.0.0.1, so the secondary cannot send e-mail unless sendmail is 
running on the secondary and the mail just sits in /var/spool/clientmqueue.  
So replacing the msp feature line on submit.mc and creating a new submit.cf 
file as follows fixes the issue:

FEATURE(`msp', `[NUMERIC_IP_OF_YOUR_HA_MAIL_SERVER]')dnl

By NUMERIC_IP_OF_YOUR_HA_MAIL_SERVER I mean the virtual IP you use that is 
shared by both primary and secondary to run sendmail (whatever you used 
in /etc/ha.d/haresources on the line where sendmail is started).

The change above will allow the server acting as secondary to send e-mail out 
withouth having sendmail running but this will also create another issue.  

By default, cron and logwatch send e-mail to root and the e-mail is sent to 
root at hostname.example.com.  So what happens is that secondary runs say 
logwatch and e-mails the logs to root at secondary.example.com, once your mail 
server receives the e-mail then it tries to deliver it back to 
secondary.example.com.  So the trick is to manually adjust the 
MAILTO and Mailto fields on /etc/crontab and /etc/log.d/logwatch so that the 
recipient is root at example.com or whichever user you want to get the e-mail.  
This will prevent the primary mail server from trying to deliver the mail 
back to the secondary server which will be result in a bunch of deferred 
messages sitting in the mqueue because the secondary is not running sendmail.

Diego

>
> All you would have to do is let the default config file be the
> "secondary" one.  When a machine becomes primary it should specify the
> "primary" config when starting sendmail.  Obviously, I don't think you
> should even bother starting sendmail on the secondary node.  I'd have
> the default config specify the primary server as the mail relay.  That
> way if the recipient host is down, the primary node will queue the mail
> for later delivery.
>
> Of course, if you manage to come up with a sendmail config that works
> correctly when the node is primary (e.g., delivering local mail to local
> users) and also when the node is secondary (e.g., delivering local mail
> to the primary node for final delivery), then there is a benefit to
> having sendmail running on the secondary node all the time (shorter time
> for failover).  However, I'm not sure if that is possible.
>
> Diego Julian Remolina wrote:
> > Is anybody already running sendmail on top of drbd?  If so, I would like
> > to know if you configured sendmail to run with two separate configuration
> > files depending on whether the machine is primary or secondary.
> >
> > The issue I found is that sendmail needs to run with a minimal config
> > file, say the the default one (the default works on RHEL4) so that it can
> > at least send cron e-mails when the machine is acting as drbd secondary. 
> > When the machine becomes primary then it should stop sendmail running
> > with minimal configuration and start sendmail with the domain
> > configuration.  Are there any other suggestions on how to do this?
> >
> > I am currently running sendmail with the mimedefang milter, checking
> > viruses with clamd and tagging spam with spamassassin and then
> > deliverying mail to Cyrus imapd.  All of these services are started
> > through heartbeat on the haresources file.
> >
> > Diego
> >
> > _______________________________________________
> > drbd-user mailing list
> > drbd-user at lists.linbit.com
> > http://lists.linbit.com/mailman/listinfo/drbd-user
>
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user



More information about the drbd-user mailing list