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;








0















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









share|improve this question




























    0















    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









    share|improve this question
























      0












      0








      0








      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









      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 9 at 7:57









      Christopher ThomasChristopher Thomas

      1004




      1004




















          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
          );



          );













          draft saved

          draft discarded


















          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















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

          Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020