You are not logged in.

#1 2012-07-15 16:11:33

pedronoliveira
Member
From: Portugal
Registered: 2012-07-15
Posts: 8

Can't Send Emails Dovecot + Postfix

Hello everyone!
This is my first post in Archlinux Foruns, since I've been using it on my Work Laptop and on my VPS.

I've been having problems in the mail service of my VPS which uses Dovecot + Postfix, I can receive emails, without problem, but i can't send them.

This is the output of postconf -n

alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = mail/
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 50720000
mydestination = localhost, mail.pedroliveira.com@pedroliveira.com
myhostname = pedroliveira.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix/sample
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_delay_reject = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_unauth_pipelining, reject_unknown_sender_domain, reject_rbl_client zen.spamhaus.org, reject_rbl_client list.dsbl.org, reject_rbl_client bl.spamcop.net, check_policy_service inet:127.0.0.1:10030
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/mail.pedroliveira.com.crt
smtpd_tls_key_file = /etc/ssl/private/mail.pedroliveira.com.key
smtpd_tls_loglevel = 1
smtpd_use_tls = yes
soft_bounce = yes
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_transport = dovecot
virtual_uid_maps = static:5000

This is my master.cf code

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
spamassassin    unix    -       n       n       -       -       pipe user=nobody argv=/usr/bin/vendor_perl/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
#smtp      inet  n       -       n       -       1       postscreen
#smtpd     pass  -       -       n       -       -       smtpd
#dnsblog   unix  -       -       n       -       0       dnsblog
#tlsproxy  unix  -       -       n       -       0       tlsproxy
#submission inet n       -       n       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       n       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
          -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache

# Workaround for smtps not being a valid service name.
465 inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes

# Dovecot is acting as the LDA.
dovecot   unix  -       n       n       -       -       pipe
        flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
#

I followed this tutorial
http://www.ian-barton.com/blog/linux/20 … erver.html

And I keep getting this errors:

Errors in mail.log

Jul 15 19:10:00 casper postfix/smtpd[5907]: warning: SASL authentication failure: Password verification failed
Jul 15 19:10:00 casper postfix/smtpd[5907]: warning: 87.109.54.77.rev.vodafone.pt[77.54.109.87]: SASL PLAIN authentication failed: authentication failure
Jul 15 19:10:00 casper postfix/smtpd[5907]: warning: 87.109.54.77.rev.vodafone.pt[77.54.109.87]: SASL LOGIN authentication failed: authentication failure

And in the auth.log

Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - option verbose is set to "1"
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - option crypt is set to "1"
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_close_db() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_sm_authenticate() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_open_db() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_open_db() returning 0.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_check_passwd() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_format_string() called
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_quick_escape() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - SELECT password FROM mailbox WHERE username = 'pedro'
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - SELECT returned no result.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_check_passwd() returning 1.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_sql_log() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_sql_log() returning 0.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_converse() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_open_db() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_check_passwd() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_format_string() called
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_quick_escape() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - SELECT password FROM mailbox WHERE username = 'pedro'
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - SELECT returned no result.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_check_passwd() returning 1.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_sql_log() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_sql_log() returning 0.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_sm_authenticate() returning 10.
Jul 15 19:10:00 casper saslauthd[5380]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_release_ctx() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_destroy_ctx() called.
Jul 15 19:10:00 casper saslauthd[5380]: pam_mysql - pam_mysql_close_db() called.
Jul 15 19:10:00 casper saslauthd[5380]: do_auth         : auth failure: [user=pedro] [service=smtp] [realm=pedroliveira.com] [mech=pam] [reason=PAM auth error]
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - option verbose is set to "1"
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - option crypt is set to "1"
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_close_db() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_sm_authenticate() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_open_db() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_open_db() returning 0.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_check_passwd() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_format_string() called
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_quick_escape() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - SELECT password FROM mailbox WHERE username = 'pedro'
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - SELECT returned no result.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_check_passwd() returning 1.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_sql_log() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_sql_log() returning 0.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_converse() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_open_db() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_check_passwd() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_format_string() called
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_quick_escape() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - SELECT password FROM mailbox WHERE username = 'pedro'
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - SELECT returned no result.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_check_passwd() returning 1.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_sql_log() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_sql_log() returning 0.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_sm_authenticate() returning 10.
Jul 15 19:10:00 casper saslauthd[5381]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_release_ctx() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_destroy_ctx() called.
Jul 15 19:10:00 casper saslauthd[5381]: pam_mysql - pam_mysql_close_db() called.
Jul 15 19:10:00 casper saslauthd[5381]: do_auth         : auth failure: [user=pedro] [service=smtp] [realm=pedroliveira.com] [mech=pam] [reason=PAM auth error]

I've been struggling to get this to work since friday night, any clue on what I'm doing wrong?

Thanks in advance!

Offline

#2 2012-07-16 11:29:37

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Can't Send Emails Dovecot + Postfix

Looking at your postconf -n output, it looks like postfix isn't configured to use dovecot for SASL auth. Those two are missing:

smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot

See http://wiki2.dovecot.org/HowTo/PostfixAndDovecotSASL & http://www.postfix.org/SASL_README.html

From the certificate file name it also looks like you have the server running as mail.pedroliveira.com.
So it should be

myhostname = mail.pedroliveira.com
mydomain = pedroliveira.com

Last edited by teekay (2012-07-16 11:35:54)

Offline

#3 2012-07-16 18:51:05

pedronoliveira
Member
From: Portugal
Registered: 2012-07-15
Posts: 8

Re: Can't Send Emails Dovecot + Postfix

teekay wrote:

Looking at your postconf -n output, it looks like postfix isn't configured to use dovecot for SASL auth. Those two are missing:

smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot

See http://wiki2.dovecot.org/HowTo/PostfixAndDovecotSASL & http://www.postfix.org/SASL_README.html

From the certificate file name it also looks like you have the server running as mail.pedroliveira.com.
So it should be

myhostname = mail.pedroliveira.com
mydomain = pedroliveira.com

teekay, thank you for your answer, just in the bullseye, those configs, were missing as soon as I added them, I got my email setup correct!

Thank you once again!

Offline

Board footer

Powered by FluxBB