cmp_
4th June 2008, 11:45
Hi all.
Firstly sorry for my english. (I'm from Spain)
I followed the tutorial : Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS) by falko. (http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04)
Some comments first:
- My SO is Ubuntu 7.10 (but I think that's no problem)
- I skipped :
9 Install amavisd-new, SpamAssassin, And ClamAV and
10 Install Razor, Pyzor And DCC And Configure SpamAssassin
11 Quota Exceedance Notifications
- My DB has different tables and fields names (buy this is not the problem. I have installed postfixadmin):
mysql> show tables;
+-----------------------+
| Tables_in_postfix |
+-----------------------+
| admin |
| alias |
| config |
| domain |
| domain_admins |
| domains |
| fetchmail |
| forwardings |
| log |
| mailbox |
| transport |
| vacation |
| vacation_notification |
+-----------------------+
mysql> select * from mailbox;
+----------------------------+---------------+------------------------+-----------------------------+-------+-----------------+---------------------+---------------------+--------+
| username | password | name | maildir | quota | domain | created | modified | active |
+----------------------------+---------------+------------------------+-----------------------------+-------+-----------------+---------------------+---------------------+--------+
| user1@mydomain.com | c5tEtb1XoJaRg | user 1 | user1@mydomain.com/ | 0 | mydomain.com | 2008-05-28 11:06:21 | 2008-05-28 11:06:21 | 1 |
The mail system appears to work fine but the "problem" is a message in /etc/log/auth.log :
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: sql_select option missing
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: auxpropfunc error no mechanism available
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
This messages appears every time I send an email or when I connect to localhost 25 via telnet (telnet localhost 25).
I try to do this:
Testing SASL authentication in the Postfix SMTP server (http://www.postfix.org/SASL_README.html)
$ perl -MMIME::Base64 -e 'print encode_base64("\0'user1@mydomain.com'\0mypass");'
AHVzZXIxLmNvbQBteXBhc3M=
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.panell.org ESMTP Postfix (Ubuntu)
ehlo client
250-mail.panell.org
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH CRAM-MD5 DIGEST-MD5 NTLM LOGIN PLAIN
250-AUTH=CRAM-MD5 DIGEST-MD5 NTLM LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN AHVzZXIxLmNvbQBteXBhc3M=
535 5.7.0 Error: authentication failed: authentication failure
quit
221 2.0.0 Bye
LOGS:
/var/log/mail.log :
Jun 3 18:47:03 Ub7 postfix/smtpd[18667]: connect from localhost[127.0.0.1]
Jun 3 18:47:54 Ub7 postfix/smtpd[18667]: warning: SASL authentication failure: Password verification failed
Jun 3 18:47:54 Ub7 postfix/smtpd[18667]: warning: localhost[127.0.0.1]: SASL PLAIN authentication failed: authentication failure
Jun 3 18:47:57 Ub7 postfix/smtpd[18667]: disconnect from localhost[127.0.0.1]
/var/log/auth.log (If I send an email, the log is identical)
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: sql_select option missing
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: auxpropfunc error no mechanism available
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
After many hours I have arrived at the conclusion that smtpd.conf is ignored. I can write anything inside and the "error" is the same.
_________________
Copy-paste important files:
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myorigin = /etc/mailname
myhostname = mail.panell.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination =
relayhost =
mynetworks = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
unknown_local_recipient_reject_code = 450
# Virtual Mailbox Domain Settings
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit = 51200000
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_transport = virtual
# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the your maildir has overdrawn your diskspace quota, please free up some of spaces of your mailbox try again.
virtual_overquota_bounce = yes
virtual_alias_domains =
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
#If I insert "check_policy_service inet" it doesn't work
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
# Added:
smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
#transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
/etc/pam.d/smtp
auth required pam_mysql.so user=postfix passwd=mypass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1
account sufficient pam_mysql.so user=postfix passwd=mypass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1
/etc/postfix/sasl/smtpd.conf and /var/spool/postfix/etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: postfix
sql_passwd: mypass
sql_database: postfix
sql_select: select password from mailbox where username='%u@%r' and active = 1
/etc/courier/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD mypass
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD concat(quota,'S')
/etc/default/saslauth
START=yes
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
I don't find the solution...
Any suggestions?
Thanks and sorry for my poor english
Firstly sorry for my english. (I'm from Spain)
I followed the tutorial : Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS) by falko. (http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04)
Some comments first:
- My SO is Ubuntu 7.10 (but I think that's no problem)
- I skipped :
9 Install amavisd-new, SpamAssassin, And ClamAV and
10 Install Razor, Pyzor And DCC And Configure SpamAssassin
11 Quota Exceedance Notifications
- My DB has different tables and fields names (buy this is not the problem. I have installed postfixadmin):
mysql> show tables;
+-----------------------+
| Tables_in_postfix |
+-----------------------+
| admin |
| alias |
| config |
| domain |
| domain_admins |
| domains |
| fetchmail |
| forwardings |
| log |
| mailbox |
| transport |
| vacation |
| vacation_notification |
+-----------------------+
mysql> select * from mailbox;
+----------------------------+---------------+------------------------+-----------------------------+-------+-----------------+---------------------+---------------------+--------+
| username | password | name | maildir | quota | domain | created | modified | active |
+----------------------------+---------------+------------------------+-----------------------------+-------+-----------------+---------------------+---------------------+--------+
| user1@mydomain.com | c5tEtb1XoJaRg | user 1 | user1@mydomain.com/ | 0 | mydomain.com | 2008-05-28 11:06:21 | 2008-05-28 11:06:21 | 1 |
The mail system appears to work fine but the "problem" is a message in /etc/log/auth.log :
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: sql_select option missing
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: auxpropfunc error no mechanism available
Jun 3 18:13:42 Ub7 postfix/smtpd[18413]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
This messages appears every time I send an email or when I connect to localhost 25 via telnet (telnet localhost 25).
I try to do this:
Testing SASL authentication in the Postfix SMTP server (http://www.postfix.org/SASL_README.html)
$ perl -MMIME::Base64 -e 'print encode_base64("\0'user1@mydomain.com'\0mypass");'
AHVzZXIxLmNvbQBteXBhc3M=
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.panell.org ESMTP Postfix (Ubuntu)
ehlo client
250-mail.panell.org
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH CRAM-MD5 DIGEST-MD5 NTLM LOGIN PLAIN
250-AUTH=CRAM-MD5 DIGEST-MD5 NTLM LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN AHVzZXIxLmNvbQBteXBhc3M=
535 5.7.0 Error: authentication failed: authentication failure
quit
221 2.0.0 Bye
LOGS:
/var/log/mail.log :
Jun 3 18:47:03 Ub7 postfix/smtpd[18667]: connect from localhost[127.0.0.1]
Jun 3 18:47:54 Ub7 postfix/smtpd[18667]: warning: SASL authentication failure: Password verification failed
Jun 3 18:47:54 Ub7 postfix/smtpd[18667]: warning: localhost[127.0.0.1]: SASL PLAIN authentication failed: authentication failure
Jun 3 18:47:57 Ub7 postfix/smtpd[18667]: disconnect from localhost[127.0.0.1]
/var/log/auth.log (If I send an email, the log is identical)
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: sql_select option missing
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: auxpropfunc error no mechanism available
Jun 3 18:45:06 Ub7 postfix/smtpd[18667]: _sasl_plugin_load failed on sasl_auxprop_plug_init for plugin: sql
After many hours I have arrived at the conclusion that smtpd.conf is ignored. I can write anything inside and the "error" is the same.
_________________
Copy-paste important files:
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myorigin = /etc/mailname
myhostname = mail.panell.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination =
relayhost =
mynetworks = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
unknown_local_recipient_reject_code = 450
# Virtual Mailbox Domain Settings
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit = 51200000
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_transport = virtual
# Additional for quota support
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the your maildir has overdrawn your diskspace quota, please free up some of spaces of your mailbox try again.
virtual_overquota_bounce = yes
virtual_alias_domains =
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
#If I insert "check_policy_service inet" it doesn't work
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
# Added:
smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
#transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
/etc/pam.d/smtp
auth required pam_mysql.so user=postfix passwd=mypass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1
account sufficient pam_mysql.so user=postfix passwd=mypass host=127.0.0.1 db=postfix table=mailbox usercolumn=username passwdcolumn=password crypt=1
/etc/postfix/sasl/smtpd.conf and /var/spool/postfix/etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: postfix
sql_passwd: mypass
sql_database: postfix
sql_select: select password from mailbox where username='%u@%r' and active = 1
/etc/courier/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME postfix
MYSQL_PASSWORD mypass
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD concat(quota,'S')
/etc/default/saslauth
START=yes
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
I don't find the solution...
Any suggestions?
Thanks and sorry for my poor english