postfix,cyrussasl2,pgsql

Fórumok

Sziasztok,

Egy levelező szervert, de inkább egyenlőre egy smtp szervert kellene konfolnom.Sok leírást olvastam,és most ott tartok,hogy lehet hogy nem látom a fától az erdőt :-)
Ami eddig megvan:
- postfix
- pgsql, létrehozva az adatbázis,táblák
- cyrus sasl, bekonfolva

Itt van néhány konfig:

saslauthd
MECH=pam
SOCKETDIR=/var/run/saslauthd

smtpd.conf (a /usr/local/lib/sasl2-ben)
pwcheck_method: auxprop
mech_list: PLAIN CRAM-MD5 DIGEST-MD5 LOGIN
allowanonymouslogin: no
allowplaintext: no

sasl_auxprop_plugin: sql

sql_engine: pgsql
# Leave commented out to use the unix socket
#sql_hostnames: localhost
sql_database: maildata
sql_user: username
# Not present means no password
sql_passwd: userpass
sql_select: SELECT password FROM maildata WHERE username = '%u' AND domain = '%r'

main.cf ből kivonat:
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_path = /usr/local/lib/sasl2
smtpd_sasl_application_name = smtpd

Authentikálni nem tudok a szerveren. ime a log:
connect from unknown[x.x.x.x]
Oct 6 10:08:45 localhost postfix/smtpd[28102]: warning: SASL authentication failure: no secret in database
Oct 6 10:08:45 localhost postfix/smtpd[28102]: warning: unknown[x.x.x.x]: SASL CRAM-MD5 authentication failed: authentication failure
Oct 6 10:08:45 localhost postfix/smtpd[28102]: warning: SASL authentication failure: Password verification failed
Oct 6 10:08:45 localhost postfix/smtpd[28102]: warning: unknown[x.x.x.x]: SASL PLAIN authentication failed: authentication failure
Oct 6 10:08:45 localhost postfix/smtpd[28102]: warning: unknown[x.x.x.x]: SASL LOGIN authentication failed: authentication failure

Köszönöm,

Hozzászólások

az alábbi hibát dobja a log:

auth failure: [user=joe] [service=imap] [realm=localhost.localdomain] [mech=pam] [reason=PAM auth error]

hátha ez segít azoknak, akik már csináltak ilyet.

sokat nem tudok segiteni, nemirtad, hogy milyen imap szervert hasznalsz, az imapos hibauzenet arra utal, hogy a pam nem okezza le a jelszot.
en dovecot -al oldottam meg a postgresbol valo authentikaciot, az meg valahogy native es nem pampog.

dovecot.conf :
# SQL database
passdb sql {
# Path for SQL configuration file, see doc/dovecot-sql-example.conf
args = /etc/dovecot-pgsql.conf
}

dovecot-pgsql.conf

# Dovecot queries
driver = pgsql
connect = host=localhost dbname=vmail user=vmail password=hulyeleszekideirni #default_pass_scheme = CRYPT
default_pass_scheme = PLAIN
password_query = SELECT password FROM users WHERE username='%u'
user_query = SELECT uid, gid,home FROM users WHERE username='%u'

a postfix is tud native beszelgetni a postgressel :

main.cf :

virtual_mailbox_maps = pgsql:/etc/postfix/pgsql-virtual-mailboxes.cf

pgsql-virtual-mailboxes.cf :

hosts=localhost
user=vmail
password=hulyeleszekideirni
dbname=vmail
query=select mail from users where username='%u'

szoval a sasl -t meg a pamot kihagytam a jatekbol.

Hello,

Majdnem kész vagyok,már csak egy apró probléma van:

deliver(root): Nov 07 15:07:02 Info: msgid=<20081107140702.38ECA5BB@mail.hu>: saved mail to INBOX
dovecot: Nov 07 15:08:41 Info: auth(default): client in: AUTH 1 PLAIN service=imap secured lip=195.70.61.116 rip=195.70.60.227 lport=993 rport=55805
dovecot: Nov 07 15:08:41 Info: auth(default): client out: CONT 1
dovecot: Nov 07 15:08:41 Info: auth(default): client in: CONT
dovecot: Nov 07 15:08:41 Info: auth(default): sql(username,191.10.23.117): query: SELECT pass FROM accounts WHERE usern = 'username'
dovecot: Nov 07 15:08:41 Info: auth(default): client out: OK 1 user=username
dovecot: Nov 07 15:08:41 Error: User usrename is missing UID (set mail_uid)
dovecot: Nov 07 15:08:41 Info: auth(default): master in: REQUEST 2 7440 1
dovecot: Nov 07 15:08:41 Info: auth(default): master out: USER 2 username
dovecot: Nov 07 15:08:41 Info: imap-login: Internal login failure (auth failed, 1 attempts): user=, method=PLAIN, rip=193.10.20.121, lip=191.10.23.117, TLS

Erre kellene megoldást találnom:
Error: User usrename is missing UID (set mail_uid)

Ötlet ?

Szia!

Jutottál vmire?

Nekem van egy PostgreSQL adatbázisom, a dovecot ehhez a DB-hez autentikál, a jelszavak md5-tel vannak eltárolva.

/etc/postfix/sasl/smtpd.conf-ban ez van:

pwcheck_method: saslauthd
auxprop_plugin: sql
mech_list: plain login cram-md5 digest-md5
sql_engine: pgsql
sql_hostnames: 127.0.0.1
sql_user: xxxxxxx
sql_passwd: xxxxxxx
sql_database: xxxxxxx
sql_select: select u_pass as password from tuserek where u_nev='%u' and smtpauth='1'

Postfix, sasl restart, majd próba.

A lev. kliens kéri a jelszót (most már csak sima 'a' betű a teszt usernél), majd a logban megjelenik ez:

warning: SASL authentication failure: no secret in database

ne vedd kotozkodesnek, de egyenlore != egyelore

t