Sending mails via SMTP after SASL authentication not possible

2009-06-26 Thread konstantin-mail
Hallo!

My postfix receives mails but I can not send mails via SMTP. This is a part of 
my log file:

Jun 24 20:49:48 serverxyz postfix/smtpd[30748]: connect from 
-123456.pool.mediaWays.net[xx.xx.xx.xx]
Jun 24 20:49:48 serverxyz authdaemond: received auth request, service=smtp, 
authtype=login
Jun 24 20:49:48 serverxyz authdaemond: authmysql: trying this module
Jun 24 20:49:48 serverxyz authdaemond: authmysqllib: connected. Versions: 
header 50051, client 50051, server 50051
Jun 24 20:49:48 serverxyz authdaemond: SQL query: SELECT username, password, 
"", 5000, 5000, "/var/mail/mailboxes", username, "", username, "" FROM accounts 
WHERE username = 'myusername'
Jun 24 20:49:48 serverxyz authdaemond: password matches successfully
Jun 24 20:49:48 serverxyz authdaemond: authmysql: sysusername=, 
sysuserid=5000, sysgroupid=5000, homedir=/var/mail/mailboxes, 
address=myusername, fullname=myusername, maildir=myusername, quota=, 
options=
Jun 24 20:49:48 serverxyz authdaemond: authmysql: clearpasswd=, 
passwd=p506oncujUVPw
Jun 24 20:49:48 serverxyz authdaemond: Authenticated: sysusername=, 
sysuserid=5000, sysgroupid=5000, homedir=/var/mail/mailboxes, 
address=myusername, fullname=myusername, maildir=myusername, quota=, 
options=
Jun 24 20:49:48 serverxyz authdaemond: Authenticated: clearpasswd=1234, 
passwd=p506oncujUVPw
Jun 24 20:49:48 serverxyz postfix/smtpd[30748]: NOQUEUE: reject: RCPT from 
-123456.pool.mediaWays.net[xx.xx.xx.xx]: 550 5.1.1 
: Recipient address rejected: User unknown in 
virtual mailbox table; from= 
to= proto=ESMTP helo=
Jun 24 20:49:48 serverxyz postfix/smtpd[30748]: lost connection after RCPT from 
-123456.pool.mediaWays.net[xx.xx.xx.xx]
Jun 24 20:49:48 serverxyz postfix/smtpd[30748]: disconnect from 
-123456.pool.mediaWays.net[xx.xx.xx.xx]


The authentication seams to work. But postfix will not relay my message to the 
next SMTP server. I thought I could reach the behavior with the following 
configuration:

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, 
reject_unauth_destination



The rest of my configuration:


main.cf:


smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

readme_directory = no

# 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:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = mail.serverxyz.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = yy.yy.yyy.yy

# Virtual mailboxes

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual-domains.cf
virtual_mailbox_base = /var/mail/mailboxes
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual-mailboxes.cf
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

# SMTPD
smtpd_sasl_auth_enable = yes
smtpd_sasl_application_name = smtpd
smtpd_sasl_path = smtpd
#broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, 
reject_unauth_destination

-- (end main.cf)


sasl/smtpd.conf
--
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
#authdaemond_path:/var/run/courier/authdaemon/socket
authdaemond_path: courier-authdaemon-socket
-- (end smtpd.conf)


I can log in via IMAP without problems.

Does anyone an idea why postfix doesn't accepts mails after SASL authentication?

If you need more informations, please let it know me!
Thanks!

Konstantin
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


Re: Sending mails via SMTP after SASL authentication not possible

2009-06-26 Thread konstantin-mail
I'm not sure, what do you want to say me with your mail.

The desired behavior is the following:

- postfix accepts mails whose domain is in virtual_mailbox_domains (mysql db) 
and stores them in the maildir (works).
- courier-imap shows mails after authetication via authdaemond (works).
- postfix accepts mails if an authentication vie authdaemond were passed before 
(doesn't work).
- postfix deny all other mails to be not an open relay (works)


> Your postfix will not accept this mail without authentication
> when sent from local machine, either.

I'm not sure what do you mean with "local machine". I want to send a mail from 
a different machine not from the server.


Because of the log entries like

   Jun 24 20:49:48 serverxyz authdaemond: password matches successfully

and

   Jun 24 20:49:48 serverxyz authdaemond: Authenticated: clearpasswd=1234, 
passwd=p506oncujUVPw

I supposed that the authentification was successfully. But postfix doesn't send 
my mail.


> Your log line has a clue why.  I also removed all but relevant
> config settings and the rest of your email.

I do not understand how this helps me. Can you give me an other hint?

Konstantin
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


Re: Sending mails via SMTP after SASL authentication not possible

2009-06-26 Thread konstantin-mail
 
> Postfix thinks web.de is a virtual_mailbox_domain.  This has 
> nothing to do with SASL.

> The SASL configuration looks correct, but your 
> virtual_mailbox_domains table is matching web.de.

Yes! Thank you very much! This was the problem!

I've thought, virtual_mailbox_domain must contain all domains. Because this, my 
query has looked like this: SELECT DISTINCT domain FROM addresses;
Now, I've added WHERE domain='%s' and it works!

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01