User Tools

Site Tools


opensmtpd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
opensmtpd [2021/02/11 11:39] adminopensmtpd [2023/12/13 19:17] (current) admin
Line 3: Line 3:
 Installieren mit: Installieren mit:
  
-<code>apt install opensmtpd opensmtpd-filter-senderscore</code>+<code>apt install opensmtpd opensmtpd-filter-senderscore mariadb-client mariadb-server</code>
  
 Dann die Datei /etc/smtpd.conf anpassen. Meine sieht jetzt so aus: Dann die Datei /etc/smtpd.conf anpassen. Meine sieht jetzt so aus:
  
 +<code>
 +pki "mail.domain.tld" cert "/etc/letsencrypt/live/mail.domain.tld/fullchain.pem"
 +pki "mail.domain.tld" key "/etc/letsencrypt/live/mail.domain.tld/privkey.pem"
 +srs key "lassdirwasschöneseinfallenhier"
 +
 +# internal aliases to root
 +table aliases file:/etc/mail/aliases
 +
 +# External Mails in Database vmail
 +table domains mysql:/etc/mail/mysql.conf
 +table virtuals mysql:/etc/mail/mysql.conf
 +table credentials mysql:/etc/mail/mysql.conf
 +
 +filter check_rdns phase connect match !rdns \
 +    disconnect "550 no rDNS"
 +
 +filter senderscore \
 +    proc-exec "filter-senderscore -junkBelow 70 -slowFactor 5000"
 +
 +filter rspamd proc-exec "filter-rspamd"
 +
 +listen on eth0 tls pki mail.domain.tld filter { senderscore, rspamd, check_rdns }
 +listen on eth0 port 465 smtps pki mail.domain.tld auth <credentials> filter { rspamd }
 +listen on eth0 port 587 tls-require pki mail.domain.tld auth <credentials> filter { rspamd }
 +
 +action "local_mail" mbox alias <aliases>
 +action "domain_mail" maildir "/var/vmail/%{dest.domain:lowercase}/%{dest.user:lowercase}" virtual <virtuals>
 +action "outbound" relay
 +action "RECV" lmtp "/var/run/dovecot/lmtp" rcpt-to virtual <virtuals>
 +
 +# match from any for domain <domains> action "domain_mail"
 +match from any for domain <domains> action "RECV"
 +match from local for local action "local_mail"
 +
 +match from local for any action "outbound"
 +match auth from any for any action "outbound"
 +</code>
 +
 +Die oben erwähnte /etc/mail/mysql.conf sieht bei mir folgendermasen aus, das muss man dann eben auf sein Datenbankschema anpassen, aber zum dokumentieren der Syntax einmal hier:
 +
 +<code>
 +host            localhost
 +username        vmail
 +password        DatenbankPasswort
 +database        vmail
 +
 +query_alias SELECT destination FROM virtuals WHERE email=?;
 +query_credentials SELECT user, password FROM credentials WHERE user=?;
 +query_domain SELECT domain FROM domains WHERE domain=?;
 +
 +</code>
  
  
opensmtpd.1613043540.txt.gz · Last modified: 2021/02/11 11:39 by admin

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki