Postfix - b

Konfiguracja serwerów, usług, itp.
Awatar użytkownika
sponsoriada
Beginner
Posty: 149
Rejestracja: 03 października 2010, 22:58
Lokalizacja: Płock

Postfix - błąd uwierzytelnienia SMTP (SASL)

Post autor: sponsoriada »

Witam.
Konfigurowałem Postfixa, Courier i SASL i jak narazie na tym się zatrzymałem.
Problem leży w autoryzacji SMTP przez SASL.
Konfiguracje przeprowadzałem zgodnie z tym poradnikiem : http://www.howtoforge.com/virtual_postf ... courier_p2
Postfix loguję przez imap, pop3. Poczta przychodzi.

Kod: Zaznacz cały

/etc/default/saslauthd

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="pam"
PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"


# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""


# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5


# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
#OPTIONS="-c -m /var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
#PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"


Przy takiej konfiguracji gdzie:

Kod: Zaznacz cały

OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

Kod: Zaznacz cały

testsaslauthd -u user -p password

connect() : No such file or directory

Kod: Zaznacz cały

ls -l /var/spool/postfix/var/run/saslauthd

-rw------- 1 root root      0 02-02 16:25 cache.flock
-rw------- 1 root root 986112 02-02 16:25 cache.mmap
srwxrwxrwx 1 root root      0 02-02 16:25 mux
-rw------- 1 root root      0 02-02 16:25 mux.accept
-rw------- 1 root root      6 02-02 16:25 saslauthd.pid

Kod: Zaznacz cały

/etc/pam.d/smtp

auth    required        pam_mysql.so    user=mail_admin passwd=******1 host=127.0.0.1       db=mail table=users     usercolumn=email  passwdcolumn=password crypt=1
auth    sufficient      pam_mysql.so    user=mail_admin passwd=****** host=127.0.0.1       db=mail table=users     usercolumn=email  passwdcolumn=password crypt=1
~
Poniżej logi z /var/log/auth.log

Kod: Zaznacz cały

Feb  3 10:03:17 espons postfix/smtpd[4638]: sql auxprop plugin using mysql engin                                                                                        e
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option debug is set to ""
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_close_db() called                                                                                        .
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_sm_authenticate() calle                                                                                        d.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_open_db() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_open_db() returni                                                                                        ng 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_format_string() c                                                                                        alled
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_quick_escape() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - SELECT password FROM users                                                                                         WHERE email = 'piotr@espons.pl'
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() re                                                                                        turning 6.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() returni                                                                                        ng 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_converse() called                                                                                        .
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_open_db() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_format_string() c                                                                                        alled
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_quick_escape() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - SELECT password FROM users                                                                                         WHERE email = 'piotr@espons.pl'
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() re                                                                                        turning 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() returni                                                                                        ng 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_sm_authenticate() retur                                                                                        ning 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option user is set to "mail                                                                                        _admin"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option passwd is set to "**                                                                                        **"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option host is set to "127.                                                                                        0.0.1"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option db is set to "mail"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option table is set to "use                                                                                        rs"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option usercolumn is set to                                                                                         "email"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option passwdcolumn is set                                                                                         to "password"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option crypt is set to "1"
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - option debug is set to ""
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_close_db() called                                                                                        .
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_sm_authenticate() calle                                                                                        d.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_open_db() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_open_db() returni                                                                                        ng 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_format_string() c                                                                                        alled
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_quick_escape() ca                                                                                        lled.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - SELECT password FROM users                                                                                         WHERE email = 'piotr@espons.pl'
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_check_passwd() re                                                                                        turning 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() called.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_sql_log() returni                                                                                        ng 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_sm_authenticate() retur                                                                                        ning 0.
Feb  3 10:03:17 espons saslauthd[29008]: pam_unix(smtp:account): could not ident                                                                                        ify user (from getpwnam(piotr@espons.pl))
Feb  3 10:03:17 espons saslauthd[29008]: DEBUG: auth_pam: pam_acct_mgmt failed:                                                                                         Authentication failure
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_release_ctx() cal                                                                                        led.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_destroy_ctx() cal                                                                                        led.
Feb  3 10:03:17 espons saslauthd[29008]: pam_mysql - pam_mysql_close_db() called                                                                                        .
Feb  3 10:03:17 espons saslauthd[29008]: do_auth         : auth failure: [user=p                                                                                        iotr@espons.pl] [service=smtp] [realm=espons.pl] [mech=pam] [reason=PAM acct err                                                                                        or]


Proszę o pomoc i z góry dziękuję.
ODPOWIEDZ