Postfix richtig konfigurieren

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Postfix richtig konfigurieren

Post by Joe User »

Moin,

nachfolgend findet Ihr eine Basis-Konfiguration für Postfix >= 3.0.0 inklusive SASL (per Dovecot-IMAP) und TLS/SSL (SMTP-AUTH), welche die Empfehlungen aus dem Postfix Anti-UCE Cheat Sheet umsetzt und für Maildir-Systemuser vorkonfiguriert ist.

Postfix konfigurieren:

Code: Select all

mv /etc/postfix/main.cf /etc/postfix/main.cf.back
mv /etc/postfix/master.cf /etc/postfix/master.cf.back

cat > /etc/postfix/main.cf << "EOF"
allow_percent_hack = no
always_add_missing_headers = yes
biff = no
compatibility_level = 2
data_directory = /var/lib/postfix
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_long_queue_ids = yes
fast_flush_domains =
home_mailbox = .maildir/
inet_interfaces = all
inet_protocols = all
lmtp_tls_fingerprint_digest = sha1
local_header_rewrite_clients = permit_mynetworks permit_sasl_authenticated
mail_spool_directory = /var/vmail
mailbox_size_limit = 0
masquerade_domains = $mydomain
masquerade_exceptions = root mailer-daemon
message_size_limit = 0
mydestination = $myhostname localhost.$mydomain localhost
mydomain = example.com
myhostname = mail.$mydomain
mynetworks_style = host
notify_classes = data protocol resource software
openssl_path = /usr/bin/openssl
postscreen_bare_newline_action = enforce
postscreen_bare_newline_enable = yes
postscreen_dnsbl_action = enforce
postscreen_dnsbl_sites =
  list.dnswl.org=127.0.[0..255].0*-2
  list.dnswl.org=127.0.[0..255].1*-4
  list.dnswl.org=127.0.[0..255].2*-6
  list.dnswl.org=127.0.[0..255].3*-8
  zen.spamhaus.org=127.0.0.9*25
  zen.spamhaus.org=127.0.0.3*10
  zen.spamhaus.org=127.0.0.2*5
  zen.spamhaus.org=127.0.0.[4..7]*3
  zen.spamhaus.org=127.0.0.[10..11]*3
  swl.spamhaus.org*-10
  bl.mailspike.net=127.0.0.2*10
  bl.mailspike.net=127.0.0.10*5
  bl.mailspike.net=127.0.0.11*4
  bl.mailspike.net=127.0.0.12*3
  bl.mailspike.net=127.0.0.13*2
  bl.mailspike.net=127.0.0.14*1
  wl.mailspike.net=127.0.0.16*-2
  wl.mailspike.net=127.0.0.17*-4
  wl.mailspike.net=127.0.0.18*-6
  wl.mailspike.net=127.0.0.19*-8
  wl.mailspike.net=127.0.0.20*-10
  backscatter.spameatingmonkey.net*2
  bl.ipv6.spameatingmonkey.net*2
  bl.spameatingmonkey.net*2
  ix.dnsbl.manitu.net*2
  bl.spamcop.net*2
  db.wpbl.info*2
  psbl.surriel.com*2
  torexit.dan.me.uk*2
  tor.dan.me.uk*1
  safe.dnsbl.sorbs.net*1
postscreen_dnsbl_threshold = 5
postscreen_dnsbl_whitelist_threshold = 0
postscreen_greet_action = enforce
postscreen_non_smtp_command_enable = yes
postscreen_pipelining_enable = yes
queue_directory = /var/spool/postfix
recipient_delimiter = +
remote_header_rewrite_domain = domain.invalid
show_user_unknown_table_name = no
smtp_dns_support_level = enabled
### Bitte den richtigen Pfad aktivieren:
# centos/fedora: openssl
#smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
# debian/ubuntu/arch/gentoo: ca-certificates
#smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
# freebsd: ca_root_nss
#smtp_tls_CAfile = /usr/local/share/certs/ca-root-nss.crt
smtp_tls_ciphers = medium
smtp_tls_exclude_ciphers = CAMELLIA SEED IDEA RC2 RC4 aDSS kECDHe kECDHr kDHd kDHr eNULL aNULL MEDIUM LOW EXPORT
smtp_tls_fingerprint_digest = sha1
smtp_tls_loglevel = 1
smtp_tls_mandatory_ciphers = medium
smtp_tls_mandatory_exclude_ciphers = CAMELLIA SEED IDEA RC2 RC4 aDSS kECDHe kECDHr kDHd kDHr eNULL aNULL MEDIUM LOW EXPORT
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_client_port_logging = yes
smtpd_client_restrictions =
  sleep 1
  permit
smtpd_data_restrictions =
  reject_unauth_pipelining
  reject_multi_recipient_bounce
  permit
smtpd_end_of_data_restrictions =
  permit
smtpd_etrn_restrictions =
  reject
smtpd_helo_required = yes
smtpd_helo_restrictions =
  permit_mynetworks
  permit_sasl_authenticated
  reject_invalid_helo_hostname
  reject_non_fqdn_helo_hostname
  permit
#smtpd_milters = inet:127.0.0.1:8891 inet:127.0.0.1:8893
smtpd_recipient_restrictions =
  permit_mynetworks
  permit_sasl_authenticated
  reject_non_fqdn_recipient
  reject_unknown_recipient_domain
  check_recipient_access pcre:${config_directory}/recipient_checks.pcre
  permit
smtpd_relay_restrictions =
  permit_mynetworks
  permit_sasl_authenticated
  defer_unauth_destination
  permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions =
  reject_non_fqdn_sender
  reject_unknown_sender_domain
  permit
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/mail.example.com.crt
smtpd_tls_ciphers = medium
smtpd_tls_exclude_ciphers = CAMELLIA SEED IDEA RC2 RC4 aDSS kECDHe kECDHr kDHd kDHr eNULL aNULL MEDIUM LOW EXPORT
smtpd_tls_fingerprint_digest = sha1
smtpd_tls_key_file = /etc/ssl/private/mail.example.com.key
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_exclude_ciphers = CAMELLIA SEED IDEA RC2 RC4 aDSS kECDHe kECDHr kDHd kDHr eNULL aNULL MEDIUM LOW EXPORT
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
strict_rfc821_envelopes = yes
swap_bangpath = no
tls_daemon_random_bytes = 64
tls_high_cipherlist = EECDH+ECDSA+CHACHA20 EECDH+CHACHA20 EECDH+ECDSA+AESGCM EECDH+AESGCM EECDH+ECDSA+AES256 EECDH+AES256 EECDH+ECDSA+AES128 EECDH+AES128 EECDH+ECDSA+3DES EECDH+3DES EDH+CHACHA20 EDH+AESGCM EDH+AES256 EDH+AES128 EDH+3DES
tls_medium_cipherlist = EECDH+ECDSA+CHACHA20 EECDH+CHACHA20 EECDH+ECDSA+AESGCM EECDH+AESGCM EECDH+ECDSA+AES256 EECDH+AES256 EECDH+ECDSA+AES128 EECDH+AES128 EECDH+ECDSA+3DES EECDH+3DES EDH+CHACHA20 EDH+AESGCM EDH+AES256 EDH+AES128 EDH+3DES AESGCM AES256 AES128 3DES
tls_preempt_cipherlist = yes
tls_random_bytes = 64
tls_ssl_options = NO_COMPRESSION
virtual_alias_domains = hash:${config_directory}/virtual_alias_domains
virtual_alias_maps = hash:${config_directory}/virtual_alias_maps
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = hash:${config_directory}/virtual_mailbox_domains
virtual_mailbox_limit = 0
virtual_mailbox_maps = hash:${config_directory}/virtual_mailbox_maps
virtual_minimum_uid = 5000
virtual_transport = dovecot
virtual_uid_maps = static:5000
"EOF"

cat > /etc/postfix/master.cf << "EOF"
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
#smtp      inet  n       -       n       -       -       smtpd
smtp      inet  n       -       n       -       1       postscreen
smtpd     pass  -       -       n       -       -       smtpd
dnsblog   unix  -       -       n       -       0       dnsblog
tlsproxy  unix  -       -       n       -       0       tlsproxy
submission inet n       -       n       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       n       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       n       -       -       qmqpd
pickup    unix  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
#maildrop  unix  -       n       n       -       -       pipe
#  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
#uucp      unix  -       n       n       -       -       pipe
#  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# ====================================================================
#
# Other external delivery methods.
#
#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/local/sbin/bsmtp -f $sender $nexthop $recipient
#
#scalemail-backend unix -       n       n       -       2       pipe
#  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
#  ${nexthop} ${user} ${extension}
#
#mailman   unix  -       n       n       -       -       pipe
#  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
#  ${nexthop} ${user}
#
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda
  -f ${sender} -a ${recipient} -d ${user}@${nexthop}
"EOF"

cat > /etc/postfix/recipient_checks.pcre << "EOF"
/^\@/             550 Invalid address format.
/[!%\@].*\@/      550 This server disallows weird address syntax.
/^postmaster\@/   OK
/^hostmaster\@/   OK
/^security\@/     OK
/^abuse\@/        OK
/^admin\@/        OK
"EOF"
Als gute und recht zuverlässige Anti-Spam Lösung empfehle ich, wenn Postfix interne Anti-Spam Lösung nicht ausreichen sollte, policyd-weight. Die Installation ist relativ einfach und die Default-Konfiguration für nahezu alle Belange ausreichend.


Gruss,
Joe User


Letzte Aktualisierung: 08.04.2017
Last edited by Joe User on 2011-03-09 17:59, edited 4 times in total.
aubergine
Posts: 471
Joined: 2005-09-10 17:52
Location: Frankfurt am Main
 

Re: Postfix richtig konfigurieren

Post by aubergine »

Hinweis zu reject_unknown_helo_hostname

Diese Einstellung bewirkt dass der helo=<> Hostname des Absenders auf einen IP aufgelöst werden muss.

Ansich eine gute Möglichkeit diverse Spam Versender zu rejecten da in einem dem Standard entsprechenden Mailserver Setup eine gültige per A-Record auflösbare DNS Adresse verwendet wird.

Jedoch gibt es die Firma Ebay Inc. welche darauf scheinbar keinen Wert legt.
Darunter fallen diverse Mailout Server von Ebay und PayPal.

Zunächst einmal die Beispiele:

Code: Select all

htn3 postfix/smtpd[21312]: NOQUEUE: reject: RCPT from outbound2.den.paypal.com[216.113.188.112]: 450 4.7.1 <den01imail02.den.paypal.com>: Helo command rejected: Host not found; from=<payment@paypal.com> to=<paypal@domain.tld> proto=ESMTP helo=<den01imail02.den.paypal.com> 

Code: Select all

htn1 postfix/smtpd[21312]: NOQUEUE: reject: RCPT from mxsmfpool21.ebay.com[66.135.209.218]: 450 4.7.1 <mx62.smf.ebay.com>: Helo command rejected: Host not found; from=<endofitem@ebay.de> to=<ebay@domain.tld> proto=ESMTP helo=<mx62.smf.ebay.com> 
Beide Server werden von der eBay Inc. in den USA betreut.
Sie geben sich als den01imail02.den.paypal.com und mx62.smf.ebay.com aus.

Ein "host mx62.smf.ebay.com" und "host den01imail02.den.paypal.com" zeigt schnell warum die eingehende E-Mail abgelehnt wird.

Code: Select all

testbox:/# host mx62.smf.ebay.com
mx62.smf.ebay.com does not exist (Authoritative answer)

testbox:/# host den01imail02.den.paypal.com
den01imail02.den.paypal.com does not exist (Authoritative answer)

Daher der Hinweis an alle Leser:

Wer diese Konfigurationsmöglichkeit nutzt kann (fast) keine E-Mails von eBay und PayPal erhalten.


Außer man findet für dieses Problem eine wenigstens einigermaßen vertretbare Lösung.

Das fast steht in diesem Satz dafür dass einige Mailout Server sich eben doch mit einem gültigen A-Record anmelden, aber eben der Großteil nicht.
adjustman
Posts: 1132
Joined: 2003-03-26 23:29
Location: SA
 

Re: Postfix richtig konfigurieren

Post by adjustman »

UND - die ganzen permit(s) oben sind überflüssig.
Desweiteren ist smtpd_sasl_local_domain = $myhostname
bei Einsatz von saslauth als Daemon und Multidomainumgebungen
lieber leer zu lassen.
auch heisst es: home_mailbox = Maildir/
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

adjustMan wrote:UND - die ganzen permit(s) oben sind überflüssig.
ACK, aber sie schaden nicht und verdeutlichen zudem den entsprechenden Verarbeitungsstatus.
adjustMan wrote:Desweiteren ist smtpd_sasl_local_domain = $myhostname
bei Einsatz von saslauth als Daemon und Multidomainumgebungen
lieber leer zu lassen.
-vv please
EDIT: Nicht mehr nötig, danke.
adjustMan wrote:auch heisst es: home_mailbox = Maildir/
Der Name ist unrelevant, entscheident ist der Slash am Ende. Ich habe es trotzdem angepasst.
Last edited by Joe User on 2007-07-31 13:45, edited 1 time in total.
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Postfix richtig konfigurieren

Post by tomotom »

Joe User wrote:Moin, ... Als gute und recht zuverlässige Anti-Spam Lösung empfehle ich policyd-weight. ...
Warum nicht Spamasassin und was sind die Vor-/Nachteile gegenüber Spamasassin?
tomotom
Posts: 330
Joined: 2006-09-22 13:37
 

Re: Postfix richtig konfigurieren

Post by tomotom »

matzewe01 wrote:
tomotom wrote:
Joe User wrote:Moin, ... Als gute und recht zuverlässige Anti-Spam Lösung empfehle ich policyd-weight. ...
Warum nicht Spamasassin und was sind die Vor-/Nachteile gegenüber Spamasassin?
Klick mal den link, und lies mal die ersten 20 -30 Zeilen:
http://www.policyd-weight.org/

policy weight lehnt eine email Anhand formeller Inhalte ab. Und das schon vor dem "annehmen".
Eine Prüfung über Spamassassin wiederum erfordert das annehmen der email. letzteres hat dann auch wieder juristische Nachteile für den Provider.


Gruss Matthias
Aha, dass policy-weight über Spreu oder Weizen entscheidet bevor Postfix & co Mails angenommen haben ist genau dass was ich gesucht habe. Denn der Nachteil von Spamasassin ist ja, das die Mail erst mal angenommen werden muss, um in 90% der Fälle wieder zu löschen. Sehr interessant!
Anonymous
 

Re: Postfix richtig konfigurieren

Post by Anonymous »

Frage zu reject_unknown_helo_hostname und Ebay bzw. Paypal.

Was aubergine am 30.07.2007 geschrieben hat, kann ich nur bestätigen.

Die Regel zu deaktivieren ist aber auch nicht gerade die Lösung, die ich anstrebe. Ich fände es viel besser vorher allen Hosts von Ebay und Paypal grünes Licht zu geben und dann erst die Regel reject_unknown_helo_hostname anzuwenden.
Allerdings weiß ich weder wie ich eine entsprechende Regel erstelle, noch habe ich eine Liste von den verwendeten IP-Adressen.
Hat dazu einer von Euch eine Idee ...

Grüße vom
kleinen Prinzen 8)
squize
Userprojekt
Userprojekt
Posts: 729
Joined: 2003-05-19 16:46
Location: Karlsruhe
 

Re: Postfix richtig konfigurieren

Post by squize »

Dann musst du mit einem client check erst grünes Licht geben und danach weiter aussortieren:

Code: Select all

smtpd_recipient_restrictions =
                       .
                       .
                       .
    check_client_access hash:/etc/postfix/allow_some_important_server,
    reject_unknown_helo_hostname
                       .
                       .
                       .

Code: Select all

/etc/postfix/allow_some_important_server
mail1.ebay.com OK
mail2.ebay.com OK

Gruss

Marc
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

reject_unknown_client_hostname und reject_unknown_helo_hostname sind in der main.cf mitlerweile deaktiviert.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
aubergine
Posts: 471
Joined: 2005-09-10 17:52
Location: Frankfurt am Main
 

Re: Postfix richtig konfigurieren

Post by aubergine »

User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

[x] Done.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

Beispiel-Konfiguration aktualisiert: http://www.rootforum.org/forum/viewtopic.php?t=46643
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
debianfan
Posts: 165
Joined: 2002-08-17 18:40
 

Re: Postfix richtig konfigurieren

Post by debianfan »

tomotom wrote: Aha, dass policy-weight über Spreu oder Weizen entscheidet bevor Postfix & co Mails angenommen haben ist genau dass was ich gesucht habe. Denn der Nachteil von Spamasassin ist ja, das die Mail erst mal angenommen werden muss, um in 90% der Fälle wieder zu löschen. Sehr interessant!

Und was ist mit Spamassassin in der "Betriebsart" 'before queue', d.h. ein scannen während er annimmt im smtp-Prozess?

Ich hatte das mal auf einer Debian-Lenny-Maschine und ich hatte damit eigentlich keine Probleme.

Oder gibts da einen Pferdefuß?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

Spamassassin hat meiner Erfahrung nach (ist allerdings auch schon ein paar Jahre her) zuviele false postives wenn man es nicht extrem auf den eigenen Mailverkehr trainiert. Andere Postmaster werden natürlich auch andere negative/positive Erfahrungen gemacht haben und eventuell auch den aktuellen Stand bei Spamassassin besser kennen, daher können meine Erfahrungen mit Spamassassin mitlerweile durchaus überholt sein.

Ich filtere nur noch per RBL direkt in Postfix und entsorge die wenigen durchkommenden Spams manuell. Für mein persönliches Mailaufkommen von rund 200-500 Mails/Tag ist das ausreichend.


Letztendlich hilft nur selbst ausprobieren und gerade am Anfang nicht hart abzuweisen, sondern nur zu taggen, um false positives zu bemerken.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

Der erste Post wurde überarbeitet und aktualisiert.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
User avatar
lesswire
Posts: 33
Joined: 2005-04-28 03:45
 

Re: Postfix richtig konfigurieren

Post by lesswire »

Erst einmal vielen Dank an 'Joe user' für das prägnante Beispiel ohne viel BlahBlah (wie man es sonst leider viel zu oft sieht). Ich bin postmaster nur im Nebenjob, nach über 10 Jahren wurde es mal Zeit, alles auf einen aktuellen (und restriktiveren) Stand zu bringen. Verwendet wird:

- Debian jessie
- postfix 2.11
- max. 100 mails / Tag

Läuft soweit gut, aber habe ich mit:

Code: Select all

from mail.my-1st-server.de (my-1st-server.de [IPv6:2a01:4f8:xx:xxxx::2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.my-2nd-server.de (Postfix) with ESMTPS id ....
noch was übersehen oder ist's mit selbst signiertem Zertifikat normal ?

Danke und Gruß, LW
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: Postfix richtig konfigurieren

Post by daemotron »

lesswire wrote:Läuft soweit gut, aber habe ich mit:

Code: Select all

from mail.my-1st-server.de (my-1st-server.de [IPv6:2a01:4f8:xx:xxxx::2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.my-2nd-server.de (Postfix) with ESMTPS id ....
noch was übersehen oder ist's mit selbst signiertem Zertifikat normal ?
Das sieht doch völlig korrekt aus: Es wird TLS 1.2 mit einer PFS-fähigen Cipher Suite verwendet. Der Vermerk "No client certificate requested" bedeutet lediglich, dass vom Client kein Zertifikat für die Authentifizierung verlangt wurde. Das wäre eine Alternative zur Anmeldung mit User und Passwort, bedeutet aber, dass man eine eigene CA betreiben müsste oder die Leistungen einer kommerziellen CA kaufen müsste. Außerdem kommen nicht alle Clients mit diesem Verfahren zurecht; insbesondere auf Mobilgeräten kann es da zu Problemen kommen. Für eine Server-zu-Server Verbindung (wie in obigem Fall) ist "No client certificate requested" aber immer der Normalfall, da bei einer Server-zu-Server Verbindung keine Authentifizierung stattfindet - weder per Credentials, noch per Zertifikat.
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” — Terry Pratchett, Thief of Time
User avatar
lesswire
Posts: 33
Joined: 2005-04-28 03:45
 

Re: Postfix richtig konfigurieren

Post by lesswire »

Vielen Dank für die ausführliche Erläuterung ! :-D

Was für mich noch unklar ist:

1. Für ca. 90% der Kommunikation mit anderen Mailservern wird eine "trusted TLS connection" aufgebaut, der Rest ist "untrusted". Was ist eigentlich die Voraussetzung für 'Vertrauen' ?

2. Abweichend vom obigen Konfigurationsbeispiel habe ich in 'main.cf' noch eingetragen:

Code: Select all

smtpd_sasl_security_options     = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
Erschien mir lt. Postfix-manual sinnvoll, aber sicher bin ich nicht. Jedenfalls hat's noch keine Beschwerden gegeben. :)

3. Werden mit obiger Konfiguration eigentlich noch Mails von Servern angenommen, die keine Verschlüsselung, also kein TLS beherrschen? Sollte nach meinem Verständnis auch nicht der Fall sein, aber so tief bin ich in der Materie leider nicht drin.

Danke, LW.
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: Postfix richtig konfigurieren

Post by daemotron »

lesswire wrote:1. Für ca. 90% der Kommunikation mit anderen Mailservern wird eine "trusted TLS connection" aufgebaut, der Rest ist "untrusted". Was ist eigentlich die Voraussetzung für 'Vertrauen' ?
"Vertrauen" wird bei SSL/TLS darüber geregelt, welche CA Zertifikate Dein Postfix kennt. Das legst Du mit der Option smtp(d)_tls_CAfile fest. Diese verweist auf eine Datei, in der sich eine Sammlung an vertrauenswürdigen Zertifizierungsstellen befinden sollte. Wer die Sammlung nicht selbst pflegen kann oder möchte, kann auf die Sammlung von Mozilla zurückgreifen (siehe https://wiki.mozilla.org/CA:IncludedCAs).
lesswire wrote:3. Werden mit obiger Konfiguration eigentlich noch Mails von Servern angenommen, die keine Verschlüsselung, also kein TLS beherrschen? Sollte nach meinem Verständnis auch nicht der Fall sein, aber so tief bin ich in der Materie leider nicht drin.
Woraus schließt Du das? Eine solche Konfiguration wäre zwar theoretisch machbar, aber nicht unbedingt empfehlenswert (und auch nicht standardkonform). Nachzulesen hier: http://www.postfix.org/postconf.5.html# ... rity_level
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” — Terry Pratchett, Thief of Time
User avatar
lesswire
Posts: 33
Joined: 2005-04-28 03:45
 

Re: Postfix richtig konfigurieren

Post by lesswire »

Nochmals danke @daemotron, dann weiß ich Becheid und es passt soweit hier auch alles. :-BD
Gruß, LW.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11184
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Postfix richtig konfigurieren

Post by Joe User »

Für Postfix >= 3.0.0 überarbeitet und erweitert.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.