Server/wetu/mail

Aus C3D2
Zur Navigation springen Zur Suche springen

Allgemein

Die Mail-Infrastruktur des c3d2 dient, wie man sich denken kann, der Kommunikation sowohl untereinander als auch nach außen.

Obwohl es sich von außen betrachtet nur um eine Funktionalität handelt, sind trotzdem mehrere Dienste notwendig, um diese auch herzustellen. In unserem speziellen Fall ist es Postfix als MTA und Dovecot als MDA.

virtuelle user anlegen

In dem Ordner /root/wetuscripts/mail/bin liegt eine Datei create_vmail_user, die, wenn man sie ausführt, selbsterklärend dabei hilft einen Virtuellen Benutzer anzulegen. Da der Ordner /root/wetuscripts/mail/bin in export PATH steht kann

create_vmail_user

auch einfach ausgeführt werden ohne den langen Pfad zu kennen.

Konfiguration

Postfix

Konfigurationsdateien für Postfix liegen in /etc/postfix/. Grundsätzlich können alle Konfigurationparameter in der Dokumentation von Postfix nachgelesen werden. Nachfolgend soll nur auf Besonderheiten in unserer Konfiguration eingegangen werden.

main.cf

  • in der Option relay_domains neben $mydestination auch lists.c3d2.de eintragen
  • Um für Mailman Funktionalität herzustellen, muss im Eintrag relay_recipient_maps hash:/var/lib/mailman/data/virtual-mailman eingetragen werden.
  • smtpd_banner ist ein Scherz.
  • Um Bots, Spammern und Ähnlichen das Leben schwer zu machen, werden die folgenden Optionen verwendet:
smtpd_error_sleep_time = 20
smtpd_soft_error_limit = 1
smtpd_hard_error_limit = 3
smtpd_junk_command_limit = 2
  • Da der c3d2 ein Netzwerk aus Rechnern betriebt, ist das auch hier zu berücksichtigen. Dazu setze man mynetworks_style = subnet. In mynetwork sind dann alle vom mailserver zu verwaltenden Netze einzutragen, welches momentan 127.0.0.0/8 89.238.79.216/29 89.238.64.140/32 172.22.98.0/24 [::1]/128 [fe80::]/10 [2a00:1828:2000:655::]/64 [2a00:1828:a008::]/48 sind.
Daemon-Einstellungen

folgendes sind die grundlegenden Einstellungen für den Postfix-Daemon

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
setgid_group = postdrop
home_mailbox = .maildir/                                                           
smtpd_banner = $myhostname ESMTP Ia! Ia! Cthulhu Fthagn!
debug_peer_level = 2 
biff = no
mail_spool_directory = /var/mail
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mailbox_command = /usr/lib/dovecot/deliver
defer_transports =
mailbox_size_limit = 0 
message_size_limit = 10240000
  • home_mailbox gibt den Namen und gleichzeitig den Typ der Mailbox im Nutzerverzeichnis des Empfängers


SSL Konfiguration
smtp_sasl_auth_enable = no                                                         
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_authenticated_header = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
TLS Konfiguration
#smtpd_tls_CAfile    = /etc/postfix/ssl/class3.crt
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_key_file  = /etc/postfix/ssl/server.key
smtp_tls_cert_file = /etc/postfix/ssl/server.crt
smtp_tls_key_file  = /etc/postfix/ssl/server.key
#smtpd_tls_loglevel = 1
smtpd_use_tls = yes
#smtpd_tls_auth_only = yes
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_tls_auth_only = no
# tls cipher and protocol
#smtpd_tls_security_level = encrypt
smtpd_tls_ciphers = high
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_exclude_ciphers = MEDIUM, LOW, aNULL, eNULL, SEED, 3DES, DES, MD5, EXP, CBC, PSD, PSK, SRP, DSS, RC4
smtpd_tls_exclude_ciphers = MEDIUM, LOW, aNULL, eNULL, SEED, 3DES, DES, MD5, EXP, CBC, PSD, PSK, SRP, DSS, RC4
smtpd_tls_mandatory_protocols = TLSv1, TLSv1.1, Tlsv1.2, !SSLv2, !SSLv3


smtp_tls_mandatory_exclude_ciphers = MEDIUM, LOW, aNULL, eNULL, SEED, 3DES, DES, MD5, EXP, CBC, PSD, PSK, SRP, DSS, RC4
smtp_tls_exclude_ciphers = MEDIUM, LOW, aNULL, eNULL, SEED, 3DES, DES, MD5, EXP, CBC, PSD, PSK, SRP, DSS, RC4
smtp_tls_mandatory_protocols = TLSv1, TLSv1.1, Tlsv1.2, !SSLv2, !SSLv3
smtp_tls_ciphers = high
smtp_tls_mandatory_ciphers = high

smtp_tls_security_level = may

virtual

In der virtual sind alle Weiterleitungen / Aliase konfiguriert. Wenn diese geändert wird, muss anschließend

postmap /etc/postfix/virtual

ausgeführt werden.