Score:1

Relay Host change

cn flag

I have example.com configured as using relay mailjet.com and also the emails associated with that like [email protected] would like this [email protected] to use another relay which is smtp-int.xyz.com which is basically routed internally in my company. Anything sent to @xyz.com is routing through smtp-int.xyz.com Is that possible? I tried to add the entry of [email protected] in /etc/postfix/senders_relay and reloaded postfix but it didn't help....I also tried to add this in /etc/postfix/transport and this also didn't help....may be i am doing something wrong....

/etc/postfix/sender_relay
@example.com    in-v3.mailjet.com

/etc/postfix/transport
xyz.com           smtp:smtp-int.xyz.com
example.com    smtp:in-v3.mailjet.com

/etc/postfix/main.cf
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sender_dependent_authentication = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, mca-xyz.com, localhost
myhostname = mca-xyz.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
smtp_sasl_security_options = noanonymous
smtp_sender_dependent_authentication = yes
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/allowed_senders
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level = may
transport_maps = regexp:/etc/postfix/discard

some log : Nov 16 05:06:27 mca-xyz.com postfix/cleanup[557307]: 7FB925F925: warning: header Subject: Wildfly AS DOPS (mca04.xyz.com) restart OK from mca04.xyz.com[xxx.xx.xx.xxx]; [email protected] [email protected] proto=SMTP helo=<mca04.xyz.com> Nov 16 05:06:27 mca-xyz.com postfix/smtp[557560]: 7FB925F925: [email protected], relay=in.mailjet.com[xxx.xxx.xx.xx]:25, delay=0.26, delays=0.01/0/0.17/0.08, dsn=2.0.0, status=sent (250 OK queued as 5bd486ec-8825-4d16-ad5f-71f18603b431)

anx avatar
fr flag
anx
*"it didn't help"* - please [edit] your question to include the output of the `postconf -n` and relevant logs, that way it might be easier to pinpoint what is currently working and what is not. Please clarify what you want the routing to depend on, sender or recipient.
cn flag
@anx have updated the question and As you can see in logs...its still uses mailjet while it should use smtp-int.xyz.com
cn flag
So basically emails sent from [email protected] to any @xyz.com should use smtp-int.xyz.com but not mailjet
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.