[clug] [PMX:#] Sendmail forwarding

Andrew Pollock andrew-clug at andrew.net.au
Tue Aug 24 08:27:28 GMT 2004

On Tue, Aug 24, 2004 at 04:59:22PM +1000, Collins, Steve wrote:
> All
> I have a RH9 box running Nagios which is merrily sending internal mail around our network.  However, now I want to get some after-hours mail going.  I have information about an approved SMTP gateway for my use, but not being across sendmail in any real way, have no idea how to relay via the gateway.
> Any and all advice appreciated.

If you want all external mail to go via the gateway, define a smarthost in
your /etc/mail/sendmail.mc thusly:

define(`SMART_HOST', `smtp:[w.x.y.z]')

where w.x.y.z is the IP address of the SMTP gateway.

You then need to rebuild your sendmail.cf, which on Red Hat used to be a
real pain, but may be as simple as running "make -C /etc/mail" these days,
and restart Sendmail.

If you want selective domains to be sent via the gateway, you need to ensure
that you have 


in your sendmail.mc, and then add rules to your /etc/mail/mailertable file
in the format

example.com	smtp:[w.x.y.z]

You then need to rehash your mailertable file, which may also be as simple
as rebuilding your sendmail.cf, i.e. run "make -C /etc/mail"

Hope this helps. 

http://www.sendmail.org/m4/readme.html is a good source of information.



More information about the linux mailing list