Discussion:
sender_dependent_relayhost_maps (fwd)
(too old to reply)
Homer Wilson Smith
2013-04-15 20:17:23 UTC
Permalink
Dear Gentle Folk,

I wish to relay all mail from our outgoing mail server,
smtp.lightlink.com, through a default outgoing barracuda, EXCEPT mails
FROM specified addresses that wish to do large authorized mailings that
tend to bury the barracuda. These exceptions should be delivered directly
by the outgoing mail server, smtp.lightlink.com

I have

#relayhost =

sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost

relayhost file says

* [barracuda.lightlink.com]:25
***@spammer.com :

the first line alone doesn't work, the second line doesn't either :)

I apologize for my stupidity in advance.

Thanks Homer

------------------------------------------------------------------------
Homer Wilson Smith Clean Air, Clear Water, Art Matrix - Lightlink
(607) 277-0959 A Green Earth, and Peace, Internet, Ithaca NY
***@lightlink.com Is that too much to ask? http://www.lightlink.com
Wietse Venema
2013-04-15 20:25:00 UTC
Permalink
Post by Homer Wilson Smith
#relayhost =
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost
relayhost file says
* [barracuda.lightlink.com]:25
I don't know what "*" or ":" is supposed to mean. They certainly
are not documented for sender_dependent_relayhost_maps.

What the documentation does support is:

/etc/postfix/main.cf:
relayhost = [barracuda.lightlink.com]:25
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost

/etc/postfix/relayhost
***@spammer.com smtp.lightlink.com

Don't forget "postmap hash:/etc/postfix/relayhost".

As documented sender_dependent_relayhost_maps takes precedence over
relayhost.

Wietse
Viktor Dukhovni
2013-04-15 21:25:20 UTC
Permalink
Post by Homer Wilson Smith
Dear Gentle Folk,
I wish to relay all mail from our outgoing mail server,
smtp.lightlink.com, through a default outgoing barracuda, EXCEPT
mails FROM specified addresses that wish to do large authorized
mailings that tend to bury the barracuda. These exceptions should
be delivered directly by the outgoing mail server,
smtp.lightlink.com
I have
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost
Instead use:

main.cf:
# If you have cdb, adjust accordingly if not
default_database_type = cdb

indexed = ${default_database_type}:${config_directory}/
sender_dependent_default_transport_maps = ${indexed}sender-transport

# Default transport for all senders, includes the default relay
default_transport = smtp:[relay.example.com]

# Empty default relayhost!
relayhost =

sender-transport:
# The smtp transport with no nexthop sends direct, since relayhost
# is not set. The senders below bypass the default transport which
# specifies the normal relay
***@example.com smtp
***@example.com smtp
...

Don't forget to postmap the sender-transport file:

Makefile:
all: sender-transport.cdb

sender_transport.cdb: sender-transport
postmap cdb:sender-transport
--
Viktor.
Loading...