PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Authentifizierung E-mail Server PHP Mysql



netzmeister
07.03.04, 19:38
Hallo,

da ich auf einem meiner E-Mail Server inzwischen über 100 Domains und ein paar hundert
E-mail Accounts habe, denke ich über eine Migration nach.

Hierzu habe ich mir eine Lösung mit PHP/Mysql/POP3/IMAP/Webmail
überlegt. Ich habe verschiedenes ausprobiert.

Inzwischen bin ich recht weit gekommen ;)

Dies habe ich grade im Installationstest:

http://workaround.org/articles/ispmail/index.shtml bzw. http://phpmywebhosting.sourceforge.net/

Die Installation lief auf einem Debian Woody System ohne Probleme.
Die Datenbankbearbeitungsscripte unter Perl liefen nicht. Die PHP-Scripte
aus dem zweiten Link funktionieren. Auch sind einige Tabellen etwas
erweitert.

Der E-mail Empfang funktioniert einwandfrei :) Postfix läuft.

Ich habe nun ein Problem:

Ich kann mich weder per SMTP-auth noch per POP3 und per IMAP
authentifizieren. Auch die dazugehörigen SSL Varianten klappen nicht.
Die entsprechenden Dämonen laufen auf den Ports. Der Courier
hat irgendwie ein Problem.

Habt Ihr Ideen?

Viele Grüße

Eicke

Svenny
07.03.04, 21:11
unter Woody ist es recht brisant mit der Courier/postfix/sasl geschichte. Wir haben bei uns bereits alle produktiven server auf sarge umgestellt und auf sarge lief bisher alles super... überleg auch mal ob du umstellst, weil sarge ist schon ziemlich stabil

noganex
07.03.04, 22:56
Original geschrieben von netzmeister
Habt Ihr Ideen?
Uns einen Auszug der Logdateien schenken waere nicht schlecht. ;)

Hast du mal /etc/pam.d/pop3, smtp, imap... ueberprueft?
Da sollte man pam_mysql verwenden...

netzmeister
08.03.04, 16:04
Hallo,

ich habe inzwischen das System nochmal nue aufgesetzt und auf
testing umgestellt. Die Installation habe ich widerholt.

Hier mal ein Auszug aus der mail.info:

--------------------------------

Mar 8 16:56:46 mail postfix/postfix-script: starting the Postfix mail system
Mar 8 16:56:46 mail postfix/master[1239]: daemon started -- version 2.0.16
Mar 8 16:57:28 mail postfix/smtpd[1243]: fatal: no SASL authentication mechanisms
Mar 8 16:57:29 mail postfix/master[1239]: warning: process /usr/lib/postfix/smtpd pid 1243 exit status 1
Mar 8 16:57:29 mail postfix/master[1239]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

---------------------------------

Hier meine /etc/pma.d/smtp:

--------------------
auth required pam_mysql.so user=vmail passwd=3xxxx host=localhost db=provider table=users usercolumn=email passwdcolumn=pa
ssword crypt=1
account sufficient pam_mysql.so user=vmail passwd=3xxxxx host=localhost db=provider table=users usercolumn=email passwdcolu
mn=password crypt=1
--------------------

Muss ich die Dateien pop3 und imap auch derart anpassen?

Viele Grüße

Eicke

Svenny
08.03.04, 16:20
svesa1:/var/mail# cat /etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN



auf workaround.org gibts auch direkt das Sarge Howto, die imap, pop3 etc brauchst du nicht anpassen.

netzmeister
08.03.04, 16:57
Hallo Svenny,

ich habe das jetzt angepasst.

Hier das neue LOG:

Mar 8 17:57:42 mail postfix/master[558]: daemon started -- version 2.0.16
Mar 8 17:58:17 mail imaplogin: Connection, ip=[::ffff:213.30.246.163]
Mar 8 17:58:22 mail imaplogin: LOGIN FAILED, ip=[::ffff:213.30.246.163]


Das Howto werde ich mir gleich mal ansehen.

Viele Grüße

Eicke

noganex
08.03.04, 17:04
Mh.. editiere mal die master.cf von postfix (in /etc/postfix) und haenge in der ersten zeile
smtp inet n... ein -v hinter smtpd. Damit werden die Postfix logs etwas groesser und man kann auch die SQL Abfragen in den Logdateien sehen.

netzmeister
08.03.04, 22:19
Hallo,

vielen Dank für Eure Hilfe!

ich habe nun nur noch ein Problem: Der Login geht nicht.
Egal ob POP3/POP3-SSL/IMAP/IMAP-SSL

Mar 8 22:57:37 mail imaplogin: DISCONNECTED, ip=[::ffff:80.145.175.98], headers=0, body=0
Mar 8 23:01:11 mail imapd-ssl: LOGIN FAILED, ip=[::ffff:80.145.175.98]
Mar 8 23:09:54 mail imaplogin: LOGIN FAILED, ip=[::ffff:80.145.175.98]
Mar 8 23:09:58 mail imaplogin: DISCONNECTED, ip=[::ffff:80.145.175.98], headers=0, body=0

Auch der SMTP_Versand hängt:

Mar 8 23:29:25 mail postfix/smtpd[784]: warning: p5091AF62.dip.t-dialin.net[80.145.175.98]: SASL LOGIN authentication failed
Mar 8 23:29:25 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 535 Error: authentication failed
Mar 8 23:29:26 mail postfix/smtpd[784]: watchdog_pat: 0x806c5d0
Mar 8 23:29:26 mail postfix/smtpd[784]: smtp_get: EOF
Mar 8 23:29:26 mail postfix/smtpd[784]: lost connection after AUTH from p5091AF62.dip.t-dialin.net[80.145.175.98]
Mar 8 23:29:26 mail postfix/smtpd[784]: disconnect from p5091AF62.dip.t-dialin.net[80.145.175.98]
Mar 8 23:29:26 mail postfix/smtpd[784]: master_notify: status 1
Mar 8 23:29:26 mail postfix/smtpd[784]: connection closed
Mar 8 23:29:26 mail postfix/smtpd[784]: watchdog_stop: 0x806c5d0
Mar 8 23:29:26 mail postfix/smtpd[784]: watchdog_start: 0x806c5d0
Mar 8 23:29:33 mail postfix/smtpd[784]: connection established
Mar 8 23:29:33 mail postfix/smtpd[784]: master_notify: status 0
Mar 8 23:29:33 mail postfix/smtpd[784]: name_mask: resource
Mar 8 23:29:33 mail postfix/smtpd[784]: name_mask: software
Mar 8 23:29:33 mail postfix/smtpd[784]: name_mask: noanonymous
Mar 8 23:29:33 mail postfix/smtpd[784]: connect from p5091AF62.dip.t-dialin.net[80.145.175.98]
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 220 mail.mail.kemm.de ESMTP Postfix (Debian/GNU)
Mar 8 23:29:33 mail postfix/smtpd[784]: watchdog_pat: 0x806c5d0
Mar 8 23:29:33 mail postfix/smtpd[784]: < p5091AF62.dip.t-dialin.net[80.145.175.98]: EHLO media
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-mail.mail.kemm.de
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-PIPELINING
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-SIZE 10000000
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-VRFY
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-ETRN
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-AUTH LOGIN PLAIN
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250-AUTH=LOGIN PLAIN
Mar 8 23:29:33 mail postfix/smtpd[784]: match_hostname: p5091AF62.dip.t-dialin.net ~? 213.30.246.0/24
Mar 8 23:29:33 mail postfix/smtpd[784]: match_hostaddr: 80.145.175.98 ~? 213.30.246.0/24
Mar 8 23:29:33 mail postfix/smtpd[784]: match_list_match: p5091AF62.dip.t-dialin.net: no match
Mar 8 23:29:33 mail postfix/smtpd[784]: match_list_match: 80.145.175.98: no match
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 250 8BITMIME
Mar 8 23:29:33 mail postfix/smtpd[784]: watchdog_pat: 0x806c5d0
Mar 8 23:29:33 mail postfix/smtpd[784]: < p5091AF62.dip.t-dialin.net[80.145.175.98]: AUTH LOGIN
Mar 8 23:29:33 mail postfix/smtpd[784]: smtpd_sasl_authenticate: sasl_method LOGIN
Mar 8 23:29:33 mail postfix/smtpd[784]: smtpd_sasl_authenticate: uncoded challenge: Username:
Mar 8 23:29:33 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 334 blah
Mar 8 23:29:34 mail postfix/smtpd[784]: < p5091AF62.dip.t-dialin.net[80.145.175.98]: blah
Mar 8 23:29:34 mail postfix/smtpd[784]: smtpd_sasl_authenticate: decoded response: blah@blah.de
Mar 8 23:29:34 mail postfix/smtpd[784]: smtpd_sasl_authenticate: uncoded challenge: Password:
Mar 8 23:29:34 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 334 blah
Mar 8 23:29:34 mail postfix/smtpd[784]: < p5091AF62.dip.t-dialin.net[80.145.175.98]: blah
Mar 8 23:29:34 mail postfix/smtpd[784]: smtpd_sasl_authenticate: decoded response: geändert
Mar 8 23:29:34 mail postfix/smtpd[784]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Mar 8 23:29:34 mail postfix/smtpd[784]: warning: p5091AF62.dip.t-dialin.net[80.145.175.98]: SASL LOGIN authentication failed
Mar 8 23:29:34 mail postfix/smtpd[784]: > p5091AF62.dip.t-dialin.net[80.145.175.98]: 535 Error: authentication failed
Mar 8 23:29:35 mail postfix/smtpd[784]: watchdog_pat: 0x806c5d0
Mar 8 23:29:35 mail postfix/smtpd[784]: smtp_get: EOF
Mar 8 23:29:35 mail postfix/smtpd[784]: lost connection after AUTH from p5091AF62.dip.t-dialin.net[80.145.175.98]
Mar 8 23:29:35 mail postfix/smtpd[784]: disconnect from p5091AF62.dip.t-dialin.net[80.145.175.98]
Mar 8 23:29:35 mail postfix/smtpd[784]: master_notify: status 1
Mar 8 23:29:35 mail postfix/smtpd[784]: connection closed
Mar 8 23:29:35 mail postfix/smtpd[784]: watchdog_stop: 0x806c5d0
Mar 8 23:29:35 mail postfix/smtpd[784]: watchdog_start: 0x806c5d0
Mar 8 23:30:48 mail postfix/smtpd[784]: rewrite stream disconnect
Mar 8 23:30:48 mail postfix/smtpd[784]: watchdog_stop: 0x806c5d0
Mar 8 23:30:48 mail postfix/smtpd[784]: watchdog_start: 0x806c5d0


Ich bin das sarge Howto nochmals genau durchgegangen.

Viele Grüße

Eicke

Svenny
08.03.04, 22:34
cannot connect to saslauthd


Schau mal in die /etc/default/saslauthd

da muss start auf yes stehen und mechanisms auf pam und dann /etc/init.d/saslauth.d start

netzmeister
08.03.04, 22:39
mail:~# /etc/init.d/saslauthd start
Starting SASL Authentication Daemon: saslauthd[834] :main : could not
chdir to: /var/spool/postfix/var/run/saslauthd
saslauthd[834] :main : chdir: No such file or directory
saslauthd[834] :main : Check to make sure the directory exists and is
saslauthd[834] :main : writeable by the user this process runs as.
mail:~#

Svenny
08.03.04, 22:41
hmm..

mkdir -p /var/spool/postfix/var/run/saslauthd

?

netzmeister
08.03.04, 22:41
mail:/var/spool/postfix/var/run# mkdir saslauthd
mail:/var/spool/postfix/var/run# ls -l
total 8
drwxr-xr-x 2 mysql root 4096 Mar 8 23:08 mysqld
drwxr-xr-x 2 root root 4096 Mar 8 23:42 saslauthd
mail:/var/spool/postfix/var/run# /etc/init.d/saslauthd start
Starting SASL Authentication Daemon: saslauthd.

netzmeister
08.03.04, 22:43
Der SMTP läuft jetzt

netzmeister
08.03.04, 22:44
Nur die Authentifizierung geht noch nicht

netzmeister
09.03.04, 08:29
Hallo und guten Morgen,

wo kann ich denn die Authenfizierung konfigurieren. Daran hängt es ja jetzt noch.

mein "/etc/courier/authdeamonrc:

##VERSION: $Id: authdaemonrc.in,v 1.8 2001/10/07 02:16:22 mrsam Exp $
#
# Copyright 2000-2001 Double Precision, Inc. See COPYING for
# distribution information.
#
# authdaemonrc created from authdaemonrc.dist by sysconftool
#
# Do not alter lines that begin with ##, they are used when upgrading
# this configuration.
#
# This file configures authdaemond, the resident authentication daemon.
#
# Comments in this file are ignored. Although this file is intended to
# be sourced as a shell script, authdaemond parses it manually, so
# the acceptable syntax is a bit limited. Multiline variable contents,
# with the \ continuation character, are not allowed. Everything must
# fit on one line. Do not use any additional whitespace for indentation,
# or anything else.

##NAME: authmodulelist:0
#
# The authentication modules that are linked into authdaemond. The
# default list is installed. You may selectively disable modules simply
# by removing them from the following list. The available modules you
# can use are: authcustom authcram authuserdb authldap authpgsql authmysql authpam

authmodulelist="authmysql"

##NAME: authmodulelistorig:1
#
# This setting is used by Courier's webadmin module, and should be left
# alone

authmodulelistorig="authcustom authcram authuserdb authldap authpgsql authmysql authpam"

##NAME: daemons:0
#
# The number of daemon processes that are started. authdaemon is typically
# installed where authentication modules are relatively expensive: such
# as authldap, or authmysql, so it's better to have a number of them running.
# PLEASE NOTE: Some platforms may experience a problem if there's more than
# one daemon. Specifically, SystemV derived platforms that use TLI with
# socket emulation. I'm suspicious of TLI's ability to handle multiple
# processes accepting connections on the same filesystem domain socket.
#
# You may need to increase daemons if as your system load increases. Symptoms
# include sporadic authentication failures. If you start getting
# authentication failures, increase daemons. However, the default of 5
# SHOULD be sufficient. Bumping up daemon count is only a short-term
# solution. The permanent solution is to add more resources: RAM, faster
# disks, faster CPUs...

daemons=5

##NAME: version:0
#
# When you have multiple versions of authdaemond.* installed, authdaemond
# just picks the first one it finds. Set "version" to override that.
# For example: version=authdaemond.plain

version=""

##NAME: authdaemonvar:0
#
# authdaemonvar is here, but is not used directly by authdaemond. It's
# used by various configuration and build scripts, so don't touch it!

authdaemonvar=/var/run/courier/authdaemon




Viele Grüße

Eicke

Svenny
09.03.04, 13:02
hm hmhmhm hmhmmhmhm hmm.....


mal vorsichtig gefragt, hast auch nen user in die datenbank geschrieben ? :)

netzmeister
09.03.04, 13:05
Hallo,

ja klar. Die Mail wird ja auch angenommen.

Ich kann mich nur nicht über POP3 oder IMAP anmelden.
Es kommt einfach LOGIN FAILED

Viele Grüße

Eicke

Svenny
09.03.04, 13:12
passwort per ENCRYPT() eingetragen ?

netzmeister
09.03.04, 13:21
Hallo,

natürlich. Ich habe es mit ENCRYPT und auch mit PASSWORD probiert.

Viele Grüße

Eicke

Svenny
09.03.04, 13:31
Hmm.. gibts ne möglichkeit auf die maschine draufzukommen? würd mir das gern mal anschauen, vielleicht find ich ja ne lösung für mein problem :)

netzmeister
09.03.04, 13:47
Hallo,

klar.

Den Login gibt es beim Chef: Tel. 07121-43306-11 oder Du schickst mir Deine Telefonnummer.
Dann rufe ich Dich an.

Viele Grüße

Eicke

Svenny
09.03.04, 16:27
Ach du hast mir dann doch auch bei meinem problem geholfen :D uid 0 gid 0 LOL :D

nun tut mir mein ohr weh..

netzmeister
09.03.04, 20:36
Hallo,

ich habe dann auch noch das Problem mit dem Virenscanner gefunden.

Es hat schlicht und ergreifend der "clamd" Paket "clamav-daemon"
gefehlt.

Jetzt muss ich nur noch die PHP-Scripte, die ja den hauptsächlichen
Fehler verursacht haben, durchsehen.

Viele Grüße

Eicke

Svenny
10.03.04, 15:45
ich hab nur noch problem mit Outsider Express, er authed zwar successfull aber der ******* sagt unbekannter fehler..... naja..

wird den kunden halt gesagt "aus sicherheitsgründen unterstützt unser mailserver die zusammenarbeit mit M$ Outlook(Express) nicht" :D :D :D

netzmeister
12.03.04, 14:20
Hallo,

ich habe jetzt das Webinterface von hier: http://phpmywebhosting.sourceforge.net/
konfiguriert und am Laufen. Den Fehler des falschen Pfades beim Anlegen der User
konnte ich finden.

Jetzt sollte ich noch den Spamasassin integrieren.

Viele Grüße

Eicke