Fragen zu eigenständigem Mail-Server mit UCS

Zur Fehleranalyse wäre es hilfreich, wenn Sie folgendes täten:

  1. in einem Terminal auf dem UCS System:
tail -f /var/log/mail.log
  1. in einem anderen Terminal auf dem UCS System:
swaks --from testfrom@example.org --to user@dom.ain --server $(hostname -f) --port 25
  1. in einem Terminal auf dem UCS System:
tail -f /var/log/mail.log
  1. in einem anderen Terminal auf dem UCS System:
swaks --from user@dom.ain --to testto@example.com --server $(hostname -f) --port 587 --auth-user user@dom.ain --auth-password s3cr3t

user@dom.ain : Eine mailPrimaryAdress eines Ihrer User
@example.org: Externe Adresse (example.{com,org} darf zum Testen verwendet werden)

Ok hier die Ergebnisse:

root@email:~# swaks --from top.gun18@freenet.de --to christian.saeum@lichte-kraft.eu --server $(hostname -f) --port 25
=== Trying email.lichte-kraft.eu:25...
=== Connected to email.lichte-kraft.eu.
<-  220 email.lichte-kraft.eu ESMTP Postfix
 -> EHLO email.lichte-kraft.eu
<-  250-email.lichte-kraft.eu
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
 -> MAIL FROM:<top.gun18@freenet.de>
<-  250 2.1.0 Ok
 -> RCPT TO:<christian.saeum@lichte-kraft.eu>
<-  250 2.1.5 Ok
 -> DATA
<** 554 5.7.1 <DATA>: Data command rejected: Sender access denied
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
root@email:~# tail -f /var/log/mail.log
Jan 12 07:55:09 email postfix/smtpd[4376]: warning: hostname static.vdc.vn does                                69.101
Jan 12 07:55:09 email postfix/smtpd[4376]: connect from unknown[123.30.169.101]
Jan 12 07:55:09 email postfix/smtpd[4376]: lost connection after CONNECT from un
Jan 12 07:55:09 email postfix/smtpd[4376]: disconnect from unknown[123.30.169.10
Jan 12 07:57:13 email imap[4511]: starttls: TLSv1 with cipher ECDHE-RSA-AES256-S                               tication
Jan 12 07:57:13 email imap[4511]: login: localhost [::1] christian.saeum@lichte-                               ged in SESSIONID=<email-4511-1452581833-1-17717954830898856050>
Jan 12 07:57:44 email imap[549]: USAGE christian.saeum@lichte-kraft.eu user: 0.0
Jan 12 07:58:29 email postfix/anvil[4377]: statistics: max connection rate 1/60s                                12 07:55:09
Jan 12 07:58:29 email postfix/anvil[4377]: statistics: max connection count 1 fo                                07:55:09
Jan 12 07:58:29 email postfix/anvil[4377]: statistics: max cache size 1 at Jan 1
Jan 12 08:07:40 email postfix/smtpd[6162]: connect from email.lichte-kraft.eu[37                               .120.163.78]
Jan 12 08:07:40 email postfix/smtpd[6162]: B2AA5A009CF: client=email.lichte-kraf                               t.eu[37.120.163.78]
Jan 12 08:07:40 email postfix/smtpd[6162]: B2AA5A009CF: reject: DATA from email.                               lichte-kraft.eu[37.120.163.78]: 554 5.7.1 <DATA>: Data command rejected: Sender                                access denied; from=<top.gun18@freenet.de> to=<info@litpix.de> proto=ESMTP helo=                               <email.lichte-kraft.eu>
Jan 12 08:07:40 email postfix/smtpd[6162]: disconnect from email.lichte-kraft.eu                               [37.120.163.78]
root@email:~# swaks --from christian.saeum@Lichte-Kraft.eu --to top.gun18@freenet.de --server $(hostname -f) --port 587 --auth-user christian.saeum@lichte-kraft.eu --auth-password xxxxx
=== Trying email.lichte-kraft.eu:587...
=== Connected to email.lichte-kraft.eu.
<-  220 email.lichte-kraft.eu ESMTP Postfix
 -> EHLO email.lichte-kraft.eu
<-  250-email.lichte-kraft.eu
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
*** Host did not advertise authentication
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
root@email:~#

[code] tail während des ausführens!!

Jan 12 08:14:56 email postfix/submission/smtpd[6727]: connect from email.lichte-kraft.eu[37.120.163.78]
Jan 12 08:14:56 email postfix/submission/smtpd[6727]: disconnect from email.lichte-kraft.eu[37.120.163.78]
[/code]

Hmm… das erste log ist verwirrend:

Client: --from top.gun18@freenet.de --to christian.saeum@lichte-kraft.eu Server: from=<top.gun18@freenet.de> to=<info@litpix.de>
“christian.saeum@lichte-kraft.eu” muss die mailPrimaryAdress des Users sein, da davor ein Login zu Cyrus zu sehen ist und die Adresse unten auch für’s Login zu Postfix verwendet wird. Was macht info@litpix.de hier?

Bzgl. des zweiten Logs:

Host did not advertise authentication

Da ist wahrscheinlich “smtpd_sasl_auth_enable” nicht für an… oder swaks braucht noch “-tls”. Versuchen Sie’s bitte noch einmal mit “swaks -tls …” oder wenn es nicht klappt auf Port 25.

Könnten Sie bitte auch die Ausgabe von “postconf -n” hierher kopieren?

Gruß
Daniel Tröder

Ok sorry das mit Litpix war mein Fehler und hier nochmal alles:

root@email:~# swaks --from Top.Gun18@Freenet.de --to christian.saeum@Lichte-Kraft.eu --server $(hostname -f) --port 25
=== Trying email.lichte-kraft.eu:25...
=== Connected to email.lichte-kraft.eu.
<-  220 email.lichte-kraft.eu ESMTP Postfix
 -> EHLO email.lichte-kraft.eu
<-  250-email.lichte-kraft.eu
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
 -> MAIL FROM:<Top.Gun18@Freenet.de>
<-  250 2.1.0 Ok
 -> RCPT TO:<christian.saeum@Lichte-Kraft.eu>
<-  250 2.1.5 Ok
 -> DATA
<** 554 5.7.1 <DATA>: Data command rejected: Sender access denied
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
root@email:~#

Logausgabe:

Jan 12 09:45:04 email postfix/smtpd[13774]: connect from email.lichte-kraft.eu[37.120.163.78]
Jan 12 09:45:04 email postfix/smtpd[13774]: 70BE2A0139D: client=email.lichte-kraft.eu[37.120.163.78]
Jan 12 09:45:04 email postfix/smtpd[13774]: 70BE2A0139D: reject: DATA from email.lichte-kraft.eu[37.120.163.78]: 554 5.7.1 <DATA>: Data command rejected: Sender access denied; from=<Top.Gun18@Freenet.de> to=<christian.saeum@Lichte-Kraft.eu> proto=ESMTP helo=<email.lichte-kraft.eu>
Jan 12 09:45:04 email postfix/smtpd[13774]: disconnect from email.lichte-kraft.eu[37.120.163.78]
root@email:~# swaks -tls --from christian.saeum@lichte-kraft.eu --to top.gun18@freenet.de --server $(hostname -f) --port 587 --auth-user christian.saeum@lichte-kraft.eu --auth-password xxxxx
=== Trying email.lichte-kraft.eu:587...
=== Connected to email.lichte-kraft.eu.
<-  220 email.lichte-kraft.eu ESMTP Postfix
 -> EHLO email.lichte-kraft.eu
<-  250-email.lichte-kraft.eu
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
 -> STARTTLS
<-  220 2.0.0 Ready to start TLS
=== TLS started w/ cipher ECDHE-RSA-AES256-GCM-SHA384
=== TLS peer subject DN="/C=DE/ST=DE/L=DE/O=Hypnosepraxis Lichte Kraft/OU=Univention Corporate Server/CN=email.lichte-kraft.eu/emailAddress=ssl@lichte-kraft.eu"
 ~> EHLO email.lichte-kraft.eu
<~  250-email.lichte-kraft.eu
<~  250-PIPELINING
<~  250-SIZE 10240000
<~  250-VRFY
<~  250-ETRN
<~  250-AUTH PLAIN LOGIN
<~  250-AUTH=PLAIN LOGIN
<~  250-ENHANCEDSTATUSCODES
<~  250-8BITMIME
<~  250 DSN
 ~> AUTH LOGIN
<~  334 VXNlcm5hbWU6
 ~> Y2hyaXN0aWFuLnNhZXVtQGxpY2h0ZS1rcmFmdC5ldQ==
<~  334 UGFzc3dvcmQ6
 ~> Q0IxMTQwMGch
<~  235 2.7.0 Authentication successful
 ~> MAIL FROM:<christian.saeum@lichte-kraft.eu>
<~  250 2.1.0 Ok
 ~> RCPT TO:<top.gun18@freenet.de>
<~  250 2.1.5 Ok
 ~> DATA
<~  354 End data with <CR><LF>.<CR><LF>
 ~> Date: Tue, 12 Jan 2016 09:47:34 +0100
 ~> To: top.gun18@freenet.de
 ~> From: christian.saeum@lichte-kraft.eu
 ~> Subject: test Tue, 12 Jan 2016 09:47:34 +0100
 ~> X-Mailer: swaks v20120320.0 jetmore.org/john/code/swaks/
 ~>
 ~> This is a test mailing
 ~>
 ~> .
<~  250 2.0.0 Ok: queued as 49107A0139D
 ~> QUIT
<~  221 2.0.0 Bye
=== Connection closed with remote host.
root@email:~#

Logausgabe:

Jan 12 09:47:35 email postfix/submission/smtpd[13933]: connect from email.lichte-kraft.eu[37.120.163.78]
Jan 12 09:47:35 email postfix/submission/smtpd[13933]: 49107A0139D: client=email.lichte-kraft.eu[37.120.163.78], sasl_method=LOGIN, sasl_username=christian.saeum@lichte-kraft.eu
Jan 12 09:47:35 email postfix/cleanup[13937]: 49107A0139D: message-id=<>
Jan 12 09:47:35 email postfix/qmgr[4561]: 49107A0139D: from=<christian.saeum@lichte-kraft.eu>, size=179, nrcpt=1 (queue active)
Jan 12 09:47:35 email postfix/submission/smtpd[13933]: disconnect from email.lichte-kraft.eu[37.120.163.78]
Jan 12 09:47:35 email postfix/smtp[13938]: 49107A0139D: to=<top.gun18@freenet.de>, relay=emig.freenet.de[195.4.92.218]:25, delay=0.6, delays=0.25/0.04/0.16/0.15, dsn=2.0.0, status=sent (250 OK id=1aIuc4-0002rI-Qq)
Jan 12 09:47:35 email postfix/qmgr[4561]: 49107A0139D: removed

Postconf -n

root@email:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
disable_vrfy_command = no
inet_interfaces = all
inet_protocols = ipv4
local_header_rewrite_clients =
local_recipient_maps = $alias_maps, $virtual_alias_maps
masquerade_domains = $mydomain
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = email.lichte-kraft.eu
mynetworks = 127.0.0.0/8
myorigin = email.lichte-kraft.eu
recipient_delimiter = +
relocated_maps = hash:/etc/postfix/relocated
smtp_helo_name = email.lichte-kraft.eu
smtp_tls_security_level = may
smtpd_data_restrictions = check_policy_service unix:private/sender_policy_incoming
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_unknown_recipient_domain, reject_non_fqdn_recipient, reject_invalid_helo_hostname, reject_unauth_destination, reject_unlisted_recipient, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_mynetworks, check_policy_service unix:private/sender_policy_incoming
smtpd_starttls_timeout = 300s
smtpd_timeout = 300s
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/univention/ssl/email.lichte-kraft.eu/cert.pem
smtpd_tls_key_file = /etc/univention/ssl/email.lichte-kraft.eu/private.key
smtpd_tls_received_header = no
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
submission_data_restrictions = check_policy_service unix:private/submission_policy
submission_recipient_restrictions = check_policy_service unix:private/submission_policy, permit_sasl_authenticated, reject
submission_sender_restrictions = reject_non_fqdn_sender, check_policy_service unix:private/submission_policy, permit_sasl_authenticated, reject
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport, ldap:/etc/postfix/ldap.transportlocal, ldap:/etc/postfix/ldap.transportremote
virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual, ldap:/etc/postfix/ldap.groups, ldap:/etc/postfix/ldap.distlist, ldap:/etc/postfix/ldap.sharedfolderremote, ldap:/etc/postfix/ldap.sharedfolderlocal, ldap:/etc/postfix/ldap.virtual
virtual_mailbox_domains = ldap:/etc/postfix/ldap.virtualdomains
virtual_mailbox_maps = hash:/etc/postfix/virtual, ldap:/etc/postfix/ldap.groups, ldap:/etc/postfix/ldap.distlist, ldap:/etc/postfix/ldap.sharedfolderremote, ldap:/etc/postfix/ldap.sharedfolderlocal, ldap:/etc/postfix/ldap.virtual
virtual_transport = lmtp:127.0.0.1:2003
root@email:~#

Jetzt kam auch bei Freenet was an!

[quote=“csaeum”][code]
smtpd_data_restrictions = check_policy_service unix:private/sender_policy_incoming
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_unknown_recipient_domain, reject_non_fqdn_recipient, reject_invalid_helo_hostname, reject_unauth_destination, reject_unlisted_recipient, permit
smtpd_sender_restrictions = permit_mynetworks, check_policy_service unix:private/sender_policy_incoming

submission_data_restrictions = check_policy_service unix:private/submission_policy
submission_recipient_restrictions = check_policy_service unix:private/submission_policy, permit_sasl_authenticated, reject
submission_sender_restrictions = reject_non_fqdn_sender, check_policy_service unix:private/submission_policy, permit_sasl_authenticated, reject[/code][/quote]
Ich habe gerade kein Horde-System zur Hand um mir das selbst anzuschauen. Schauen Sie in der master.cf nach dem Pfad zum Policy-Service “sender_policy_incoming”. Der entscheidet was rein (smtpd) geht. Vielleicht ist hier etwas mehr Information: wiki.kolab.org/User:Kanarip/Dra … ess_Policy
Ich kenne mich mit diesem Policy-Service von Kolab nicht aus. Schauen Sie ob etwas im Handbuch zu finden ist oder fragen Sie mal im Kolab-Forum nach, ob die Einstellungen so stimmen, und was dieser Policy-Service auswertet. Er ist es auf jeden Fall, der eingehende Mails ablehnt.

Gruß
Daniel Tröder

Ok danke das ist mal eine aussage mit der ich umgehen kann :slight_smile:

So dann werde ich mich mal dorthin begeben.

Ok habe nunmal im Kolab IRC Chat nachgefragt. Aber dort wird mir nur geraten alles auf Debian Basis aufzubauen ohne UCS als “Grundsystem”

Werde mich dann nochmal im Postfix Forum probieren. Hoffe bald auf eine Lösung für das ganze :slight_smile:

Also habe mal in der UCS Registry die Variable “mail/postfix/virtual/enabled” auf “no” bzw “” gesetzt.

Die Mails die dann ankamen wurden mit

info@litpix.de
    host mail.litpix.de [37.120.163.78]
    SMTP error from remote mail server after pipelined DATA:
    554 5.7.1 <DATA>: Data command rejected: Sender access denied

beantwortet bzw zurückgeschickt. Grundsätzlich ja richtig.

Ich habe auch schon einen Teil mit den hier (wiki.kolab.org/User:Kanarip/Dra … ess_Policy) empfohlenen verglichen. Aber noch nichts gefunden.

Mastodon