Mark Zimmerman wrote:
On Mon, Jun 04, 2007 at 08:02:08AM -0600, Diana Eichert wrote:
Hmmm, actually, I don't believe sendmail has a "steep and tall learning curve". ;-) It's just that you don't grok it yet.

You're almost there since you know you want to use a smarthost. For example copy /usr/share/sendmail/cf/openbsd-localhost.mc to another file /usr/share/sendmail/cf/BobFoo-localhost-SMART_HOST.mc, define dnl define(`SMART_HOST', `MYMAINBOX-FQDN')dnl ,build a new .cf file, BobFoo-localhost-SMART_HOST.cf . Move the new file to /etc/mail , add sendmail_flags="-L sm-mta -C/etc/mail/BobFoo-localhost-SMART_HOST.cf -bd -q30m"
 to /etc/rc.conf.local restart sendmail and VOILA!

It's not hard at all and you will also get the satisfaction of leaning new and wonderful SysAdmin skills.


Thanks for the example, Diana. This, plus a little time figuring out
how to get genericstable to work properly, have allowed me to get rid of
postfix. postfix is fine, but maximizing use of the base install reduces
the amount of wasted time with each upgrade / reinstall.

-- Mark
I use 2 scripts to simplify managment. They are a sledgehammer approach, but what I like about it is that by using the 2 scripts, any config errors should not hide too long, as I am "fixing the world" so to speak.

If I add an alias, virtual domain, virtual users, etc I always use the rehash_and_restart.


In the "cf" directory where you have your customized mc file, I create a file called "make_sendmail"

#!/bin/sh

m4 ../m4/cf.m4 rinax.mc > rinax.cf
if [ $? -eq 0 ]; then
 echo "Created rinax.cf"
 cp rinax.cf /etc/mail/sendmail.cf
 cd /etc/mail
 /etc/mail/rehash_and_restart
else
 echo "Failed creating rinax.cf"
fi



Then in /etc/mail, I have the following file (rehash_and_restart):

#!/bin/sh
cd /etc/mail

# recompile the aliases file just for the hell of it
newaliases

# and do the "access database"
makemap hash access < access

# Mailertable
makemap hash mailertable < mailertable

# and the virtusertable
makemap hash virtusertable < virtusertable

# and the genericstable
makemap hash genericstable < genericstable

# restart the sendmail daemon
kill -HUP `head -1 /var/run/sendmail.pid`

Reply via email to