TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:1069] sendmail configuration ?




> -----Original Message-----
> From: Kapoor, Nishikant X [mailto:Nishikant.X.Kapoor@nspco.com]
>
> I've my Linux box on the local network (genx) inside the firewall
> and I've a
> mail server(polaris) sitting outside the firewall. Assuming I
> have access to
> polaris through the firewall, how do I setup my sendmail on genx
> so that it
> can use polaris to communicate with the outside world. (I'm trying to use
> elm for email, if that matters).
>

	It's been a while since I've done this, and I usually wind up going by
trial-and-error every time I have to change it, so this may not be 100%
complete, but it should at least get you started...
	Sendmail on most linux distributions works OK out of the box... The
important thing is to make sure that you've got name resolution and routing
correctly configured.
	If your firewall supports SMTP (i.e. sendmail or smail), you may want to
consider using it for outgoing mail instead.  We do that here because it's
generally safer to proxy mail out than to open a port on the firewall.  If
you don't have that option, you'll need port 25 open on the firewall.
	There's a couple things you can do to test whether or not this should work.
The first is, try to connect to polaris on port 25, like this (I'll use
single quotes to indicate the stuff you should be typing.  You don't have to
type the quote marks):

	$'telnet polaris 25'

You should get something that looks a little like this.

	-220 polaris.yourdomain.com ESMTP Fri, 4 Sep 1998 10:16:00 -0500 (CDT)

But so long as you don't get hung up on, you're on the right track.

Use the command 'QUIT' to close that connection, and then test name
resolution:

	$'nslookup'

	> 'set type=MX'
	> 'disney.com'

If you get this:

	Server:  something.somedomain.com
	Address:  192.168.xxx.xxx

	disney.com      preference = 5, mail exchanger = huey.disney.com
	disney.com      nameserver = huey.disney.com
	disney.com      nameserver = ns3.sprintlink.net
	disney.com      nameserver = ns2.sprintlink.net
	disney.com      nameserver = noc.cerf.net
	huey.disney.com internet address = 204.128.192.10
	ns3.sprintlink.net      internet address = 204.97.212.10
	ns2.sprintlink.net      internet address = 199.2.252.10
	noc.cerf.net    internet address = 192.153.156.22

Then this means your system knows where to forward outgoing mail to remote
servers, and you should be all set as far as *outgoing* mail goes.

If the nslookup failed, but the port 25 telnet succeeded, you have two
choices.  You can reconfigure your DNS settings (which you'll have to do
eventually anyways, most likely), or you can try modifying the "DR" line in
sendmail.cf to "DRpolaris.yourdomain.com" and restarting sendmail -- this
should force your system to use polaris as a mailhub for outgoing mail.
Provided polaris is configured succesfully, this should work.  There's also
a "DS" entry which you may want to set to polaris as well (it defines a
"smart" relay host), but I don't think it's necessary.  I know I've never
had to use it.

This should at least get you to the point where you can send mail out
succesfully.  Receiving mail is a whole 'nother ball of wax.  In order to
set this up, I'd need to know whether you want polaris to automatically
forward your mail to your machine (i.e, treat genx as a personal mail
server) or else have polaris hold your mail until you pick it up using POP3
or IMAP.

O'Reilly and associates puts out a great book on sendmail, but it's pretty
pricey and contains way more information than you'll ever need.  Their "DNS
and BIND" book actually has a good section on mail transport that should
tell you all you need to know.  Most Unix or Linux System Administration
handbooks will have a chapter on the subject as well.