| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| computing:mailserver-trixie [2026/06/15 22:43] – oemb1905 | computing:mailserver-trixie [2026/07/28 19:52] (current) – oemb1905 |
|---|
| ------------------------------------------- | ------------------------------------------- |
| |
| * [[https://nextcloud.haacksnetworking.org/index.php/s/s6wAL5p7jKHc9Db|Slides]] | * [[https://cloud.haacksnetworking.org/index.php/s/P255xsGX37We4BS|Slides]] |
| * [[https://content.haacksnetworking.org/w/nsMwnJhLnfMrs17W5cAdWg|SeaGL Presentation]] | * [[https://content.haacksnetworking.org/w/erLgeVDEdeUf84FXq2Xk4f|SeaGL Presentation]] |
| * [[https://tech.haacksnetworking.org/2025/06/10/your-email-your-rules-self-hosting-simplified/|Blog Post]] | * [[https://tech.haacksnetworking.org/2025/06/10/your-email-your-rules-self-hosting-simplified/|Blog Post]] |
| |
| #spf incoming policy and recipient restrictions\ | #spf incoming policy and recipient restrictions\ |
| policyd-spf_time_limit = 3600\ | policyd-spf_time_limit = 3600\ |
| smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service unix:private/policyd-spf | smtpd_recipient_restrictions = |
| | permit_mynetworks, |
| | permit_sasl_authenticated, |
| | reject_unauth_destination, |
| | reject_non_fqdn_recipient, |
| | reject_unknown_recipient_domain, |
| | check_policy_service unix:private/policyd-spf |
| </code> | </code> |
| |
| reject_unauthenticated_sender_login_mismatch, | reject_unauthenticated_sender_login_mismatch, |
| reject_sender_login_mismatch, | reject_sender_login_mismatch, |
| | check_sender_access hash:/etc/postfix/sender_access, |
| permit | permit |
| </code> | </code> |
| | |
| | The sender_access file is super helpful for repeat offenders. Sure, you can also just blacklist those in sieve rules, but that means that they still arrive and fill up your Junk folder. In some cases, spammers will send 100s of the same message per day. In those cases, it is helpful to stop them at the gates with postfix's sender_access: |
| | |
| | nano /etc/postfix/sender_access |
| | <spam@domain.com REJECT> #block exact email |
| | <domain.com REJECT> #block all users @domain.com |
| | <.domain.com REJECT> #block all users @sub.domain.com |
| | sudo postmap /etc/postfix/sender_access |
| | sudo postfix reload |
| | sudo systemctl restart postfix |
| |
| Now that the SPF/recipient and PTRI am now going to set up the DKIM policy for incoming email but/and, I will also use the same package to cut a DKIM keypair for use with the server's outgoing email. First, I install the policy and add opendkim to the postfix group. | Now that the SPF/recipient and PTRI am now going to set up the DKIM policy for incoming email but/and, I will also use the same package to cut a DKIM keypair for use with the server's outgoing email. First, I install the policy and add opendkim to the postfix group. |
| } | } |
| # rule:[spamcheck] | # rule:[spamcheck] |
| if anyof (header :contains "x-spam-status" "Yes", header :contains "x-spam-flag" "YES", header :contains "x-spam-level" "*****") | if anyof (header :matches "x-spam-status" "Yes", header :contains "x-spam-flag" "YES", header :contains "x-spam-level" "*****") |
| { | { |
| fileinto "Junk"; | fileinto "Junk"; |
| I rewrote the mail server tutorial for the presentation [[https://tech.haacksnetworking.org/2025/06/10/your-email-your-rules-self-hosting-simplified/|Your Email, Your Rules: Self-Hosting Simplified]]. The SeaGL presentation can be found [[https://pretalx.seagl.org/2025/talk/VLM7AS/|on their calendar]]. | I rewrote the mail server tutorial for the presentation [[https://tech.haacksnetworking.org/2025/06/10/your-email-your-rules-self-hosting-simplified/|Your Email, Your Rules: Self-Hosting Simplified]]. The SeaGL presentation can be found [[https://pretalx.seagl.org/2025/talk/VLM7AS/|on their calendar]]. |
| |
| --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/05/31 05:13// | --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/07/28 19:51// |