Score:-1

POSTFIX only sends mail to GMail

gb flag

I have created a mail server using dovecot and postfix(Ubuntu ec2-aws). I'm receiving emails from any domain. but I can only send emails to gmail. When i try to send email to other domains,

CA58541898     1067 Sat May  7 09:22:44  [email protected]
(conversation with mail.senderdomain.com[162.xxx.xxx.xx] timed out while receiving the initial server greeting) mail.senderdomain.com   

above message is shown when I sudo mailq thanks in advance. This is my postfix/main.cf `

smtpd_banner = $myhostname ESMTP $mail_name (mydomain.online)
biff = no

append_dot_mydomain = no


readme_directory = no

compatibility_level = 2
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

smtpd_sasl_auth_enable = yes

broken_sasl_auth_clients = yes

smtpd_sasl_authenticated_header = yes

virtual_transport = lmtp:unix:private/dovecot-lmtp

smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname
smtpd_recipient_restrictions =
        permit_mynetworks
        permit_sasl_authenticated,
        reject_non_fqdn_recipient,
        reject_unknown_recipient_domain,
        reject_unlisted_recipient,
        reject_unauth_destination
smtpd_sender_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_sender,
        reject_unknown_sender_domain
smtpd_relay_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        defer_unauth_destination

myhostname = mail.mydomain.online
mydomain =mail.mydomain.online
myorigin = $mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost $mydomain
relayhost =
mynetworks = 3.221.159.203 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 localhost
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
relay_domains = $mydomain
Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
virtual_transport = lmtp:unix:private/dovecot-lmtp

virtual_mailbox_domains = mysql:/etc/postfix/virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/virtual-users.cf
virtual_alias_maps = mysql:/etc/postfix/virtual-aliases.cf,
        mysql:/etc/postfix/virtual-email2email.cf

disable_vrfy_command = yes
strict_rfc821_envelopes = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtp_always_send_ehlo = yes
smtpd_timeout = 30s
smtp_helo_timeout = 15s
smtp_rcpt_timeout = 15s
smtpd_recipient_limit = 40
minimal_backoff_time = 180s
maximal_backoff_time = 3h
smtp_tls_security_level=may
invalid_hostname_reject_code = 550
non_fqdn_reject_code = 550
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550

smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.mydomain.online/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.mydomain.online/privkey.pem
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
anx avatar
fr flag
anx
Please [edit] your question to include more details about your configuration, environment and the steps you tested with multiple, known-good destinations that lead you to conclude that the only destination you can deliver mail to is gmail.
anx avatar
fr flag
anx
Have you tested other known-good destinations? Specifically, have you ruled out that you have a connectivity problem only disrupting IPv4, which would leave Google unaffected, but will impact many others?
Dinesh Kumar avatar
gb flag
yes i have tested with other domain emails, for some works as you said, Most of them doesnt work.
Dinesh Kumar avatar
gb flag
@anx thanks, checked with spam test result it shows dmarc issues.
anx avatar
fr flag
anx
Yeah thats what the test checks for, not the point though. For now, you are diagnosing just connection problems, right. Meaning you should have just produced additional **logs** which you could [clarify your question](https://serverfault.com/posts/1100395/edit) with.
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.