Having just set up a second mail server, I thought I'd go through and mention the quirks and pitfalls for the whole process in case someone else has to do this. My source for most of this was [http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch21_:_Configuring_Linux_Mail_Servers]. It's pretty accurate, but I'm going to summarize what it says, and mention a few places where our systems need specific setup guidelines. I'll couch this as a series of steps, although some of it might already be done for you.

Business to be taken care of

Firstly, you need to make sure your host name works, unless you want people sending mail to xxx@[an IP address]. Make sure it's registered with the DNS, etc.

1. Install sendmail and sendmail-cf

Watch out, there's a DIFFERENT package called sendmail.cf; it's probably already installed.

2. Configure the sendmail.cf file

This file, along with almost all the significant sendmail configuration files, is located in /etc/mail in RedHat? distributions (it could potentially be in /etc, I think).

Sendmail.cf is ugly and full of macros no one understands. DO NOT EDIT IT; instead, edit the file sendmail.mc (should also be in /etc/mail) and compile it into sendmail.cf (just do "make" in the /etc/mail directory; if you're curious what make actually does, read the documentation). Note that sendmail.mc does not use "#" for comments; to comment out a line, put "dnl" at the front. Also when it uses quotation marks, the first one is a ` and the second is a '.

Things to change in sendmail.mc:

  • There is a line that looks like define(`SMART_HOST'...). We need to relay mail through the UT mail server, so uncomment this line and insert the following: define(`SMART_HOST', `smtp.utmem.edu')
  • There are 2 lines in a row, commented out by default, that look like TRUST_AUTH_MECH(...) and define(`confAUTH_MECHANISMS'...). These need to be uncommented if you plan on using the mail server from a different machine (anything but ssh'ing in and issuing the mail command). Uncomment them.
  • As it says in the comments above those lines, you also need to turn on saslauthd ("service saslauthd start"). I've verified the authorization mechanisms don't work unless this is on.
  • There is a line that looks like FEATURE(`accept_unresolvable_domains'). Commenting this out helps prevent people from using the mail server as a relay for massive amounts of spam.
  • There is a line that looks like FEATURE(`relay_based_on_MX'). The server seems to work whether or not it's active. Right now I have it commented out.

That's it for sendmail.mc. Compile it and move on.

3. Configure access

This file may be correct by default. It needs to look like:

Connect:localhost.localdomain RELAY

Connect:localhost RELAY

Connect:127.0.0.1 RELAY

rhodes.utmem.edu RELAY

Change rhodes.utmem.edu to your host name.

4. Configure local-host-names

This file is a list of aliases for your machine. Mine is only one line:

rhodes.utmem.edu

If you have more aliases, consult the documentation for how to list them.

5. Configure virtusertable

I'm not sure how important this file is. I managed to partially break the server by commenting out lines in mine, so it probably matters. Example file:

adler@rhodes.utmem.edu adler

rwilliam@rhodes.utmem.edu rwilliam

Just map email addresses to local users. This, by the way, is how you add an email account. Just add a user account and put them in this file.

6. Aliases

You don't have to change anything in this file. The defaults are fine. If you want to set up a server-side mailing list, this is the place to do it. Run the command "newaliases" if you change anything here.

7. Dovecot

Sendmail mostly just deals with the mail spools (in /var/spool/mail, if you didn't know). Dovecot is a nice little program that lets you use mail programs to get your mail rather than cat'ing your log file. It supports imap and pop. To set it up, first download it ("yum install dovecot"), then go to the config file and uncomment the "protocols=..." line, leaving in whatever protocols you want to support. I just did pop. Then do "service dovecot start" and you're done.

-- KevAdler - 23 Sep 2008

Topic revision: r1 - 23 Sep 2008 - 17:44:12 - KevAdler
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback