Grundkonfiguration Postfix

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Vorbereitungen

  • mkdir -p /etc/skel/Maildir/{cur,new,tmp}

Installation

  • apt-get install postfix dovecot-core dovecot-imapd

Grundkonfiguration

  • dpkg-reconfigure -p low postfix
 ; Wir wählen Internet-Site

Postfix-Hauptkonfiguration

  • vi /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
...

Maildir-Format

  • In der Datei /etc/postfix/main.cf setzen:
home_mailbox = Maildir/
mailbox_command =

Wichtige Postfix-Kommandos

  • postfix status
  • postfix start
  • postfix stop
  • postfix reload
  • postfix check

Logging

  • tail -f /var/log/mail.log
Dec 11 13:20:55 maria postfix/smtpd[7513]: connect from ...

Installation von Mailutils

  • apt-get install mailutils

Lokales Lesen von Mails

mario@maria:~$ mail
"/var/mail/mario": 5 messages 5 unread
...

Authentifizierung mit SASL

Dovecot für SASL konfigurieren

  • vi /etc/dovecot/conf.d/10-master.conf
service auth {
   unix_listener /var/spool/postfix/private/auth {
      mode = 0660
      user = postfix
      group = postfix
   }
}
  • vi /etc/dovecot/conf.d/10-auth.conf
auth_mechanisms = plain login

Postfix-Konfiguration für SASL

  • vi /etc/postfix/main.cf
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

Neustart der Dienste

  • systemctl restart postfix
  • systemctl restart dovecot

Verschlüsselung mit TLS/SSL

SSL-Zertifikate hinterlegen

  • mkdir /etc/postfix/ssl
  • cp /root/xin-ca.crt /etc/postfix/ssl
  • cp /root/xin-ca-maria.xinux.org.crt /etc/postfix/ssl
  • cp /root/xin-ca-maria.xinux.org.key /etc/postfix/ssl

Postfix TLS-Konfiguration

  • vi /etc/postfix/main.cf
smtpd_use_tls = yes
smtpd_tls_received_header = no
smtpd_tls_key_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.key
smtpd_tls_cert_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.crt
smtpd_tls_CA_file = /etc/postfix/ssl/xin-ca.crt
smtp_use_tls = yes
smtp_tls_key_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.key
smtp_tls_cert_file = /etc/postfix/ssl/xin-ca-maria.xinux.org.crt
smtp_tls_CA_file = /etc/postfix/ssl/xin-ca.crt