PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Funktionierende main.cf & master.cf



ThyMaster
09.06.13, 09:54
Hi Zusammen,

ich ziehe gerade meinen Mail-Server (Postfix mit Courier) von SuSE 10.1 auf openSuSE 12.3 (64bit) um.
Hierbei dachte ich eigentlich, dass ich die nötigen Konfig-Dateien kopieren müsste, ein paar Anpassungen (64bit, chroot, SSL Certs) und gut (hat bei Courier auch gut geklappt).

Postfix jedoch hat riesige Probleme mit TLS. Hier einmal die alten (unter SuSE 10.1 funktionsfähigen) Konfig-Dateien.
Wenn jemandem ein Fehler auffällt, dann wäre ich sehr dankbar für Feedback.
Gern aber auch Hinweise, wo ich eine funktionierende (Demo-)Konfig finde.
Wichtig hierei sind:
- Die Einbindung von Amavis und SpamAssassin
- Ausgehende Mails über einen Relay schicken
- SSL Unterstützung
- PAM Authtification für SSL Unterstützung

main.cf

command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
message_size_limit = 51200000
mydomain = externes-netz.de
myhostname = mail
mydestination = $mydomain, $myhostname, localhost.$mydomain, $myhostname.$mydomain, externes-netz.de, lokales.netz
mynetworks = 192.168.1.0/24, 127.0.0.0/8

in_flow_delay = 1s

default_destination_concurrency_limit = 10

debug_peer_level = 2
debugger_command =
PATH=/usr/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq

setgid_group = maildrop

manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
readme_directory = /usr/share/doc/packages/postfix/README_FILES

# Some ISPs do not accept mail from DynIP (like me)
# Use transport to relay only mail to such ISPs (like aol.com)
# -or-
# use relayhost to relay all outgoing mail
#
#relayhost = [mail.arcor-online.net]
relayhost = [mail.selfhost.de]
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical

defer_transports =
disable_dns_lookups = no

mailbox_command = /usr/bin/procmail
home_mailbox = Maildir/

smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_banner = $myhostname ESMTP
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_local_domain = externes-netz.de
broken_sasl_auth_clients = yes

strict_rfc821_envelopes = no

content_filter=smtp-amavis:[127.0.0.1]:10024
myorigin = $myhostname


# Activate and define authentification for mail relay server
# (see also sasl_passwd)
#
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

html_directory = /usr/share/doc/packages/postfix/html
unknown_local_recipient_reject_code = 450

smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/externes-netz.de.key
smtpd_tls_cert_file = /etc/postfix/ssl/externes-netz.de.crt
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

master.cf

# ================================================== ========================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (50)
# ================================================== ========================
smtp inet n - y - - smtpd -o pam
smtps inet n - y - - smtpd
-o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
587 inet n - y - - smtpd -o pam
pickup fifo n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr fifo n - y 300 1 qmgr
#qmgr fifo n - n 300 1 nqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
flush unix n - n 1000? 0 flush
smtp unix - - y - - smtp
showq unix n - y - - showq
error unix - - y - - error
local unix - n n - - local
virtual unix - n y - - virtual
lmtp unix - - y - - lmtp
smtp-amavis unix - - y - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20

localhost:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
-o mynetworks_style=host
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_ unknown_recipient_checks
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
# The Cyrus deliver program has changed incompatibly.
#
cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -m ${extension} ${user}
flags= user=cyrus argv=/usr/lib/cyrus/bin/deliver -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
vscan unix - n n - 10 pipe
user=vscan argv=/usr/sbin/amavis ${sender} ${recipient}
procmail unix - n n - - pipe
flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} ${recipient}
relay unix - - n - - smtp
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
proxymap unix - - n - - proxymap
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
discard unix - - n - - discard
tlsmgr unix - - n 1000? 1 tlsmgr

Danke im voraus
-ThyMaster

muell200
09.06.13, 10:16
Hierbei dachte ich eigentlich, dass ich die nötigen Konfig-Dateien kopieren müsste, ein paar Anpassungen (64bit, chroot, SSL Certs) und gut (hat bei Courier auch gut geklappt).


was sagen die loggiles?

ThyMaster
09.06.13, 10:27
Sorry, vergessen:

2013-06-09T10:25:50.163347+02:00 server postfix/smtpd[32402]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
2013-06-09T10:25:50.164242+02:00 server postfix/smtpd[32402]: warning: SASL authentication failure: Password verification failed
2013-06-09T10:25:50.164899+02:00 server postfix/smtpd[32402]: warning: externe-adresse.de: SASL PLAIN authentication failed: generic failure
2013-06-09T10:25:50.213106+02:00 server postfix/smtpd[32402]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
2013-06-09T10:25:50.214355+02:00 server postfix/smtpd[32402]: warning: externe-adresse.de: SASL LOGIN authentication failed: generic failure


und noch:

2013-06-09T10:28:25.095538+02:00 server postfix/smtpd[32565]: Anonymous TLS connection established from asusair[192.168.1.7]: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
2013-06-09T10:28:25.097257+02:00 server postfix/smtpd[32565]: warning: TLS library problem: 32565:error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate:s3_pkt.c:1256:SSL alert number 42:

muell200
09.06.13, 11:21
Sorry, vergessen:

2013-06-09T10:25:50.163347+02:00 server postfix/smtpd[32402]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory



steht doch da...
saslauthd laeuft nicht

ThyMaster
09.06.13, 15:37
Doch, SASL läuft, aber nicht chroot'ed :ugly:
Hab in der master.cf die Flages für smtp und smtps auf nicht chrooted gesetzt und es funzt.

Aber ich würde aus Sicherheitsgründen das gerne wieder in chroot ändern.
Weiß jemand wie?

TIA
- ThyMaster

spychodelics
09.06.13, 18:21
damits sasl im chroot läuft muss der pfad stimmten, und die rechte auf die "datei" stimmen.

demo configs kannst du getrost vergessen, da das von system zu system mit paketversion zu paketversion unterschiedlich ist.

ThyMaster
09.06.13, 21:13
Danke für alle Antwort, hier meine Lösung:

Einen symbolischen Link von /var/run/sasl2/ auf /var/spool/postfix/var/run/sasl2 erstellen.

- ThyMaster