213 lines
8.0 KiB
Plaintext
213 lines
8.0 KiB
Plaintext
== 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 [[w:de:Postfix (Mail Transfer Agent)|Postfix]] als [[w:de:Mail Transfer Agent|MTA]] und [[w:de:Dovecot|Dovecot]] als [[w:de:Mail Delivery Agent|MDA]].
|
|
|
|
== Mail-Adressen verwalten ==
|
|
|
|
=== Mail-Adresse hinzufügen ===
|
|
|
|
Wer eine Mail-Adresse %<code>@c3d2.de</code> haben möchte, kann sich an Admins wenden, um einen virtuellen Account anlegen zu lassen.
|
|
|
|
==== virtuelle user anlegen ====
|
|
|
|
In dem Ordner <code>/root/wetuscripts/mail/bin</code> (oder im [https://git.c3d2.de/cgit.cgi/wetuscripts/tree/mail/bin/ git]) liegt die Datei <code>create_vmail_user</code>. Wenn man sie ausführt, hilft sie selbsterklärend dabei einen virtuellen Account anzulegen. Da der Ordner <code>/root/wetuscripts/mail/bin</code> in <code>export PATH</code> steht kann <source lang="bash">create_vmail_user</source> auch einfach ausgeführt werden, ohne den langen Pfad zu kennen.
|
|
|
|
=== Passwort zum Mail-Account ändern ===
|
|
|
|
Accounts mit einer Mail-Adressen können das Passwort per <code>ssh user@mail.c3d2.de</code> ändern.
|
|
|
|
== Konfiguration ==
|
|
|
|
=== Postfix ===
|
|
|
|
Konfigurationsdateien für Postfix liegen in <code>/etc/postfix/</code>. Grundsätzlich können alle Konfigurationparameter in der [http://www.postfix.org/postconf.5.html Dokumentation von Postfix] nachgelesen werden. Nachfolgend soll nur auf Besonderheiten in unserer Konfiguration eingegangen werden.
|
|
|
|
==== main.cf ====
|
|
|
|
* in der Option <code>relay_domains</code> neben <code>$mydestination</code> auch <code>lists.c3d2.de</code> eintragen
|
|
* Um für [[Wetu/Mailman|Mailman]] Funktionalität herzustellen, muss im Eintrag <code>relay_recipient_maps</code> <code>hash:/var/lib/mailman/data/virtual-mailman</code> eingetragen werden.
|
|
* <code>smtpd_banner</code> ist ein Scherz.
|
|
* Um Bots, Spammern und Ähnlichen das Leben schwer zu machen, werden die folgenden Optionen verwendet:
|
|
<pre>
|
|
smtpd_error_sleep_time = 20
|
|
smtpd_soft_error_limit = 1
|
|
smtpd_hard_error_limit = 3
|
|
smtpd_junk_command_limit = 2
|
|
</pre>
|
|
* Da der c3d2 ein Netzwerk aus Rechnern betriebt, ist das auch hier zu berücksichtigen. Dazu setze man <code>mynetworks_style = subnet</code>. In <code>mynetwork</code> sind dann alle vom mailserver zu verwaltenden Netze einzutragen, welches momentan <code>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</code> sind.
|
|
|
|
===== Daemon-Einstellungen =====
|
|
|
|
Folgendes sind die grundlegenden Einstellungen für den Postfix-Daemon:
|
|
<pre>
|
|
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
|
|
</pre>
|
|
|
|
*: Dabei gibt <code>home_mailbox</code>
|
|
*:* den Namen und gleichzeitig
|
|
*:* den Typ der Mailbox im Nutzerverzeichnis des Empfängers
|
|
*: an.
|
|
|
|
===== SSL Konfiguration =====
|
|
|
|
<pre>
|
|
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
|
|
</pre>
|
|
|
|
===== TLS Konfiguration =====
|
|
|
|
<pre>
|
|
tls_random_source = dev:/dev/urandom
|
|
|
|
### mail - server to server
|
|
smtp_tls_cert_file = /etc/postfix/ssl/server.crt
|
|
smtp_tls_key_file = /etc/postfix/ssl/server.key
|
|
|
|
smtp_tls_note_starttls_offer = yes
|
|
smtp_use_tls = yes
|
|
|
|
### _mandatory gilt fuer security_level = encrypt / _OHNE_mandatory gilt fuer security_level = may
|
|
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
|
|
smtp_tls_protocols = TLSv1, TLSv1.1, Tlsv1.2, !SSLv2, !SSLv3
|
|
|
|
smtp_tls_loglevel = 1
|
|
|
|
|
|
### mail - client to server
|
|
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
|
|
smtpd_tls_key_file = /etc/postfix/ssl/server.key
|
|
#smtpd_tls_CAfile = /etc/postfix/ssl/class3.crt
|
|
|
|
smtpd_use_tls = yes
|
|
smtpd_tls_auth_only = yes
|
|
smtpd_tls_security_level = may
|
|
|
|
smtpd_tls_received_header = yes
|
|
smtpd_tls_session_cache_timeout = 3600s
|
|
|
|
### _mandatory gilt fuer security_level = encrypt / _OHNE_mandatory gilt fuer security_level = may
|
|
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
|
|
smtpd_tls_protocols = TLSv1, TLSv1.1, Tlsv1.2, !SSLv2, !SSLv3
|
|
|
|
smtpd_tls_loglevel = 1
|
|
</pre>
|
|
|
|
<pre>
|
|
### smtpd security_level = MUSS may sein! ###
|
|
### --- sonst kann sich Amavis nicht connecten ###
|
|
### --- können NICHT-TLS fähige Mailserver Mails nicht zustellen ###
|
|
###
|
|
### From MTA(smtp:[127.0.0.1]:10025) during fwd-rundown-1 (Negative SMTP response to RSET: 530 5.7.0 Must issue a STARTTLS command first at
|
|
### Blocked MTA-BLOCKED {RejectedInbound} proxy-reject: END-OF-MESSAGE: 530 5.7.0 - Rejected by next-hop MTA on relaying, from MTA(smtp:[127.0.0.1]:10025): 530 5.7.0 Must issue a STARTTLS command first
|
|
###
|
|
#smtpd_tls_security_level = may
|
|
</pre>
|
|
|
|
===== SSL Cipher Suites Supported =====
|
|
|
|
Postfix:
|
|
<pre>
|
|
Testing ECDHE-RSA-AES256-GCM-SHA384...YES
|
|
Testing ECDHE-RSA-AES256-SHA384...YES
|
|
Testing ECDHE-RSA-AES256-SHA...YES
|
|
Testing DHE-RSA-AES256-GCM-SHA384...YES
|
|
Testing DHE-RSA-AES256-SHA256...YES
|
|
Testing DHE-RSA-AES256-SHA...YES
|
|
Testing DHE-RSA-CAMELLIA256-SHA...YES
|
|
Testing AES256-GCM-SHA384...YES
|
|
***Testing AES256-SHA256...YES
|
|
***Testing AES256-SHA...YES
|
|
***Testing CAMELLIA256-SHA...YES
|
|
Testing ECDHE-RSA-AES128-GCM-SHA256...YES
|
|
Testing ECDHE-RSA-AES128-SHA256...YES
|
|
Testing ECDHE-RSA-AES128-SHA...YES
|
|
Testing DHE-RSA-AES128-GCM-SHA256...YES
|
|
Testing DHE-RSA-AES128-SHA256...YES
|
|
Testing DHE-RSA-AES128-SHA...YES
|
|
Testing DHE-RSA-CAMELLIA128-SHA...YES
|
|
Testing AES128-GCM-SHA256...YES
|
|
***Testing AES128-SHA256...YES
|
|
***Testing AES128-SHA...YES
|
|
***Testing CAMELLIA128-SHA...YES
|
|
</pre>
|
|
|
|
Dovecot:
|
|
<pre>
|
|
Testing DHE-RSA-AES256-GCM-SHA384...YES
|
|
Testing DHE-RSA-AES256-SHA...YES
|
|
***Testing AES256-SHA...YES
|
|
</pre>
|
|
|
|
<pre>
|
|
*** für Kompatibilität mit Microsoft Outlook & Co. / Clients mit OpenSSL < 0.9.8
|
|
</pre>
|
|
|
|
==== virtual ====
|
|
|
|
In der virtual sind alle Weiterleitungen / Aliase konfiguriert. Wenn diese geändert wird, muss anschließend <source lang="bash">postmap /etc/postfix/virtual</source> ausgeführt werden.
|
|
|
|
=== Dovecot ===
|
|
|
|
==== dovecot.conf ====
|
|
|
|
<pre>
|
|
disable_plaintext_auth = yes
|
|
ssl = required
|
|
|
|
ssl_cipher_list = ECDHE-RSA-AES256-GCM-SHA384:ECDH-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDH-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA:AES256-SHA
|
|
|
|
log_timestamp = "%Y-%m-%d %H:%M:%S "
|
|
|
|
### für protocol imap / pop3 ###
|
|
{
|
|
mail_max_userip_connections = 99
|
|
}
|
|
</pre>
|
|
|
|
==== TEST: telnet pass plain login credentials ====
|
|
|
|
Sollte LOGINDISABLED sein!
|
|
|
|
<pre>
|
|
telnet mail.c3d2.de 143
|
|
Connected to mail.c3d2.de.
|
|
Escape character is '^]'.
|
|
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS LOGINDISABLED AUTH=GSSAPI] Dovecot ready.
|
|
</pre>
|
|
|
|
[[Kategorie:Infrastruktur]]
|