mam rozbehany postfix, courier maildrop, courier pop, coutrier imap
vsetko facha ako ma,
teraz sa vsak pokusam rozbehat SMTP AUTH
a narazil som na problemik
ako som pri mojom samostudii zistil autentifikacia SMTP
sa moze uskutocnovat bud pomocou sluzby saslauthd alebo pomocou zasuvnych modulov auxprop takze som skusil najskor auxprop kedze pracujem s virtualnymi uzivatelmi a mam ich ulozenych v MySQL...
avsak ked som zadal
telnet localhost 25
EHLO a vypisalo mi:
250-server.domena.tld 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN AUTH PLAIN ahysjkUHjksdhUIHDSHskldhsudhsuoSHDJSDHo 535 5.7.0 Error: authentication failed: another step is needed in authentication quit 221 2.0.0 Bye
tak som to potom skusil este cez SASLAUTHD
avsak ta ista chyba: another step is ... bla bla
tak fakt netusi kde moze byt chyba, zrejme som na nieco zabudol... Stretol sa uz niekdo s takymto niecim?
Este vam uvediem konfiguraky, ale tie dam do samostatneho prispevku...
/etc/postfix/main.cf
a teraz /etc/postfix/sasl/smtpd
tak a este PAM pre metodu SASLATHD
/etc/pam.d/smtp
# kofiguracia pristupu do MySQL
auth sufficient pam_mysql.so user=USERDB passwd=HESLODB host=127.0.0.1 db=mail table=virtual_users usercolumn=username passwdcolumn=userpassword crypt=0
no a este toto /etc/default/saslauthd
tam som nastavil
START=yes
MECHANISM="pam"
OPTIONS="-r -m /var/spool/postfix/var/run/saslauthd"
mam zase taketo hlasky:
tak teraz neviem, funguje to SMTP AUTH len mam dako blbo nastavene to heslo alebo nefunguje?
Nainstaluj si sasl2-bin libsasl2-modules:
pre debian je to tak :))
apt-get install sasl2-bin libsasl2-modules
potom
Vyedituj "/etc/default/saslauthd":
START=yes
MECHANISMS="shadow"
Vytvorit subor "/etc/postfix/sasl/smptd.conf":
pwcheck_method: saslauthd
saslauthd_path: /var/run/saslauthd/mux (alebo kde to sasl ma)
Nezabudni na spustanie po starte v "/etc/init.d/saslauthd":
napr. vytvorenim symlinku
ln -s /etc/init.d/saslauthd /etc/rc2.d/S20saslauthd
Do "/etc/postfix/main.cf" pridame:
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
Usera "postfix" pridat do skupiny "sasl" (tusim musi mat pravo na socket demona "saslauthd".)
Ak nechcem vyuzivat local userov tak mozem vyuzit db sals2
Vytvorit subor "/etc/postfix/sasl/smptd.conf": alebo len zmen metodu a vymaz riadok kde je ../mux
pwcheck_method: auxprop
Vytvorenie user pre db
domena - mojadomena.sk
user - lamkadodo
saslpasswd2 -c -u mojadomena.sk lamkadodo
zistenie usera v db sasl
sasldblistusers2
K tomu nepotrebujes deamona saslauthd taze ho mozes vypnut :))
Ta asi tolko dufam ze ti to pomoze :))
Login:
lamkadodo@mojadomena.sk, ale to asi vies :))
Alebo sa pletiem?
potom vyedituj /etc/postfix/sasl/smtpd.conf
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
mech_list: plain login cram-md5 digest-md5
sql_user: postfix
sql_passwd: heslo
sql_database: postfix
sql_statement: SELECT password FROM mailbox WHERE username = '%u@%r'
sql_verbose: yes
a precitaj si aj toto
http://www.abclinuxu.cz/forum/show/132907
http://www.zdenda.com/Mailserver-Postfix-IMAP-Maildrop-MySQL
pwcheck_method: auxprop
auxprop_plugin: sasldb
vytvoril som uzivatela
saslpasswprd -c -u domena.tld user
zadam sasldblistuser2 user@domena.tld
a hodi mi to
listusers failed
ked to skusim povedzme z TH tak v syslogu mam:
warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
pritom v /etc/sasldb2 existuje
taketo ma prava
-rw-rw-rw- 1 root sasl 12288 2007-03-17 20:36 /etc/sasldb2
asi nebudem mat vsetko s kostolnym poriadkom,
co vsetko mam mat naistalovane pre to sasl?
Pouzivam debian, dakujem za kazdu radu
apt-get install libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin
chown root:postfix /etc/sasldb2
http://small.dropbear.id.au/myscripts/postfixmysql.html
/etc/postfix/sasl/smtpd.conf
log_level: 3
pwcheck_method: pam
/etc/pam.d/smtp
auth required pam_mysql.so user=postfix passwd=HESLODB db=mail table=virtual_users usercolumn=username passwdcolumn=userpassword crypt=0
Ake lahke ze?
Ale aj tak je to divne ze ked pouzijem
pwcheck_method: auxprop
auxprop_plugin: sql
(cely conf vyssie)
tak to nefacha... hmmm
narazil som este na jeden problemik,
cez thunderbird odoslem v pohode emajl, avsak skusim to cez Outlook z office 2003 tak mi to neodosle a v syslogu mam
SASL LOGIN authentication failed: no mechanism available
avsak ked dam telnet localhost 25 tak tam mam
250-AUTH DIGEST-MD5 CRAM-MD5 NTLM LOGIN PLAIN
250-AUTH=DIGEST-MD5 CRAM-MD5 NTLM LOGIN PLAIN
Nevies co by to mohlo byt?
tak sa mi to podarilo nakoniec podarilo rozbenut aj s auxprop
problem bol zjavne v selecte, pouzil som tvoj select samozrejme upraveny na moje pomery ;)
takze vdaka ti dobry clovek :))
este uvediem ako vyzera moj /etc/postfix/sasl/smtpd.conf
mozno to dakomu tiez pomoze ;)
cat smtpd.conf
# Konfiguracia SMTP AUTH
# * * * POUZITIE METODY AUXPROP * * *
# log level
log_level: 3
pwcheck_method: auxprop
mech_list: NTLM PLAIN LOGIN CRAM-MD5 DIGEST-MD5
#mech_list: PLAIN LOGIN
auxprop_plugin: sql
# sql nastavenie
sql_verbose: true
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_database: mail
sql_user: USERDB
sql_passwd: HESLODB
allow_plaintext: true
#sql_select: SELECT %p FROM virtual_users WHERE username = '%u' AND userrealm = '%r' AND auth = '1'
#sql_select: SELECT userpassword FROM virtual_users WHERE username = '%u' AND auth = '1'
sql_statement: SELECT userpassword FROM virtual_users WHERE username = '%u@%r' AND auth = '1'
sql_usessl: no
# * * * POUZITIE METODY SASLAUTHD * * *
#log_level: 7
#pwcheck_method: saslauthd
#mech_list: PLAIN LOGIN
# * * * POUZITIE METODY PAM * * *
#pwcheck_method: pam
takze vidno tam pekne aj tie moje blbe SELECTy hehe
A co je najlepsie, slape to aj v THUNDERBIRDE a aj v OUTLOOKU, super...
... Tak a mozem sa pustit do transportnej vrstvy TLS ;) ...