Great Circle Associates Majordomo-Users
(July 1997)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: relay host?
From: Jeff Wasilko <jeffw @ smoe . org>
Date: Sun, 27 Jul 1997 00:21:54 +0200
To: awest @ webster . m-w . com
Cc: "majordomo-users @ GreatCircle . COM" <majordomo-users @ GreatCircle . COM>
In-reply-to: <199707252300.BAA11977@bar.pilsnet.sunet.se>; from "Mats Dufberg" on Sat, Jul 26, 1997 at 12:56:09AM +0200
References: <199707252300.BAA11977@bar.pilsnet.sunet.se>

On Sat, Jul 26, 1997 at 12:56:09AM +0200, Mats Dufberg wrote:
> Well, you could make a copy of sendmail.cf to, say, MD_sendmail.cf,
> and in that copy make the changes that RP suggests, and in
> majordomo add the switch "-C/path/MD_sendmail.cf" to the MAILER. 
> 
> This sollution will cause sendmail not to run as root, but as 
> "majordomo". That means that you will need a separte queue 
> directory writable by "majordomo" (and change in MD_sendmail.cf) 
> if queueing is ever necessary. You'll also have to make sure 
> that the second queue directory is processed now and then.

I just recently did this, since my ISP that I was using as my
sole mail relay was less than happy about the load the lists were
placing on the single relay machine I was using.

I have a Sparc 2 that hosts the lists (about 20 of them) and I'm
connected via a 56k ISDN line, so doing all delivery is really
out of the question.

I was able to convince my ISP to continue to allow me to relay
thru them if I was able to load balance between 2 of their relay
machines and also to do some deliveries myself.

I'll try to describe what I did as best I can now (I'm working in
Amsterdam and I don't have good telnet access to my systems from
the hotel). If there are any holes, I'll be glad to fill them in 
on Monday when I have better access.

I decided that I wanted 3 mail queues: 1 for normal mail, one for
a very busy list (150-200 messages per day to 400 recipients,
plus 4 digests a day to 600 people), and one for all other lists.

In order to control the load on the server, I decided that all
list mail will be queued, and dealt with by the queue runners in
sequence. 

There are 4 major changes that are required:

A) Configure sendmail
B) Configure majordomo
C) Change /etc/aliases (only if using bulk_mailer)
D) Enable queue runners for alternate queues

A: Configure sendmail
---------------------

I built 7 sendmail.cf files, broken up by queue as follows:

1) mqueue: this was for the primary sendmail sendmail daemon that
listened on port 25. It was set to relay all mail to one of my
ISP relays (as it was only for regular mail).

2) listq: these config files were for all lists except for
busylist. It was set with the following options:

# queue mail 
0dqueue
# queue directory
OQ/var/spool/listq

One config file set DR and CR to relay1, the next set it to
relay2 and the last was configured not to relay (but to do
delivery locally).

3) busylistq: these config files were for the busylist and its
digest. It was set with the following options:

# queue mail 
0dqueue
# queue directory
OQ/var/spool/busylistq

One config file set DR and CR to relay1, the next set it to
relay2 and the last was configured not to relay (but to do
delivery locally).

B) Configure majordomo
----------------------

I changed the majordomo.cf to call sendmail with the -C option to
direct listmail into the dedicated list queue:

$mailer = "$sendmail_command -oi -oee -C/etc/mail/sendmail.cf.listq.jane -f\$sender";           
$bounce_mailer = "$sendmail_command -oi -oee -f\$sender -t";

Note that you want to leave bounce_mailer alone (assuming your
default sendmail doesn't queue) so that people get a quick
response from majordomo commands. Note that the 'jane' in the
sendmail.cf filename is the name of my list host. There is also a
sendmail.cf.listq.relay1 and sendmail.cf.listq.relay2 used by the
queue runners to load balance between the two relay machines.

I then special-cased the busy list, to direct it into its own
queue:

if ($main'program_name eq 'mj_resend' && $opt_l eq 'busylist') { 
 $mailer = "$sendmail_command -oi -oee -C/etc/mail/sendmail.cf.busylistq.jane -f\$sender";
}

if ($main'program_name eq 'mj_resend' && $opt_l eq 'busylist-digest') { 
 $mailer = "$sendmail_command -oi -oee -C/etc/mail/sendmail.cf.busylistq.jane -f\$sender";
}

C) Change /etc/aliases (only if using bulk_mailer)
--------------------------------------------------

If you're using bulk_mailer, you have to tell bulk_mailer to call
sendmail with the proper config file. An example outgoing alias
is:

list-outgoing:"|/usr/local/bin/bulk_mailer -sendmail -C/etc/mail/sendmail.cf.listq.jane -precedence bulk owner-list@smoe.org /majordomo/list"

D) Enable queue runners for alternate queues
--------------------------------------------

This ended up being the trickiest part, as sendmail is paranoid
about other people writing entries in it's queue. When using
multiple queues, the files will be owned by the majordomo-owner
(usually majordom). So, you have to start the queue runners as
majordom. Note that if you changed the majordomo-owner account to
have a bogus shell (like /bin/false) for security, you'll have to
enable a valid shell for the su command to work.

I added the following lines to /etc/init.d/sendmail to start the
queue runners:
#start list queue daemon
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.listq.jane" |su majordom
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.listq.relay1" |su majordom
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.listq.relay2" |su majordom
#start busylist queue daemon
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.busylistq.jane" | su majordom
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.busylistq.relay1" | su majordom
echo "/usr/lib/sendmail -q20m -C/etc/mail/sendmail.cf.busylistq.relay2" | su majordom

I hope this helps. It's worked very well for me, and seems to do
a decent job of distributing the load.

-Jeff


References:
Indexed By Date Previous: Re: FW: The reason the net sucked today :)
From: Clyde Meli <cmeli@cis.um.edu.mt>
Next: using majordomo as an autoresponder
From: David Shirley <root@webquarry.com>
Indexed By Thread Previous: Re: TLB?
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: using majordomo as an autoresponder
From: David Shirley <root@webquarry.com>

Google
 
Search Internet Search www.greatcircle.com