# Postfix/Dovecot SASL SMTP authentication problem



## NuLL3rr0r (Mar 5, 2014)

Hi,

I need SMTP authentication from my Gmail account but I get the following error in /var/log/maillog without any further explanation even with log level 3:

```
SASL PLAIN authentication failed
```

This is my main configuration file:

```
message_size_limit = 0
mailbox_size_limit = 0

queue_directory      = /var/spool/postfix
command_directory    = /usr/local/sbin
daemon_directory     = /usr/local/libexec/postfix
data_directory       = /var/db/postfix
mail_owner           = postfix
mynetworks_style     = host
sendmail_path        = /usr/local/sbin/sendmail
newaliases_path      = /usr/local/bin/newaliases
mailq_path           = /usr/local/bin/mailq
setgid_group         = maildrop
html_directory       = /usr/local/share/doc/postfix
manpage_directory    = /usr/local/man
sample_directory     = /usr/local/etc/postfix
readme_directory     = /usr/local/share/doc/postfix
mailbox_command      = /usr/local/libexec/dovecot/deliver
unknown_local_recipient_reject_code = 550

myhostname = something.example.com
mydomain = example.com

smtpd_delay_reject = yes
smtpd_helo_required = yes
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unauth_destination,
  reject_unauth_pipelining,
  reject_invalid_hostname,
  reject_rbl_client bl.spamcop.net
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_cert_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_CAfile = /etc/ssl/postfix/smtpd.pem
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
strict_rfc821_envelopes = no

virtual_mailbox_domains    = example.com
virtual_mailbox_base       = /mail
virtual_mailbox_maps       = hash:/mail/postfix_accounts
virtual_minimum_uid        = 100
virtual_uid_maps           = static:26
virtual_gid_maps           = static:6
local_recipient_maps       = $virtual_mailbox_maps

# Forwarding, Note: when you are testing forwarding, don't send the test email from the destination address !!
virtual_alias_maps       = hash:/mail/postfix_forwards

# You won't find dovecot_destination_recipient_limit in the Postfix documentation.
# But it is necessary to recieve mails with multiple
# *@domain.tld as recipient in one email
# To tell Postfix to actually use deliver
virtual_transport          = dovecot
dovecot_destination_recipient_limit = 1
```


----------

