Re: Setting up sendmail to use external smtp server

phn_at_icke-reklam.ipsec.nu
Date: 04/28/04


Date: Tue, 27 Apr 2004 22:25:47 +0000 (UTC)

In comp.unix.misc Bill <fred_barney@bigmailbox.net> wrote:
> Nope, nothing like that in the sendmail.cf file. Any more ideas?

Get "the original sendmail distribution, unpack and identify
the .mc repository. See if your m4 will build .cf from one
of the .mc files, if not, sh Build to build your own modern sendmail.
( it's not that complicated and you will have a full version in the
process)

You might not need to change your sendmail binary, you _could_
use the sendmail distribution just to "create" your sendmail.cf.

Given enough interest, i show an example of how FreeBSD
organized their sendmail :

/etc/mail contains what's needed create your sendmail.cf,
in addition it has a Makefile that governs all phases of
thsi process.

Here is a ls -l from one machine :
> cd /etc/mail
> ll
total 350
-rw-r--r-- 1 root wheel 6570 Apr 3 2003 Makefile
-rw-r--r-- 1 root wheel 2899 Apr 3 2003 README
-rw-r--r-- 1 root wheel 411 Apr 3 2003 access.sample
-rw-r--r-- 1 root wheel 1474 Sep 15 2003 aliases
-rw-r----- 1 root wheel 65536 Sep 15 2003 aliases.db
-rw-r--r-- 1 root wheel 57066 Apr 3 2003 freebsd.cf
-rw-r--r-- 1 root wheel 4192 Sep 19 2003 freebsd.mc
-r--r--r-- 1 root wheel 38840 Apr 3 2003 freebsd.submit.cf
-r--r--r-- 1 root wheel 803 Apr 3 2003 freebsd.submit.mc
-r--r--r-- 1 bin bin 5588 Sep 19 2003 helpfile
-rw-r--r-- 1 root wheel 404 Apr 3 2003 mailer.conf
-rw-r--r-- 1 root wheel 245 Apr 3 2003 mailertable.sample
-rw-r--r-- 1 root wheel 57023 Sep 19 2003 nyheter.ipsec.se.cf
-rw-r--r-- 1 root wheel 4172 Sep 19 2003 nyheter.ipsec.se.mc
-r--r--r-- 1 root wheel 57023 Sep 19 2003 sendmail.cf
-rw------- 1 root bin 0 Sep 19 2003 statistics
-r--r--r-- 1 root wheel 38840 Sep 19 2003 submit.cf
-rw-r--r-- 1 root wheel 573 Apr 3 2003 virtusertable.sample

Note the nyheter.ipsec.se.mc ( the machine is named "nyheter.ipsec.se")

Typing a single 'make' is all that is needed to regenerate
aliases, access and any usertables, in addition to .mc to
.cf generation. Lets do an example of this :
( i'll touch the .mc file to simulate an edit )
# touch nyheter.ipsec.se.mc
# make
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 nyheter.ipsec.se.mc > nyheter.ipsec.se.cf
#

great we have a new .cf file :
# ll nyhe*
-rw-r--r-- 1 root wheel 57023 Apr 28 00:17 nyheter.ipsec.se.cf
-rw-r--r-- 1 root wheel 4172 Apr 28 00:17 nyheter.ipsec.se.mc
#
The file needs to be renamed to "sendmail.cf" which is what sendmail
expects :
# make install
install -m 444 nyheter.ipsec.se.cf /etc/mail/sendmail.cf
install -m 444 freebsd.submit.cf /etc/mail/submit.cf
#

We need to restart sendmail , lets do it:
# make restart
Restarting: sendmail sendmail-clientmqueue.
#

And we are done, the bottom line of maillog shows :
Apr 28 00:19:18 nyheter sm-mta[95]: restarting /usr/sbin/sendmail due to signal
Apr 28 00:19:18 nyheter sm-msp-queue[98]: restarting /usr/sbin/sendmail due to signal
Apr 28 00:19:18 nyheter sm-mta[98730]: starting daemon (8.12.10): SMTP+queueing@00:30:00
Apr 28 00:19:18 nyheter sm-msp-queue[98732]: starting daemon (8.12.10): queueing@00:30:00

The whole process is thus controlled by a makefile and all
commands needed is summarized as :
make
make install
make restart

You could use a FreeBSD system to generate sendmail.cf for your
current system ( while porting the above Makefile)

-- 
Peter Håkanson         
        IPSec  Sverige      ( At Gothenburg Riverside )
           Sorry about my e-mail address, but i'm trying to keep spam out,
	   remove "icke-reklam" if you feel for mailing me. Thanx.


Relevant Pages

  • Re: Milter crash, restart, mail starts bypassing?
    ... For some reason sendmail starts up, but it sounds like the milter process doesn't do the same? ... Maybe track down why that is and kill the restart, ... When I notice and restart the filter, it starts blasting the mail through. ...
    (comp.mail.sendmail)
  • MIMEDefang, Sendmail, ClamAV, and SpamAssassin (So Close, Need Help!)
    ... But when I restart Sendmail I get the following in my ... (mimedefang): init failed to open ... I can create a new sendmail.cf from the m4 command and restart sendmail ...
    (alt.os.linux.suse)
  • Re: F9 - sendmail wont send on startup?
    ... Just so you're not alone, I also have problems with sendmail, but not ... set my Fedora 9 network configurations for a domain, long ago, since the ... sendmail restart, the messages stuck in the queue are sent. ... This Fedora 9 box is the ...
    (Fedora)
  • Re: Problem with port 25
    ... I am having trouble gettingport 25to work on this server. ... there are some useful targets in the sendmail Makefile: ... # For acting on both the MTA daemon and MSP queue running daemon: ... # restart-mspq - Restart the sendmail MSP queue running daemon ...
    (comp.mail.sendmail)
  • Re: Odd sendmail problem
    ... I had a situation [BSD web server] where the ownership of the web ... server was changed to www - so a break wouldn't give root access. ... sendmail - back in the 4.? ... not at this moment, and then restart sendmail. ...
    (comp.unix.sco.misc)