PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Exim4 & Courier, keine Authentifizierung



Ralf_L
17.07.06, 14:16
Hallo zusammen,

ich habe lt. Anleitung (http://archiv.debianhowto.de/de/exim4-vexim-sarge/c_exim4-vexim-sarge.html) einen Mailserver mit Debian, Exim4 und dem POP3 der Courier Suite aufgesetzt.
Nach einigen Startschwierigkeiten hat eigentlich auch alles schon mal funktioniert, allerdings habe ich seit heute morgen wieder ein Problem mit der Authentifizierung. Da ich leider noch nicht sehr fit im Umgang mit Linux bin, bitte ich schon mal vorab um Entschuldigung, wenn ich einige "dumme" Fragen stelle.
(Ja ja, ich weiß, es gibt keine dummen Fragen:D )

Also hier mal die facts:

- Courier läuft und kann sich gegen die MySQL DB authentifizieren (kann ich im mysql.log sehen), Mail abholen ist kein Problem
- Exim4 (Exim version 4.50 #1 built 27-May-2005 08:10:05) ist so konfiguiert, dass er nur ein Konfigurationsfile benutzt:

################################################## ####################
# Runtime configuration file for Exim #
################################################## ####################


primary_hostname = meinserver.de

MY_IP = aa.bb.cc.dd

VIRTUAL_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = 'local' AND enabled = '1' AND domain = '${quote_mysql:$domain}'
RELAY_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = 'relay' AND domain = '${quote_mysql:$domain}'
ALIAS_DOMAINS = SELECT DISTINCT alias FROM domainalias WHERE alias = '${quote_mysql:$domain}'

domainlist local_domains = @ : ${lookup mysql{VIRTUAL_DOMAINS}} : ${lookup mysql{ALIAS_DOMAINS}}
domainlist relay_to_domains = ${lookup mysql{RELAY_DOMAINS}}
hostlist relay_from_hosts = localhost
trusted_users = vmail:www-data:Debian-exim
hostlist host_auth_accept_relay = *

hide mysql_servers = localhost::(/var/run/mysqld/mysqld.sock)/vexim/vexim/HierstehtdasrichtigePWD!


acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_content
acl_smtp_helo = acl_check_helo
av_scanner = clamd:/var/run/clamav/clamd.ctl
spamd_address = 127.0.0.1 783

exim_user = Debian-exim
exim_group = Debian-exim
never_users = root

host_lookup = *
rfc1413_hosts = *
rfc1413_query_timeout = 0s

begin acl
.include /etc/exim4/vexim-acl-check-spf.conf

acl_check_helo:

# Include Vexim specific helo ACLs
.include /etc/exim4/vexim-acl-check-helo.conf


acl_check_rcpt:

accept hosts = :
deny local_parts = ^.*[@%!/|] : ^\\.
accept local_parts = postmaster
domains = +local_domains
require verify = sender
accept domains = +local_domains
endpass
verify = recipient
accept domains = +relay_to_domains
endpass
verify = recipient
accept hosts = +relay_from_hosts
accept authenticated = *
deny message = relay not permitted (main ACL)

acl_check_content:

<SNIP>

begin routers
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

<SNIP>
begin transports

remote_smtp:
driver = smtp

virtual_delivery:
driver = appendfile
envelope_to_add
return_path_add
mode = 0600
maildir_format = true
create_directory = true
directory = ${lookup mysql{select smtp from users,domains \
where localpart = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' \
and users.domain_id = domains.domain_id}}
user = ${lookup mysql{select users.uid from users,domains \
where localpart = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' \
and users.domain_id = domains.domain_id}}
group = ${lookup mysql{select users.gid from users,domains \
where localpart = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' \
and users.domain_id = domains.domain_id}}
quota = ${lookup mysql{select users.quota from users,domains \
where localpart = '${quote_mysql:$local_part}' \
and domain = '${quote_mysql:$domain}' \
and users.domain_id = domains.domain_id}{${value}M}}
quota_is_inclusive = false
#quota_size_regex = ,S=(\d+):
quota_warn_threshold = 75%
maildir_use_size_file = false
quota_warn_message = "To: $local_part@$domain\n\
Subject: Mailbox quota warning\n\n\
This message was automatically generated by the mail delivery software.\n\n\
You are now using over 75% of your allocated mail storage quota.\n\n\
If your mailbox fills completely, further incoming messages will be automatically\n\
returned to their senders.\n\n\
Please take note of this and remove unwanted mail from your mailbox.\n"

<SNIP>

begin authenticators

login:
driver = plaintext
public_name = LOGIN
server_prompts = Username:: : Password::
server_condition = ${extract {address} {${readsocket{/var/run/courier/authdaemon/socket} \
{AUTH ${strlen:exim\nlogin\n$1\n$2\n}\nexim\nlogin\n$1\n $2\n} }} {yes} fail}

# server_condition = ${lookup mysql{SELECT '1' FROM users \
# WHERE username = '${quote_mysql:$1}' \
# AND clear = '${quote_mysql:$2}'} {yes}{no}}

server_set_id = $1

# PLAIN authenticator
plain:
driver = plaintext
public_name = PLAIN
server_prompts = :
server_condition = ${extract {address} {${readsocket{/var/run/courier/authdaemon/socket} \
{AUTH ${strlen:exim\nlogin\n$2\n$3\n}\nexim\nlogin\n$2\n $3\n} }} {yes} fail}

# server_condition = ${lookup mysql{SELECT '1' FROM users \
# WHERE username = '${quote_mysql:$2}' \
# AND clear = '${quote_mysql:$3}'} {yes}{no}}


server_set_id = $2


# End of Exim configuration file


Melde ich mich nun mit einem Client an, sollte doch Exim4 gefälligst den Courier authdaemon fragen, oder der User authentifiziert werden kann (oder. siehe auskommentierte Zeilen bei den Authenticators, direkt in mysql nachschauen). In den Logfiles sehe ich aber nichts dergleichen sondern alle ausgehenden Mails werden mit "relay not permitted" abgewiesen.
D.h. doch, dass meine ACL bis zum Ende abgearbeitet wird und die Bedingung accept authenticated = * nicht erfüllt wird.
Warum? Kann mir mal jemand auf die Sprünge helfen, unter welchen Bedingungen eine Verbindung als "authenticated" angesehen wird?

Vielen Dank für eure Hilfe, wenn ich irgend etwas an Infos noch posten soll, bitte kurze Rückmeldung.

Ralf

Stefan Bauer
17.07.06, 17:29
richtig gedacht, dafür ist auch der authdaemon gedacht. in meinem fall das paket libsasl2

die zeilen in der exim4 config sehen bei gesplitteter config so aus bei mir:


plain_saslauthd_server:
driver = plaintext
public_name = PLAIN
server_condition = ${if saslauthd{{$2}{$3}}{1}{0}}
server_set_id = $2
server_prompts = :
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
#
login_saslauthd_server:
driver = plaintext
public_name = LOGIN
server_condition = ${if saslauthd{{$1}{$2}}{1}{0}}
server_set_id = $1
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif


nach der installation des auth daemons noch prüfen ob in der datei


"/etc/default/saslauthd"

die Option start auf yes steht.

Ralf_L
18.07.06, 10:20
Erst mal vielen Dank für die Antwort, Problem ist inzwischen gelöst!
Lag nicht an der Konfiguration, sondern an unserem Cisco-Router im Office. Ich habe zwar auf ein telnet eine ordentliche Antwort bekommen, aber sobald man den ersten Befehl eintippen wollte, bricht die Verbindung ab.

Tja, man sollte auch an die dümmsten Sachen immer zuerst denken :-)