[clug] [PMX:#] Postfix tweaking

Andrew Pollock andrew-clug at andrew.net.au
Thu Sep 2 06:28:22 GMT 2004

On Thu, Sep 02, 2004 at 01:33:19PM +1000, Collins, Steve wrote:
> >So where do you want internal mail to go? Be delivered locally?
> I'm guessing so, as this is my first leap into mail servers.
> What I want of for messages to our email-SMS provider (and potentially several home email addresses) to be sent via the SMTP relay, and for all mail sent to industry.gov.au to just go straight to the contacts (all someone at industry.gov.au) bypassing the relay.  It's all messages from our Nagios server, and having the SMTP relay append a bloody great disclaimer footer on the mail is a giant PITA.
> I can't imagine this is terribly hard to manage.

Right, so (with glorious ASCII art) you have:

		+---------------| Nagios |----+
		|		+--------+    |
		|			      |
	+-------+-------------+		+---------------------+
	| external SMTP relay |		|industry.gov.au relay|
	+---------------------+		+---------------------+

As someone else suggested, you need to play with the Postfix equivalent of
Sendmail's mailtertables, which is transports I think.

So you need to add two entries, one that directs mail to industry.gov.au to
your industry.gov.au SMTP relay, and either a general smarthost entry, or
one for the domain of your SMS gateway provider, that goes to your external
SMTP relay.

So let's say you smarthost everything to your external SMTP relay, and have
a transport entry for industry.gov.au:


relay = [external.smtp.relay]

to your /etc/postfix/main.cf (square brackets required)

Add to your /etc/postfix/transport file

industry.gov.au	smtp:[industry.gov.au.relay]

(square brackets required again) and run postmap /etc/postfix/transport

Also ensure that your /etc/postfix/main.cf mentions 

transport_maps = hash:/etc/postfix/transport



More information about the linux mailing list