PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Cyrus mit saslauth (Debian)



Arktos
27.01.11, 12:50
Hallo,

ich habe mir den Postfix MTA geladen und wollte gerne Cyrus2.2 für IMAP nutzen. Außerdem habe ich noch SquirrelMail als frontend installiert.
Immer wenn ich mich über cyradm -u cyrus localhost oder über SquirrelMail einloggen möchte, kommt folgende Nachricht in /var/log/mail.log




Jan 27 13:47:54 vserver3381 cyrus/imap[9044]: badlogin: localhost.localdomain [127.0.0.1] plaintext bootsmann SASL(-1): generic failure: checkpass failed


/etc/imapd.conf


postmaster: postmaster
configdirectory: /var/lib/cyrus
partition-default: /var/spool/imap
admins: cyrus
allowanonymouslogin: no
allowplaintext: yes
sasl_mech_list: PLAIN
servername: XenonReallife
autocreatequota: 10000
reject8bit: no
quotawarn: 90
timeout: 30
poptimeout: 10
dracinterval: 0
drachost: localhost
sasl_pwcheck_method: saslauthd
sievedir: /usr/sieve
sendmail: /usr/sbin/sendmail
sieve_maxscriptsize: 32
sieve_maxscripts: 5
#unixhierarchysep: yes

/etc/postfix/sasl/smtpd.conf



pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
saslauthd_path: /var/run/saslauthd/mux
autotransition:true


/etc/default/saslauthd



#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam -- use PAM
# rimap -- use a remote IMAP server
# shadow -- use the local shadow password file
# sasldb -- use the local sasldb database file
# ldap -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="shadow"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

Arktos
28.01.11, 14:02
Es müsste an Cyrus liegen, denn testsaslathd funktioniert.
Was könnt ihr mir für alternativen zu Cyrus empfehlen?

Roger Wilco
28.01.11, 15:38
Dovecot IMAP. Bringt auch eine etwas besser dokumentierte SASL-Implementierung mit, die von Postfix genutzt werden kann.

Arktos
28.01.11, 16:36
Danke. Dovecot war einfach zu installieren und läuft nun perfekt.

Arktos
28.01.11, 18:29
Hab doch ein kleines Problem. Über SquirrelMail (SMTP) kann ich E-Mails versenden und diese kommen auch an. Aber wenn ich meine Mails via SMTP mit Thunderbird verschicken möchte, erhalte ich diesen Fehler:



Fehler beim Senden der Nachricht: Der Mail-Server antwortete: 5.7.1 <xxx@xxx>: Relay access denied. Bitte überprüfen Sie die E-Mail-Adresse xxx@xxx und wiederholen Sie den Vorgang.


Wenn ich an die Googleadresse über SquirrelMail ne Mail schicke, landet diese bei Google im Spam-Ordner.

Roger Wilco
29.01.11, 20:08
Ohne Logs und deine Postfix-Konfiguration wird dir niemand in dieser Sache weiterhelfen können.

Arktos
09.02.11, 10:00
Main.cf



# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = vserver3381.vserver-on.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = vserver3381, vserver3381.vserver-on.de, localhost.vserver-on.de, localhost, xenon-reallife.de
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
virtual_maps = hash:/etc/postfix/virtual
smtpd_tls_security_level = may
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.keyrelay_domains = test.ru
smtpd_sasl_auth_enable = no


mail.info



Feb 9 10:35:47 vserver3381 dovecot: IMAP(xx): Disconnected for inactivity
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: warning: cannot get private key from file /etc/ssl/private/ssl-cert-snakeoil.keyrelay_domains = test.ru
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: warning: TLS library problem: 13568:error:02001002:system library:fopen:No such file or directory:bss_file.c:352:fopen('/etc/ssl/private/ssl-cert-snakeoil.keyrelay_domains = test.ru','r'):
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: warning: TLS library problem: 13568:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: warning: TLS library problem: 13568:error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib:ssl_rsa.c:648:
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: cannot load RSA certificate and key data
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: connect from xx[ip]
Feb 9 10:54:55 vserver3381 postfix/cleanup[13571]: 6E56F16058: message-id=<20110209095455.6E56F16058@vserver3381.vserver-on.de>
Feb 9 10:54:55 vserver3381 postfix/qmgr[20638]: 6E56F16058: from=<double-bounce@vserver3381.vserver-on.de>, size=866, nrcpt=1 (queue active)
Feb 9 10:54:55 vserver3381 postfix/smtpd[13568]: disconnect from xx
Feb 9 10:54:55 vserver3381 postfix/local[13573]: 6E56F16058: to=<xx@vserver3381.vserver-on.de>, orig_to=<postmaster>, relay=local, delay=0.04, delays=0.03/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Feb 9 10:54:55 vserver3381 postfix/qmgr[20638]: 6E56F16058: removed

Roger Wilco
09.02.11, 10:41
Main.cf
Die Ausgabe von `postconf -n` reicht nächstes mal aus.



smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.keyrelay_domains = test.ru
Das möchtest du dir nochmal genauer ansehen. Die Meldung in deinen Logdateien hast du sicherlich gesehen.



smtpd_sasl_auth_enable = no
Willst du das wirklich? Lies dazu http://www.postfix.org/SASL_README.html#server_sasl


mail.info
Die Logausschnitte, die du postest, sollten schon etwas von dem genannten Fehler beinhalten. Ansonsten sind diese nutzlos.

Arktos
09.02.11, 15:11
Die Logausschnitte, die du postest, sollten schon etwas von dem genannten Fehler beinhalten. Ansonsten sind diese nutzlos.

Sie beinhalten doch das Problem?


smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.keyrelay_domains

Die Datei ist bei mir nicht vorhanden gewesen, stattdessen eine *-snakeoil.key, die ich in die Config eingetragen haben, leider funktioniert es immernoch nicht.


Und zu dem mit dem SASL: Ich möchte einfach nur die Linux Benutzer (/etc/passwd) benutzen und ich meine, dass das auch ohne SASL geht.

Roger Wilco
09.02.11, 15:24
Sie beinhalten doch das Problem?
Ich sehe darin nichts bzgl. "Relay access denied.". Du etwa?


Die Datei ist bei mir nicht vorhanden gewesen, stattdessen eine *-snakeoil.key, die ich in die Config eingetragen haben, leider funktioniert es immernoch nicht.
Erstens standen da mehrere Direktiven in einer Zeile, siehe Fehlermeldung.

Zweitens: Weißt du überhaupt, was die Direktive bezweckt bzw. was in der Datei stehen sollte? Das solltest du schleunigst nachlesen!


Und zu dem mit dem SASL: Ich möchte einfach nur die Linux Benutzer (/etc/passwd) benutzen und ich meine, dass das auch ohne SASL geht.
Nein, tut es nicht. Aber das konntest du ja schon in der von mir verlinkten SASL_README nachlesen.

Arktos
09.02.11, 15:52
Sorry, hatte vergessen einen Teil der mail.log zu posten:



Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: warning: TLS library problem: 10983:error:02001002:system library:fopen:No such file or directory:bss_file.c:352:fopen('/etc/ssl/private/ssl-cert-snakeoil.key# = test.ru','r'):
Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: warning: TLS library problem: 10983:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:354:
Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: warning: TLS library problem: 10983:error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib:ssl_rsa.c:648:
Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: cannot load RSA certificate and key data
Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: connect from brhv-4db738f4.pool.mediaWays.net[77.183.56.244]
Feb 9 16:50:51 vserver3381 postfix/smtpd[10983]: NOQUEUE: reject: RCPT from brhv-4db738f4.pool.mediaWays.net[77.183.56.244]: 554 5.7.1 <xx@gmx.de>: Relay access denied; from=<xx@xx.de> to=<xxr@gmx.de> proto=ESMTP helo=<[127.0.0.1]>
Feb 9 16:50:53 vserver3381 postfix/smtpd[10983]: disconnect from brhv-4db738f4.pool.mediaWays.net[77.183.56.244]



Edit:

So, ich hab mal SASL angeschmissen und es geht wieder nicht. In der /etc/default/saslauthd ist shadow als Methode eingetragen und die /etc/postfix/sasl/smtpd.conf ist auch richtig. Trozdem meint Postfix, dass keine Methode für SASL eingetragen ist?!?!



Feb 9 17:10:03 vserver3381 postfix/smtpd[13171]: fatal: no SASL authentication mechanisms
Feb 9 17:10:04 vserver3381 postfix/master[13033]: warning: process /usr/lib/postfix/smtpd pid 13171 exit status 1
Feb 9 17:10:04 vserver3381 postfix/master[13033]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling