Re: Setting up mail server


Subject: Re: Setting up mail server
arthur@corlissfamily.org
Date: Wed Dec 26 2001 - 16:36:32 AKST


On Wed, 26 Dec 2001, James Bagley Jr. wrote:

> Clearly, sendmail doesn't realize that it should be the final destination
> for mail sent to 'techalaska.com'. It is also advertising a host
> 'sspeedy.techalaska.com' that doesn't exist, this will cause problems when
> you try to send mail. Your mail server should advertise the hostname
> resolved by a reverse lookup of your ip address, which is:
>
> cable-186-3-237-24.anchorageak.net
>
> and, your mail server should accept delivery of mail sent to
> techalaska.com
>
> If you can figure out how to make sendmail do those two things you are in.

Do a grep on /etc/mail/sendmail.cf for '.cw'. If there's lines
similar to the following:

##### $Id: use_cw_file.m4,v 8.9 1999/02/07 07:26:13 gshapiro Exp $ #####
Fw-o /etc/mail/sendmail.cw

then all should need to do is put each of the domains you're accepting mail
for in that file (assuming your MX records in DNS are already correct).

For those that think that sendmail is daunting, it can be as easy as this:

Create a macro conf-generation file wil the desired options, like the
following example (I typically name this file sendmail.mc):

FEATURE(virtusertable, `hash -o /etc/mail/virtusertable.db' )dnl
FEATURE(access_db, `hash -o /etc/mail/access.db' )dnl
FEATURE(use_cw_file, `/etc/mail/sendmail.cw')dnl
FEATURE(use_ct_file, `/etc/mail/sendmail.ct')dnl
FEATURE(nouucp, reject)dnl
FEATURE(redirect)dnl
FEATURE(smrsh, `/usr/sbin/smrsh')dnl

dnl "SPfhn9" are local_procmail's defaults, "u" is appended to force case
dnl sensitive user checking
FEATURE(local_procmail, `/usr/bin/procmail', `', `SPfhn9u')dnl

define(`confME_TOO', True)dnl
define(`confCW_FILE', `-o /etc/mail/sendmail.cw')dnl
define(`confCT_FILE', `-o /etc/mail/sendmail.ct')dnl
define(`STATUS_FILE', `/var/log/sendmail.st')dnl
define(`ALIAS_FILE', `/etc/mail/aliases')dnl
define(`confPRIVACY_FLAGS', `goaway')dnl
define(`confMAX_RCPTS_PER_MESSAGE', 10)dnl
undefine(`confALIAS_WAIT')dnl

MAILER(local)dnl
MAILER(smtp)dnl

Cwlocalhost

That done, go to your sendmail source/cf directory, and create the
configuration file:

        m4 m4/cf.m4 ~/sendmail.mc > /etc/mail/sendmail.cf

From that point, it's just putting the appropriate values in the rest of the
files under /etc/mail:

        sendmail.cw # domains to accept mail for
        sendmail.ct # 'trusted' user accounts
        access # hosts/accounts to allow relaying/delivery
        virtusertable # account/domain mapping & constraints
        aliases # account to account/list mappings

Three of those text files (access, virtusertable, & aliases) are used to
create db files for faster access by sendmail. To build those databases, use
the following (or put them into a script):

        # Build aliases.db
        sendmail -bi

        # Build other dbs
        makemap hash virtusertable.db < virtusertable
        makemap hash access.db < access

Now that your sendmail is completely reconfigured, start it up:

        sendmail -bd -q15m

:-) Pretty easy, eh? There's a hell of a lot more that can be done, but
that's a nutshell version of it.

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto



This archive was generated by hypermail 2a23 : Wed Dec 26 2001 - 16:36:26 AKST