User Tools

Site Tools


computing:mailserver

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
computing:mailserver [2025/05/02 17:10] oemb1905computing:mailserver [2025/11/05 01:56] (current) oemb1905
Line 187: Line 187:
    reject_unauth_destination,    reject_unauth_destination,
    check_policy_service unix:private/policyd-spf    check_policy_service unix:private/policyd-spf
 +
 +You also need to make sure that your spf policy is not set to reject emails by default. 
 +
 +  nano /etc/postfix-policyd-spf-python/policyd-spf.conf
 +  
 +Make sure that ''Fail'' is changed to ''False'' for the top two entries. The policy will ensure that those spf violations are logged, but the change to False ensures no email is lost as a result. 
 +
 +  HELO_reject = False
 +  Mail_From_reject = False
  
 Now, it is time to set up DKIM on your server. After creating the DKIM record/key on your server, you will need to create a corresponding TXT record for it to establish that anything over smtp with that signature is, in fact, you/your server. Let's install opendkim with ''sudo apt install opendkim opendkim-tools'' and add postfix to its group with ''sudo adduser postfix opendkim'' and then adjust the configuration in ''sudo nano /etc/opendkim.conf'' as follows: Now, it is time to set up DKIM on your server. After creating the DKIM record/key on your server, you will need to create a corresponding TXT record for it to establish that anything over smtp with that signature is, in fact, you/your server. Let's install opendkim with ''sudo apt install opendkim opendkim-tools'' and add postfix to its group with ''sudo adduser postfix opendkim'' and then adjust the configuration in ''sudo nano /etc/opendkim.conf'' as follows:
Line 256: Line 265:
   AuthservID OpenDMARC   AuthservID OpenDMARC
   TrustedAuthservIDs mail.yourdomain.com   TrustedAuthservIDs mail.yourdomain.com
-  RejectFailures true+  RejectFailures false #track only, do not stop at gate
   IgnoreAuthenticatedClients true   IgnoreAuthenticatedClients true
   RequireHeaders true   RequireHeaders true
Line 561: Line 570:
   postsuper -d E900C4780073   postsuper -d E900C4780073
   postsuper -d ALL   postsuper -d ALL
-   
-These tools prove helpful if/when emails get stuck, etc. 
  
- --- //[[alerts@haacksnetworking.org|oemb1905]] 2025/05/02 17:01//+These tools prove helpful if/when emails get stuck, etc. Here are the Trixie adjustments: 
 + 
 +This tutorial is for users of Debian GNU/Linux who want to set up a proper email server. This particular version is a work in progress and will contain adjustments needed for Trixie. So far, I've found the following differences: 
 + 
 +  # Editing authentication settings 
 +  sudo nano /etc/dovecot/conf.d/10-auth.conf 
 +  auth_username_format = %{user|username|lower} 
 +  #auth_username_format = %n 
 +  # Editing mailbox location settings 
 +  sudo nano /etc/dovecot/conf.d/10-mail.conf 
 +  mail_driver = maildir 
 +  mail_path = ~/Maildir 
 +  mail_inbox_path = ~/Maildir/.INBOX 
 +  #old one was 
 +  #mail_location = mbox:~/mail:INBOX=/var/mail/%u 
 +  #mail_location = maildir:~/Maildir 
 +  # Editing SSL/TLS settings 
 +  sudo nano /etc/dovecot/conf.d/10-ssl.conf 
 +  #new format for cert and key, longer name, removes the classic “<” character 
 +  ssl_server_cert_file = /etc/letsencrypt/live/mail.domain.com/fullchain.pem 
 +  ssl_server_key_file = /etc/letsencrypt/live/mail.domain.com/privkey.pem 
 +  #ssl_prefer_server_ciphers = yes 
 +  #comment out diffy helman, now deprecated 
 +  #ssl_server_dh_file = /etc/dovecot/dh.pem 
 +  # Editing Sieve filter settings 
 +  sudo nano /etc/dovecot/conf.d/90-sieve.conf 
 +  #updating where dovecot looks for sieve rules by default, new format 
 +  sieve_script personal { 
 +    driver = file 
 +    path = ~/sieve 
 +    active_path = ~/.dovecot.sieve 
 +  } 
 +  #old one was 
 +  #plugin {  
 +  #sieve = file:~/sieve;active=~/.dovecot.sieve 
 +  #} 
 +  # Editing main Dovecot configuration 
 +  sudo nano /etc/dovecot/dovecot.conf 
 +  #declare versions 
 +  dovecot_storage_version = 2.4.1 
 +  dovecot_config_version = 2.4 
 +  #comment out dictionary (unless you set it up) 
 +  #dict { 
 +  #  quota = file:/var/lib/dovecot/quota 
 +  #} 
 + 
 +In May 2025, the Validity RBL switched to a locked model, so you need to disable queries to it in spamassassin by editing ''sudo nano /etc/spamassassin/local.cf'' and putting the following restrictions underneath ''dns_server 127.0.0.1'' and then comment out the VALIDITY scoring rule. 
 + 
 +  dns_query_restriction deny bl.score.senderscore.com 
 +  dns_query_restriction deny sa-accredit.habeas.com 
 +  dns_query_restriction deny sa-trusted.bondedsender.org 
 +  #score RCVD_IN_VALIDITY_RPBL             5.0 
 + 
 +The new tutorial embeds the Trixie adjustments inside the tutorial in addition to being a complete re-organization and rewrite of the mail server tutorial. You can view the new tutorial over here at [[https://wiki.haacksnetworking.org/doku.php?id=computing:mailserver-trixie|Mail Server Trixie]]. 
 + 
 + --- //[[alerts@haacksnetworking.org|oemb1905]] 2025/11/05 01:54//
computing/mailserver.1746205858.txt.gz · Last modified: by oemb1905