All this is done to put users into our own "classes" (eg. spammers vs.
non-spammers). Because there are clean and dirty IP pools and if we see
that user *may be* abusing email (or any other) system we want to put
them to "dirty" pool for some time. While this works with ordinary
senders, it does not for aliases and spammers are abusing that (we have
a few IP addresses blacklisted by gmail, yahoo, hotmail because of this).
And we do use other means to fight spammers (sender rate, policyd,
quotas, RBLs, FBL, etc., etc.), but that is not enough. Classifying
users to groups already improved quality of our email services and we
would like to improve it further.
On 22/07/15 17:25, Viktor Dukhovni wrote:
On Wed, Jul 22, 2015 at 05:01:48PM +0300, Edgaras Luko?evi?ius wrote:
Now I have some aliases in SQL `alias` table.
Are these virtual(5) aliases or local aliases(5)?
By default when postfix
unpacks this alias and sees external recipient it will send email through
first primary IP address of the server. No routing at all.
That's nonsense, the (final alias-expanded) recipient domain
determines the address class:
http://www.postfix.org/ADDRESS_CLASS_README.html
If that address class is "default" and there is no transport table
override for the domain in question, then the sender address (via
sender_dependent_default_transport) can be used to select one of
a set of transports that handle the outbound email.
Example:
alias.address | alias.goto
+---------------|--------------------+
alias1@mydomain | recipie...@gmail.com
alias2@mydomain | recipie...@gmail.com
The final recipient address is in the "goto" column. This is the
address used to determine the address class. Since (presumably)
gmail.com is not one of your own domains, the address class will
be "default", and the sender address can be used to select a suitable
outbound transport (unless there's transport override for gmail.com).
I want emails received:
* by alias1@mydomain and forwarded to external destination
recipie...@gmail.com to be delivered through outbound1
This is not possible, and for good reason, the routing of mail must
be based on the destination address, not the alias through which
it is expanded.
* by alias2@mydomain and forwarded to external destination
recipie...@gmail.com to be delivered through outbound2
Why would you want this? The only thing that approximates this is
the "owner-alias" feature of the local(8) delivery agent, in which
aliases with an "owner-alias" get their sender address replaced by
the "owner-alias" (or its expansion). Then the resulting mail will
do default transport selection based on the new envelope sender.
This requires that the aliases in question be local aliases(5).
Now If I receive email from send...@hotmail.com to alias alias1@mydomain and
forward it to recipie...@gmail.com
sender: send...@hotmail.com
recipient: alias1@mydomain
after unpacking:
sender: send...@hotmail.com
recipient: recipie...@gmail.com
Obviously, sender_dependent_default_transport_maps won't work here.
It works exactly as documented, by selecting the transport based
on the sender.