Dovecot submission service cannot relay to postfix because of auth error The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!cannot send mail to postfix /w iptables linux proxyPostfix rejects all incoming mail (Client host rejected: Access denied)Postfix/Dovecot support multiple domainsCan't connect to Postfix/Dovecot with Airmail.app but I can with Mail.app (Connection refused?)POSTFIX fatal: no SASL authentication mechanismsPostfix alias only forwarding to local usersPostfix very slow delivery554 5.7.1 Relay access denied Postfix Open RelayStatus=bounced unknown user “xxxx”Postfix with Gmail smtp-relay
Derivation tree not rendering
Can a novice safely splice in wire to lengthen 5V charging cable?
Searching for a differential characteristic (differential cryptanalysis)
University's motivation for having tenure-track positions
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
Didn't get enough time to take a Coding Test - what to do now?
Difference between "generating set" and free product?
Is there a writing software that you can sort scenes like slides in PowerPoint?
Are my PIs rude or am I just being too sensitive?
Why can't devices on different VLANs, but on the same subnet, communicate?
Single author papers against my advisor's will?
What is this lever in Argentinian toilets?
How do you keep chess fun when your opponent constantly beats you?
Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?
How does ice melt when immersed in water?
Why did all the guest students take carriages to the Yule Ball?
What was the last x86 CPU that did not have the x87 floating-point unit built in?
The following signatures were invalid: EXPKEYSIG 1397BC53640DB551
Road tyres vs "Street" tyres for charity ride on MTB Tandem
How do I add random spotting to the same face in cycles?
ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?
Wall plug outlet change
How to test the equality of two Pearson correlation coefficients computed from the same sample?
Is this wall load bearing? Blueprints and photos attached
Dovecot submission service cannot relay to postfix because of auth error
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!cannot send mail to postfix /w iptables linux proxyPostfix rejects all incoming mail (Client host rejected: Access denied)Postfix/Dovecot support multiple domainsCan't connect to Postfix/Dovecot with Airmail.app but I can with Mail.app (Connection refused?)POSTFIX fatal: no SASL authentication mechanismsPostfix alias only forwarding to local usersPostfix very slow delivery554 5.7.1 Relay access denied Postfix Open RelayStatus=bounced unknown user “xxxx”Postfix with Gmail smtp-relay
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I've got a dovecot/postfix server, each on different servers and I'm using the dovecot submission service to receive emails and relay them through postfix for sending.
Receiving emails in through postfix -> Dovecot/LMTP works just fine, so authentication is working since dovecot is handling the SASL auth just fine (I'm wondering at what point dovecot will just integrate SMTP directly and we can just run dovecot alone).
The problem is that when sending emails, they get accepted by dovecot, then through submission service get passed along, things seem to be ok until it refuses to authenticate and I get "relay access denied" error.
I thought if I included my dovecot server in the relay_nets and configured permit_mynetworks, etc, it would work, but I'm really having a hard time understanding the postfix docs. Which aren't really explaining very well how everything fits together. It's like a lot of lego pieces and no manual on how to do things right, you just have to "know".
Anyway, opinions aside. This is my postfix main.cf. Can anybody see anything wrong with it?
###############
# General
###############
# disable all the backwards compatibility stuff
compatibility_level = 2
#debug_peer_level = 100
# Main domain and hostname
mydomain = xxxx.com
myhostname = s2.yyyy.com
myorigin = $mydomain
# Message size limit
message_size_limit = 50000000
# Relayed networks
mynetworks = 127.0.0.1/32 [::1]/128 10.0.0.0/8
# Empty alias list to override the configuration variable and disable NIS
alias_maps =
# Only accept virtual emails
mydestination =
# Relayhost if any is configured
#relayhost =
# Recipient delimiter for extended addresses
recipient_delimiter = +
# Default Mailbox size, is set to 0 which means unlimited!
mailbox_size_limit = 0
virtual_mailbox_limit = 0
# readme_directory: The location of the Postfix README files.
#
readme_directory = no
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_protocols = all
###############
# SMTP Server
###############
smtpd_sasl_path = inet:dovecot.mail-server:24
smtpd_sasl_type = dovecot
smtpd_tls_security_level = may
# Let's Encrypt certificate file
smtpd_tls_cert_file = /etc/postfix/certs/tls.crt
# Let's Encrypt key file
smtpd_tls_key_file = /etc/postfix/certs/tls.key
###############
# Virtual
###############
# MySQL configuration
mysql = mysql:$config_directory
# The alias map actually returns both aliases and local mailboxes, which is
# required for reject_unlisted_sender to work properly
virtual_mailbox_domains = $mysql/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = $mysql/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = $mysql/mysql_virtual_alias_maps.cf
# Mails are transported if required, then forwarded to Dovecot for delivery
virtual_transport = lmtp:inet:dovecot.mail-server:24
# In order to prevent Postfix from running DNS query, enforce the use of the
# native DNS stack, that will check /etc/hosts properly.
lmtp_host_lookup = native
###############
# OpenDKIM
###############
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:opendkim.mail-server:8891
non_smtpd_milters = inet:opendkim.mail-server:8891
###############
# Restrictions
###############
# Don't talk to mail systems that don't know their own hostname.
# With Postfix < 2.3, specify reject_unknown_hostname.
smtpd_helo_required=yes
smtpd_helo_restrictions =
reject_invalid_hostname
reject_non_fqdn_hostname
permit_mynetworks,
# Don't accept mail from domains that don't exist.
smtpd_sender_restrictions =
reject_unknown_sender_domain
reject_unauth_destination,
reject_invalid_hostname,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_relay_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
defer_unauth_destination,
reject_unauth_destination
unverified_recipient_reject_reason = Address lookup failure
Here is an example of the postfix log which is made when I try to send an email. It's the only information that I have, I'm able to provide more detailed logs if somebody wants to suggest what to enable to run it again.
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: EHLO [192.168.81.156]
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Completed
smtp-server: conn 10.32.0.1:43280 [0]: Connection state reset
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Sent: 250-yyyy.com 8BITMIME AUTH PLAIN LOGIN BURL imap CHUNKING ENHANCEDSTATUSCODES SIZE PIPELINING
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: MAIL FROM:<info@xxxx.com>
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Sent: 530 5.7.0 Authentication required.
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: QUIT
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Sent: 221 2.0.0 Bye
smtp-server: conn 10.32.0.1:43280 [0]: Disconnected: Client has quit the connection
postfix dovecot sasl
add a comment |
I've got a dovecot/postfix server, each on different servers and I'm using the dovecot submission service to receive emails and relay them through postfix for sending.
Receiving emails in through postfix -> Dovecot/LMTP works just fine, so authentication is working since dovecot is handling the SASL auth just fine (I'm wondering at what point dovecot will just integrate SMTP directly and we can just run dovecot alone).
The problem is that when sending emails, they get accepted by dovecot, then through submission service get passed along, things seem to be ok until it refuses to authenticate and I get "relay access denied" error.
I thought if I included my dovecot server in the relay_nets and configured permit_mynetworks, etc, it would work, but I'm really having a hard time understanding the postfix docs. Which aren't really explaining very well how everything fits together. It's like a lot of lego pieces and no manual on how to do things right, you just have to "know".
Anyway, opinions aside. This is my postfix main.cf. Can anybody see anything wrong with it?
###############
# General
###############
# disable all the backwards compatibility stuff
compatibility_level = 2
#debug_peer_level = 100
# Main domain and hostname
mydomain = xxxx.com
myhostname = s2.yyyy.com
myorigin = $mydomain
# Message size limit
message_size_limit = 50000000
# Relayed networks
mynetworks = 127.0.0.1/32 [::1]/128 10.0.0.0/8
# Empty alias list to override the configuration variable and disable NIS
alias_maps =
# Only accept virtual emails
mydestination =
# Relayhost if any is configured
#relayhost =
# Recipient delimiter for extended addresses
recipient_delimiter = +
# Default Mailbox size, is set to 0 which means unlimited!
mailbox_size_limit = 0
virtual_mailbox_limit = 0
# readme_directory: The location of the Postfix README files.
#
readme_directory = no
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_protocols = all
###############
# SMTP Server
###############
smtpd_sasl_path = inet:dovecot.mail-server:24
smtpd_sasl_type = dovecot
smtpd_tls_security_level = may
# Let's Encrypt certificate file
smtpd_tls_cert_file = /etc/postfix/certs/tls.crt
# Let's Encrypt key file
smtpd_tls_key_file = /etc/postfix/certs/tls.key
###############
# Virtual
###############
# MySQL configuration
mysql = mysql:$config_directory
# The alias map actually returns both aliases and local mailboxes, which is
# required for reject_unlisted_sender to work properly
virtual_mailbox_domains = $mysql/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = $mysql/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = $mysql/mysql_virtual_alias_maps.cf
# Mails are transported if required, then forwarded to Dovecot for delivery
virtual_transport = lmtp:inet:dovecot.mail-server:24
# In order to prevent Postfix from running DNS query, enforce the use of the
# native DNS stack, that will check /etc/hosts properly.
lmtp_host_lookup = native
###############
# OpenDKIM
###############
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:opendkim.mail-server:8891
non_smtpd_milters = inet:opendkim.mail-server:8891
###############
# Restrictions
###############
# Don't talk to mail systems that don't know their own hostname.
# With Postfix < 2.3, specify reject_unknown_hostname.
smtpd_helo_required=yes
smtpd_helo_restrictions =
reject_invalid_hostname
reject_non_fqdn_hostname
permit_mynetworks,
# Don't accept mail from domains that don't exist.
smtpd_sender_restrictions =
reject_unknown_sender_domain
reject_unauth_destination,
reject_invalid_hostname,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_relay_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
defer_unauth_destination,
reject_unauth_destination
unverified_recipient_reject_reason = Address lookup failure
Here is an example of the postfix log which is made when I try to send an email. It's the only information that I have, I'm able to provide more detailed logs if somebody wants to suggest what to enable to run it again.
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: EHLO [192.168.81.156]
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Completed
smtp-server: conn 10.32.0.1:43280 [0]: Connection state reset
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Sent: 250-yyyy.com 8BITMIME AUTH PLAIN LOGIN BURL imap CHUNKING ENHANCEDSTATUSCODES SIZE PIPELINING
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: MAIL FROM:<info@xxxx.com>
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Sent: 530 5.7.0 Authentication required.
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: QUIT
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Sent: 221 2.0.0 Bye
smtp-server: conn 10.32.0.1:43280 [0]: Disconnected: Client has quit the connection
postfix dovecot sasl
add a comment |
I've got a dovecot/postfix server, each on different servers and I'm using the dovecot submission service to receive emails and relay them through postfix for sending.
Receiving emails in through postfix -> Dovecot/LMTP works just fine, so authentication is working since dovecot is handling the SASL auth just fine (I'm wondering at what point dovecot will just integrate SMTP directly and we can just run dovecot alone).
The problem is that when sending emails, they get accepted by dovecot, then through submission service get passed along, things seem to be ok until it refuses to authenticate and I get "relay access denied" error.
I thought if I included my dovecot server in the relay_nets and configured permit_mynetworks, etc, it would work, but I'm really having a hard time understanding the postfix docs. Which aren't really explaining very well how everything fits together. It's like a lot of lego pieces and no manual on how to do things right, you just have to "know".
Anyway, opinions aside. This is my postfix main.cf. Can anybody see anything wrong with it?
###############
# General
###############
# disable all the backwards compatibility stuff
compatibility_level = 2
#debug_peer_level = 100
# Main domain and hostname
mydomain = xxxx.com
myhostname = s2.yyyy.com
myorigin = $mydomain
# Message size limit
message_size_limit = 50000000
# Relayed networks
mynetworks = 127.0.0.1/32 [::1]/128 10.0.0.0/8
# Empty alias list to override the configuration variable and disable NIS
alias_maps =
# Only accept virtual emails
mydestination =
# Relayhost if any is configured
#relayhost =
# Recipient delimiter for extended addresses
recipient_delimiter = +
# Default Mailbox size, is set to 0 which means unlimited!
mailbox_size_limit = 0
virtual_mailbox_limit = 0
# readme_directory: The location of the Postfix README files.
#
readme_directory = no
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_protocols = all
###############
# SMTP Server
###############
smtpd_sasl_path = inet:dovecot.mail-server:24
smtpd_sasl_type = dovecot
smtpd_tls_security_level = may
# Let's Encrypt certificate file
smtpd_tls_cert_file = /etc/postfix/certs/tls.crt
# Let's Encrypt key file
smtpd_tls_key_file = /etc/postfix/certs/tls.key
###############
# Virtual
###############
# MySQL configuration
mysql = mysql:$config_directory
# The alias map actually returns both aliases and local mailboxes, which is
# required for reject_unlisted_sender to work properly
virtual_mailbox_domains = $mysql/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = $mysql/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = $mysql/mysql_virtual_alias_maps.cf
# Mails are transported if required, then forwarded to Dovecot for delivery
virtual_transport = lmtp:inet:dovecot.mail-server:24
# In order to prevent Postfix from running DNS query, enforce the use of the
# native DNS stack, that will check /etc/hosts properly.
lmtp_host_lookup = native
###############
# OpenDKIM
###############
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:opendkim.mail-server:8891
non_smtpd_milters = inet:opendkim.mail-server:8891
###############
# Restrictions
###############
# Don't talk to mail systems that don't know their own hostname.
# With Postfix < 2.3, specify reject_unknown_hostname.
smtpd_helo_required=yes
smtpd_helo_restrictions =
reject_invalid_hostname
reject_non_fqdn_hostname
permit_mynetworks,
# Don't accept mail from domains that don't exist.
smtpd_sender_restrictions =
reject_unknown_sender_domain
reject_unauth_destination,
reject_invalid_hostname,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_relay_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
defer_unauth_destination,
reject_unauth_destination
unverified_recipient_reject_reason = Address lookup failure
Here is an example of the postfix log which is made when I try to send an email. It's the only information that I have, I'm able to provide more detailed logs if somebody wants to suggest what to enable to run it again.
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: EHLO [192.168.81.156]
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Completed
smtp-server: conn 10.32.0.1:43280 [0]: Connection state reset
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Sent: 250-yyyy.com 8BITMIME AUTH PLAIN LOGIN BURL imap CHUNKING ENHANCEDSTATUSCODES SIZE PIPELINING
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: MAIL FROM:<info@xxxx.com>
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Sent: 530 5.7.0 Authentication required.
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: QUIT
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Sent: 221 2.0.0 Bye
smtp-server: conn 10.32.0.1:43280 [0]: Disconnected: Client has quit the connection
postfix dovecot sasl
I've got a dovecot/postfix server, each on different servers and I'm using the dovecot submission service to receive emails and relay them through postfix for sending.
Receiving emails in through postfix -> Dovecot/LMTP works just fine, so authentication is working since dovecot is handling the SASL auth just fine (I'm wondering at what point dovecot will just integrate SMTP directly and we can just run dovecot alone).
The problem is that when sending emails, they get accepted by dovecot, then through submission service get passed along, things seem to be ok until it refuses to authenticate and I get "relay access denied" error.
I thought if I included my dovecot server in the relay_nets and configured permit_mynetworks, etc, it would work, but I'm really having a hard time understanding the postfix docs. Which aren't really explaining very well how everything fits together. It's like a lot of lego pieces and no manual on how to do things right, you just have to "know".
Anyway, opinions aside. This is my postfix main.cf. Can anybody see anything wrong with it?
###############
# General
###############
# disable all the backwards compatibility stuff
compatibility_level = 2
#debug_peer_level = 100
# Main domain and hostname
mydomain = xxxx.com
myhostname = s2.yyyy.com
myorigin = $mydomain
# Message size limit
message_size_limit = 50000000
# Relayed networks
mynetworks = 127.0.0.1/32 [::1]/128 10.0.0.0/8
# Empty alias list to override the configuration variable and disable NIS
alias_maps =
# Only accept virtual emails
mydestination =
# Relayhost if any is configured
#relayhost =
# Recipient delimiter for extended addresses
recipient_delimiter = +
# Default Mailbox size, is set to 0 which means unlimited!
mailbox_size_limit = 0
virtual_mailbox_limit = 0
# readme_directory: The location of the Postfix README files.
#
readme_directory = no
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on. By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_protocols = all
###############
# SMTP Server
###############
smtpd_sasl_path = inet:dovecot.mail-server:24
smtpd_sasl_type = dovecot
smtpd_tls_security_level = may
# Let's Encrypt certificate file
smtpd_tls_cert_file = /etc/postfix/certs/tls.crt
# Let's Encrypt key file
smtpd_tls_key_file = /etc/postfix/certs/tls.key
###############
# Virtual
###############
# MySQL configuration
mysql = mysql:$config_directory
# The alias map actually returns both aliases and local mailboxes, which is
# required for reject_unlisted_sender to work properly
virtual_mailbox_domains = $mysql/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = $mysql/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = $mysql/mysql_virtual_alias_maps.cf
# Mails are transported if required, then forwarded to Dovecot for delivery
virtual_transport = lmtp:inet:dovecot.mail-server:24
# In order to prevent Postfix from running DNS query, enforce the use of the
# native DNS stack, that will check /etc/hosts properly.
lmtp_host_lookup = native
###############
# OpenDKIM
###############
milter_default_action = accept
milter_protocol = 2
smtpd_milters = inet:opendkim.mail-server:8891
non_smtpd_milters = inet:opendkim.mail-server:8891
###############
# Restrictions
###############
# Don't talk to mail systems that don't know their own hostname.
# With Postfix < 2.3, specify reject_unknown_hostname.
smtpd_helo_required=yes
smtpd_helo_restrictions =
reject_invalid_hostname
reject_non_fqdn_hostname
permit_mynetworks,
# Don't accept mail from domains that don't exist.
smtpd_sender_restrictions =
reject_unknown_sender_domain
reject_unauth_destination,
reject_invalid_hostname,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
permit
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_relay_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
defer_unauth_destination,
reject_unauth_destination
unverified_recipient_reject_reason = Address lookup failure
Here is an example of the postfix log which is made when I try to send an email. It's the only information that I have, I'm able to provide more detailed logs if somebody wants to suggest what to enable to run it again.
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: EHLO [192.168.81.156]
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Completed
smtp-server: conn 10.32.0.1:43280 [0]: Connection state reset
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Sent: 250-yyyy.com 8BITMIME AUTH PLAIN LOGIN BURL imap CHUNKING ENHANCEDSTATUSCODES SIZE PIPELINING
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command EHLO; 250 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: MAIL FROM:<info@xxxx.com>
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Sent: 530 5.7.0 Authentication required.
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: command MAIL; 530 reply: Destroy
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: No more commands pending
smtp-server: conn 10.32.0.1:43280 [0]: Received new command: QUIT
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Submitted
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT: Ready to reply
smtp-server: conn 10.32.0.1:43280 [0]: Trigger output
smtp-server: conn 10.32.0.1:43280 [0]: Sending replies
smtp-server: conn 10.32.0.1:43280 [0]: command QUIT; 221 reply: Sent: 221 2.0.0 Bye
smtp-server: conn 10.32.0.1:43280 [0]: Disconnected: Client has quit the connection
postfix dovecot sasl
postfix dovecot sasl
asked Apr 9 at 7:57
Christopher ThomasChristopher Thomas
1004
1004
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962163%2fdovecot-submission-service-cannot-relay-to-postfix-because-of-auth-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f962163%2fdovecot-submission-service-cannot-relay-to-postfix-because-of-auth-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown