PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : leidiges thema, Postfix mysql



Svenny
23.02.04, 06:05
Feb 23 06:49:51 svesa1 postfix/cleanup[14924]: warning: connect to mysql server localhost: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Feb 23 06:49:51 svesa1 postfix/cleanup[14924]: warning: 0F2052B002A: sender_canonical_maps map lookup problem for root@localhost


Postfix kann einfach nicht auf den MySQL Server connecten.. obwohl we-cyradmin mit dem selben user keine probleme hat, auch wenn ich alle benutzer auf root umstelle tuts einfach nicht... ich hab schon gegooglet wie nen irrer aber nichts brauchbares gefunden.. ich hab alles nach dem Postfix-Cyrus-Web-cyradm-HowTo gemacht..

Hat jemand eine Idee woran das liegen könnte?


So.. und nun ab ins bett ;)

Svenny
23.02.04, 06:32
Hmm.. kleinen unsauberen workaround gebastelt. mysql ip binding auf ne interne ip und dann anstelle localhost dann die ip..

Svenny
23.02.04, 07:56
hmm.. nun komm ich nicht mehr mit web-cyradm drauf.. passiert nix.. keine fehlermeldung kein gar nichts.. ich werd noch verrückt bei dem kram

stefaan
23.02.04, 08:53
Servus!

Dumme Frage: Läuft der MySQL-Server überhaupt? Kommst du über die Konsole mit "mysql -u root -p" rein?

Grüße, Stefan

Svenny
23.02.04, 10:13
Sischa datt :D

inzwie läuft das auch mal alles grad so dass es geht.. zwar der smtp relay noch nicht weil ich irgendwie das auth noch nicht drin hab, pop-before-smtp or smtp auth aber ma schauen..

Flo87
23.02.04, 11:28
ähm andere dumme frage: läuft postfix chroot'ed? Vielleicht müsstest du ihm einfach den socket in sein jail reinlinken, also so in etwa:

ln /var/run/mysqld/mysqld.sock /var/spool/postfix/var/run/mysqld/mysqld.sock

Svenny
23.02.04, 11:41
na des mit mysql etc ist erstmal vom tisch, das geht soweit.. leider hängts nun beim pop-before-smtp...


meine einstellung:

$pat = '^(... .. ..:..:..) \S+ (?:pop3d|imapd)\[\d+\]: ' .
'login: \S*\[(\d+\.\d+\.\d+\.\d+)\] \S+ \S+';


und der dazugehörige logeintrag:

Feb 23 12:36:34 localhost cyrus/pop3d[3891]: login: xxxxxxxxxxxxxxxx[xx.xx.x.xx] mail0002 plaintext

die logfile vom pop before smtp daemon zeigt auch nix an..

steve-bracket
23.02.04, 11:47
Original geschrieben von Svenny
na des mit mysql etc ist erstmal vom tisch, das geht soweit.. leider hängts nun beim pop-before-smtp...


meine einstellung:

$pat = '^(... .. ..:..:..) \S+ (?:pop3d|imapd)\[\d+\]: ' .
'login: \S*\[(\d+\.\d+\.\d+\.\d+)\] \S+ \S+';


und der dazugehörige logeintrag:

Feb 23 12:36:34 localhost cyrus/pop3d[3891]: login: xxxxxxxxxxxxxxxx[xx.xx.x.xx] mail0002 plaintext

die logfile vom pop before smtp daemon zeigt auch nix an..

1. Für die Nachwelt, woran lag es?

2. Warum POP before SMTP wenn sich doch das Postfix-Cyrus-Web-cyradm-HowTo so schön mit "SMTP-AUTH" befasst.
*grübel*

Gruß

Svenny
23.02.04, 11:48
ich hab einfach tcp anstatt socket connect gemacht..

es hat nicht jeder einen smtp auth client.. und da wollt ich schon auf pop before smtp als möglichkeit wählen zu dem sasl auth.. man muss ja flexibel sein ..

Svenny
23.02.04, 17:45
Und es geht immernoch nicht.. zefix.. .. und das smtp auth geht auch nicht wirklich ...

also erstmal zum smtp auth:


Feb 23 18:34:26 svesa1 postfix/smtpd[25454]: connect from xxxxxxxx[x.x.x.x]
Feb 23 18:34:26 svesa1 postfix/smtpd[25454]: lost connection after AUTH from xxxxxxxxx[x.x.x.x]
Feb 23 18:34:26 svesa1 postfix/smtpd[25454]: disconnect from xxxxxxxxx[x.x.x.x]


Das mit Pop-Before-Smtp scheint hinten und vorn nicht zu klappen.. Ich häng mal meine config an..

wenn ich nun ne mail bekomme steht im header immer:



Return-Path <cyrus@sve-sa.de>
Received from sve-sa.de ([unix socket])by sve-sa.de (Cyrus v2.1.16-IPv6-Debian-2.1.16-3) with LMTP; Mon, 23 Feb 2004 18:39:06 +0100
X-Sieve CMU Sieve 2.2
[..]


Wie krieg ich das hin, dass es nun so ausschaut als würd ich eine email extern schicken. like so:



Received: from [81.201.107.73] (helo=mail.sve-sa.de)
by mx02.web.de with esmtp (WEB.DE 4.99 #605)
id 1AvK5d-0007FC-00
for mordack@web.de; Mon, 23 Feb 2004 18:41:57 +0100
Received: from svenmain.svenny.home (xxxxxx [x.x.x.x])
by mail.sve-sa.de (Postfix) with SMTP id 3965A2B002A
for ; Mon, 23 Feb 2004 18:41:48 +0100 (CET)
Wrom: TWFAOBUZXUW
To: mordack@web.de
Date: Mon, 23 Feb 2004 18:41:47 +0100
Subject: test123
Message-Id: <20040223174148.3965A2B002A@mail.sve-sa.de>
Sender: sven@sve-sa.de


Irgendwie steh ich grad ziemlich aufn schlauch

Svenny
23.02.04, 20:08
so, Sch* auf smtp-after-pop.. aber das mit dem dummen smtp auth will immernoch nicht



Feb 23 21:03:39 svesa1 postfix/smtpd[27300]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Feb 23 21:03:39 svesa1 postfix/smtpd[27300]: warning: SASL authentication failure: no secret in database
Feb 23 21:03:39 svesa1 postfix/smtpd[27300]: warning: x[x]: SASL NTLM authentication failed
Feb 23 21:03:41 svesa1 postfix/smtpd[27300]: warning: x[x]: SASL NTLM authentication failed
Feb 23 21:03:42 svesa1 postfix/smtpd[27300]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory


svesa1:/etc# ll | grep sasl
-rw-rw-rw- 1 root sasl 12288 Feb 23 20:51 sasldb2


svesa1:/usr/lib/postfix/etc# ll /usr/lib/postfix/etc | grep sasl
lrwxrwxrwx 1 root root 12 Feb 23 21:06 sasldb2 -> /etc/sasldb2

steve-bracket
23.02.04, 20:35
IMPORTANT: If you configure SASL to use PAM (pluggable authentication
modules) authentication, the Postfix SMTP server will abort because
the SASL password file does not exist (default: /etc/sasldb in
version 1.5.5, or /etc/sasldb2 in version 2.1.1), To fix, disable
CRAM-MD5 authentication by deleting /usr/lib/sasl/libcrammd5.so or
/usr/lib/sasl2/libcrammd5.so depending on your SASL library version.


Gruß

stefaan
23.02.04, 20:40
Servus!

Läuft dein Postfix vielleicht im chroot? Poste einmal die master.cf.
Das würde einiges erklären ;)

Grüße, Stefan

Svenny
23.02.04, 20:46
smtp inet n - n - - smtpd
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 nqmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
flush unix n - - 1000? 0 flush
smtp unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp

#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
# The Cyrus deliver program has changed incompatibly.
#
cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
# flags= user=cyrus argv=/usr/cyrus/bin/deliver -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

#smtps inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#587 inet n - n - - smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
proxymap unix - - n - - proxymap



nachdem ich das file gelsöcht hab heisst es:

Feb 23 21:44:43 svesa1 postfix/smtpd[10844]: connect from x[x]
Feb 23 21:44:44 svesa1 postfix/smtpd[10844]: warning: SASL authentication failure: no secret in database
Feb 23 21:44:44 svesa1 postfix/smtpd[10844]: warning: x[x]: SASL NTLM authentication failed

steve-bracket
23.02.04, 20:51
Wogegen willst du den authentifizieren????

Gruß


Nachtrag:
Mach den Postfix mal etwas gesprächiger.
smtp inet n - n - - smtpd -v

Svenny
23.02.04, 21:08
Die mailuser stehen alle in der mysql datenbank...

strikt nach dem howto gearbeitet..

anbeit der verbose output

steve-bracket
23.02.04, 21:20
Und was sagen die anderen Logs. Kann postfix korrekt auf die Table-inhalte zugreifen.??

Gruß

Svenny
23.02.04, 21:31
Connect auf die MySQL geht, sonst wäre da irgendwo eine "Could not connect to ..." Message... Sonst hab ich schon alles doppelt und 10 mal durchgeschaut was mysql daten angeht... Error log steht nix, daemon messages zeigt auch nix..

steve-bracket
24.02.04, 07:49
Guten Morgen

Bist du sicher das er auf den richtigen Benutzernamen zugreift.
Häng mal deine main.cf an.
Bzw. die Direktiven für smtp-auth.

Gruß

Svenny
24.02.04, 09:59
Morgen..

main.cf


see /usr/share/postfix/main.cf.dist for a commented, fuller
# version of this file.

# Do not change these directory settings - they are critical to Postfix
# operation.
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

smtpd_banner = $myhostname ESMTP (Postfix) $mail_name
setgid_group = postdrop
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no
myhostname = mail.sve-sa.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = sve-sa.de, svesa1, localhost.localdomain, localhost, mysql:/etc/postfix/mysql-mydestination.cf
mynetworks = 127.0.0.0/8,81.201.107.73, sve-sa.de
##mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
relayhost =

inet_interfaces = mail.sve-sa.de
## -- ##
mailbox_transport = cyrus
virtual_maps = mysql:/etc/postfix/mysql-virtual.cf
sender_canonical_maps = mysql:/etc/postfix/mysql-canonical.cf
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = sve-sa.de
broken_sasl_auth_clients = yes

steve-bracket
24.02.04, 12:05
Original geschrieben von Svenny
Morgen..
smtpd_sasl_local_domain = sve-sa.de
[/code]

Schau mal in den Logs (messages, localmessages, warn ....usw) nach welchen Usernamen du in den Tables suchst.
user0001
oder
user0001@sve-sa.de
Ersteres wäre richtig.

Gib mal die Domain weg, glaub es wird automatisch die Domain angehängt die angegeben ist. Und falls das der Fall ist wird natürlich kein richtiger User gefunden.
smtpd_sasl_local_domain =

Und schau dir mal die Logingmeldungen genau an.

Gruß

Svenny
24.02.04, 12:30
So wirklich was gebracht hat das auch nichts.. nun heisst es aber:

warning: SASL authentication problem: unknown password verifier
Feb 24 13:22:36 svesa1 postfix/smtpd[31557]: warning: x[x]: SASL LOGIN authentication failed


saslauthd läuft als pam.. was anderes führt dazum dass cyrus nicht mehr authen kann.

das läuft soweit gut, der logeintrag beim abholen:

cyrus/imapd[30430]: login: x[x] mail0001 plaintext
und bei pop
cyrus/pop3d[17554]: login: x[x] mail0002 plaintext

steve-bracket
24.02.04, 17:22
Wenn die von mir angesprochenen Logfiles nichts sagen dann kann ich nicht weiterhelfen.
Immerhin sollte man anhand dieser mal rausfinden ob die Auth. direkt am SMTP oder an einem der anderen beteiligten Dienste scheitert.

Gruß

Svenny
24.02.04, 19:16
So ich hab mal neu installiert den ganzen krams nun kann cyrus nichtmal mehr authen.. bzw er findet keine User:

badlogin: mail[81.201.107.73] plaintext cyrusSASL(-13): user not found: checkpass failed


so ich häng nun alles an was ich irgendwie an config files hab:


saslauthd rennt als "-a pam"

main.cf


command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix

smtpd_banner = $myhostname ESMTP $mail_name
setgid_group = postdrop
biff = no

append_dot_mydomain = no
myhostname = mail.sve-sa.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = sve-sa.de, svesa1, localhost.localdomain, localhost, mysql:/etc/postfix/mysql-mydestination.cf
mynetworks = 127.0.0.0/8,81.201.107.73, sve-sa.de
mailbox_size_limit = 0
recipient_delimiter = +
relayhost =

inet_interfaces = mail.sve-sa.de
mailbox_transport = cyrus
virtual_maps = mysql:/etc/postfix/mysql-virtual.cf
sender_canonical_maps = mysql:/etc/postfix/mysql-canonical.cf
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes

smtpd_helo_required = yes

master.cf


smtp inet n - n - - smtpd -v
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
smtp unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

proxymap unix - - n - - proxymap


imapd.conf


servername: mail.sve-sa.de
postmaster: postmaster
configdirectory: /var/lib/cyrus
defaultpartition: default
partition-default: /var/spool/cyrus/mail
partition-news: /var/spool/cyrus/news
newsspool: /var/spool/news
altnamespace: no
unixhierarchysep: no
lmtp_downcase_rcpt: yes
admins: cyrus
allowanonymouslogin: no
popminpoll: 1
autocreatequota: 0
umask: 077
sendmail: /usr/sbin/sendmail
sieveusehomedir: false
sievedir: /var/spool/sieve
hashimapspool: true
allowplaintext: yes
sasl_pwcheck_method: auxprop
sasl_auto_transition: no
tls_ca_path: /etc/ssl/certs
tls_session_timeout: 1440
tls_cipher_list: TLSv1:SSLv3:SSLv2:!NULL:!EXPORT:!DES:!LOW:@STRENGT H
tls_ca_file: /etc/ssl/certs/cyrus.pem
tls_cert_file: /etc/ssl/certs/cyrus.pem
tls_key_file: /etc/ssl/certs/cyrus.pem
lmtpsocket: /var/run/cyrus/socket/lmtp
idlesocket: /var/run/cyrus/socket/idle
notifysocket: /var/run/cyrus/socket/notify

pam.d/imap smtp pop sieve


auth sufficient pam_mysql.so user=mail passwd=--- host=localhost db=mail table=accountuser usercolumn=username passwdcolumn=password crypt=1 logtable=log logmsgcolumn=msg logusercolumn=user loghostcolumn=host logpidcolumn=pid logtimecolumn=time


account required pam_mysql.so user=mail passwd=--- host=localhost db=mail table=accountuser usercolumn=username passwdcolumn=password crypt=1 logtable=log logmsgcolumn=msg logusercolumn=user loghostcolumn=host logpidcolumn=pid logtimecolumn=time

/usr/lib/sasl2/smtpd.conf


pwcheck_method: saslauthd


hmm.. was vergessen?