PostFix + Sasl + PAM

Discussion in 'Installation/Configuration' started by 573v4n4770, May 18, 2016.

  1. 573v4n4770

    573v4n4770 New Member

    Hi. I follow several tutorials to implement my email server. I am using Ubuntu Server with Postfix + Postfixadmin + Courier IMAP + VirtualUsers + MySQL.
    Now I have problems to send a email from authenticated client. On true the problem is the authentication.
    As far as I can go to isolate the problem is:
    Code:
    sudo testsaslauthd -s smtp -u [email protected] -p test
    size read failed
    The logs are:
    tail -f /var/log/mysql/mysql.log
    Code:
    160516  9:28:39  86 Connect  mail@localhost on maildb
      86 Init DB  maildb
      86 Query  SELECT password FROM mailbox WHERE username = '[email protected]'
      86 Query  SELECT password FROM mailbox WHERE username = '[email protected]'
    tail -f /var/log/auth.log
    Code:
    May 16 09:28:39 correio sudo: stevanatto : TTY=pts/0 ; PWD=/home/stevanatto ; USER=root ; COMMAND=/usr/sbin/testsaslauthd -s smtp -u [email protected] -p test
    May 16 09:28:39 correio sudo: pam_unix(sudo:session): session opened for user root by stevanatto(uid=0)
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - option verbose is set to "1"
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - option crypt is set to "1"
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_close_db() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_sm_authenticate() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_open_db() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_open_db() returning 0.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_check_passwd() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_format_string() called
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_quick_escape() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - SELECT password FROM mailbox WHERE username = '[email protected]'
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_check_passwd() returning 6.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_sql_log() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_sql_log() returning 0.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_converse() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_open_db() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_check_passwd() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_format_string() called
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - pam_mysql_quick_escape() called.
    May 16 09:28:39 correio saslauthd[1832]: pam_mysql - SELECT password FROM mailbox WHERE username = '[email protected]'
    May 16 09:28:39 correio sudo: pam_unix(sudo:session): session closed for user root
    From MySql server comes:
    Code:
      username  password  name  maildir  quota  local_part  domain  created  modified  active
      [email protected]  {crypt}ed6SBJHPP43Ek  [email protected]/  0  test  example.com  2016-05-16 09:14:57  2016-05-16  09:14:57  1
    The configurations are:
    sudo vi /etc/pam.d/smtp
    Code:
    auth required pam_mysql.so user=mail passwd=my_pass host=127.0.0.1 db=maildb table=mailbox usercolumn=username passwdcolumn=password verbose=1 crypt=1
    account sufficient pam_mysql.so user=mail passwd=my_pass host=127.0.0.1 db=maildb table=mailbox usercolumn=username passwdcolumn=password verbose=1 crypt=1
    Did I goofed somewhere ?
    Thank you in advance, masters.
     

Share This Page