Postfix/Dovecot ohne LDAP: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 7: Zeile 7:
   -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
   -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
</pre>
</pre>
==/etc/postfix/maind.cf anfügen==
==/etc/postfix/main.cf anfügen==
<pre>
<pre>
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
Zeile 13: Zeile 13:
append_dot_mydomain = no
append_dot_mydomain = no
readme_directory = no
readme_directory = no
maillog_file = /var/log/mail.log


# TLS-Einstellungen
# TLS-Einstellungen
Zeile 24: Zeile 25:


# SMTP-Einstellungen
# SMTP-Einstellungen
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
#smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
myhostname = mail.lab34.linuggs.de
myhostname = mail.lab34.linuggs.de
alias_maps = hash:/etc/aliases
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
myorigin = /etc/mailname
mydestination = $myhostname, localhost.localdomain, localhost
mydestination = $myhostname, localhost.localdomain, localhost, lab34.linuggs.de
relayhost =
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
Zeile 37: Zeile 38:
inet_protocols = all
inet_protocols = all


# Mailbox-Speicherort
home_mailbox = mbox


# SASL-Authentifizierung mit Dovecot
# SASL-Authentifizierung mit Dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
 




</pre>
</pre>
=Dovecot=
=Dovecot=
== Dovecot-Konfiguration für SASL und TLS auf Port 993 ==
== Dovecot-Konfiguration für SASL und TLS auf Port 993 ==


=== 1. Dovecot-Konfiguration ===
=== Dovecot-Konfiguration ===
* Öffne die Datei <code>/etc/dovecot/conf.d/10-ssl.conf</code> und füge hinzu:
* Öffne die Datei <code>/etc/dovecot/conf.d/10-ssl.conf</code> und füge hinzu:
  <pre>
  <pre>
Zeile 58: Zeile 60:
</pre>
</pre>


=== 2. Mail Location ===
=== Mail Location ===
* Öffne die Datei <code>/etc/dovecot/conf.d/10-mail.conf</code> und stelle sicher, dass folgende Zeile vorhanden ist:
* Öffne die Datei <code>/etc/dovecot/conf.d/10-mail.conf</code> und stelle sicher, dass folgende Zeile vorhanden ist:
  <pre>
  <pre>
Zeile 64: Zeile 66:
</pre>
</pre>


=== 3. Authentifizierung ===
=== Authentifizierung ===
* Öffne die Datei <code>/etc/dovecot/conf.d/10-auth.conf</code> und füge hinzu:
* Öffne die Datei <code>/etc/dovecot/conf.d/10-auth.conf</code> und füge hinzu:
  <pre>
  <pre>
Zeile 70: Zeile 72:
</pre>
</pre>


=== 4. Master-Konfiguration ===
=== Master-Konfiguration ===
* Öffne die Datei <code>/etc/dovecot/conf.d/10-master.conf</code> und füge hinzu:
* Öffne die Datei <code>/etc/dovecot/conf.d/10-master.conf</code> und füge hinzu:
  <pre>
  <pre>
Zeile 80: Zeile 82:
   }
   }
}
}
</pre>
=== 5. Dienste neu starten ===
* Starte Dovecot neu:
<code>sudo systemctl restart dovecot</code>
</pre>
=== Auth-Mechanismen ===
* Öffne die Datei <code>/etc/dovecot/conf.d/10-auth.conf</code> und stelle sicher, dass folgende Zeile vorhanden ist:
<pre>
auth_mechanisms = plain login
</pre>
</pre>


=== Dienste neu starten ===
=== Dienste neu starten ===
* Starte Dovecot neu:
* Starte Dovecot und Postfix neu:
  <code>sudo systemctl restart dovecot</code>
  <code>sudo systemctl restart dovecot postfix</code>
 
=== Testen ===
* Teste die Verbindung auf Port 993 mit einem E-Mail-Client.

Aktuelle Version vom 5. Oktober 2024, 12:53 Uhr

Postfix

/etc/postfix/master.cf anfügen

smtps     inet  n       -       y       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject

/etc/postfix/main.cf anfügen

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
maillog_file = /var/log/mail.log

# TLS-Einstellungen
smtpd_tls_cert_file = /etc/ssl/certs/star.lab34.linuggs.de.crt
smtpd_tls_key_file = /etc/ssl/private/star.lab34.linuggs.de.key
smtpd_tls_security_level = may
smtpd_tls_received_header = yes
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# SMTP-Einstellungen
#smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination
myhostname = mail.lab34.linuggs.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.localdomain, localhost, lab34.linuggs.de
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all


# SASL-Authentifizierung mit Dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination



Dovecot

Dovecot-Konfiguration für SASL und TLS auf Port 993

Dovecot-Konfiguration

  • Öffne die Datei /etc/dovecot/conf.d/10-ssl.conf und füge hinzu:
ssl = yes
ssl_cert = </etc/ssl/certs/star.lab34.linuggs.de.crt
ssl_key = </etc/ssl/private/star.lab34.linuggs.de.key

Mail Location

  • Öffne die Datei /etc/dovecot/conf.d/10-mail.conf und stelle sicher, dass folgende Zeile vorhanden ist:
mail_location = mbox:~/mbox:INBOX=/var/mail/%u

Authentifizierung

  • Öffne die Datei /etc/dovecot/conf.d/10-auth.conf und füge hinzu:
auth_mechanisms = plain login

Master-Konfiguration

  • Öffne die Datei /etc/dovecot/conf.d/10-master.conf und füge hinzu:
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
  }
}

Dienste neu starten

  • Starte Dovecot und Postfix neu:
sudo systemctl restart dovecot postfix