I try to get a setup like to following ready:

1. I have multiple ip postfix should be able to send mails to other MTA
2. I setup different transport in master.cf each with a smtp_bind_address 
corresponding to a single ip
so far, so good! that setup already works

But now I need to handle slow ISPs like yahoo etc. My first try is to add 
transport_maps with like
yahoo.com slow:

But with that the transport changes to slow regardless on which transport it 
was before with sender_dependent_default_transport_maps and therefore the 
message is not sent by the correct ip address.

I now have 4 transports defined which are:
* m1
* m2-slow
* m2
* m2-slow

If i connect to m1.mxsend.ch it should deliver the message with transport m1 
(done my mysql sender_dependent_default_transport_maps) and when connected to 
m2.mxsend.ch it should deliver the message with transport m2. This is working. 
But I cant find a solution to determine the transport regarding sender AND 
receiver of a message like that:
- sender is @m1.mxsend.ch and receiver is [email protected] > use transport m1
- sender is @m1.mxsend.ch and receiver is [email protected]   > use transport 
m1-slow
- sender is @m2.mxsend.ch and receiver is [email protected] > use transport m2
- sender is @m2.mxsend.ch and receiver is [email protected]   > use transport 
m2-slow


Following my setup
main.cf (postconf -n):
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
anvil_rate_time_unit = 60s
anvil_status_update_time = 600s
append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 3d
broken_sasl_auth_clients = yes
debug_peer_level = 2
debug_peer_list = 5.102.146.19
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = ipv4
m1-slow_destination_concurrency_failed_cohort_limit = 100
m1-slow_destination_concurrency_limit = 4
m1-slow_destination_concurrency_positive_feedback = 1/35
m1-slow_initial_destination_concurrency = 1
m2-slow_destination_concurrency_failed_cohort_limit = 100
m2-slow_destination_concurrency_limit = 1
m2-slow_initial_destination_concurrency = 1
mailbox_size_limit = 0
maximal_queue_lifetime = 3d
message_size_limit = 20480000
milter_default_action = accept
milter_protocol = 2
mydestination = $myhostname, localhost.$myhostname, localhost
mydomain = mxsend.ch
myhostname = m1
mynetworks = 127.0.0.0/8 5.102.146.19 5.102.145.149 5.102.151.226
myorigin = $myhostname
non_smtpd_milters = inet:localhost:12301
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
sender_dependent_default_transport_maps = 
mysql:/etc/postfix/mysql_sender_dependent_default_transport_maps.cf
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_connection_count_limit = 0
smtpd_client_connection_rate_limit = 0
smtpd_client_event_limit_exceptions =
smtpd_error_sleep_time = 1s
smtpd_hard_error_limit = 2000
smtpd_milters = inet:localhost:12301
smtpd_recipient_restrictions = reject_non_fqdn_sender, 
reject_non_fqdn_recipient, reject_unauthenticated_sender_login_mismatch 
permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_soft_error_limit = 1000
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/maildirs
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:5000

master.cf (postconf -P):
m1/unix/smtp_bind_address = 5.102.145.149
m1/unix/smtp_helo_name = m1.mxsend.ch
m1/unix/syslog_name = postfix-m1
m2/unix/smtp_bind_address = 5.102.151.226
m2/unix/smtp_helo_name = m2.mxsend.ch
m2/unix/syslog_name = postfix-m2
m1-slow/unix/smtp_bind_address = 5.102.145.149
m1-slow/unix/smtp_helo_name = m1.mxsend.ch
m1-slow/unix/syslog_name = postfix-m1-slow
m2-slow/unix/smtp_bind_address = 5.102.151.226
m2-slow/unix/smtp_helo_name = m2.mxsend.ch
m2-slow/unix/syslog_name = postfix-m2-slow
5.102.145.149:smtp/inet/myhostname = m1.mxsend.ch
5.102.145.149:submission/inet/myhostname = m1.mxsend.ch
5.102.151.226:smtp/inet/myhostname = m2.mxsend.ch
5.102.151.226:submission/inet/myhostname = m2.mxsend.ch

Reply via email to