This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:mailserver [2025/04/23 20:55] – oemb1905 | computing:mailserver [2025/11/05 01:56] (current) – oemb1905 | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| ------------------------------------------- | ------------------------------------------- | ||
| - | This tutorial is for users of Debian GNU/Linux who want to set up a proper email server.. This tutorial assumes you know how to set up A, AAAA, SPF, DKIM, DMARC, MX, and PTR records. Set an A record for example.org and mail.example.org. If you don't know how, then learn up, and do not proceed. //Thanks to LinuxBabe for a great jumping off point//. Let's begin by editing our hosts file '' | + | This tutorial is for users of Debian GNU/Linux who want to set up a proper email server.. This tutorial assumes you know how to set up A, AAAA, SPF, DKIM, DMARC, MX, and PTR records. Set an A record for example.org and mail.example.org |
| 127.0.1.1 example.org example | 127.0.1.1 example.org example | ||
| Line 187: | Line 187: | ||
| | | ||
| | | ||
| + | |||
| + | You also need to make sure that your spf policy is not set to reject emails by default. | ||
| + | |||
| + | nano / | ||
| + | | ||
| + | Make sure that '' | ||
| + | |||
| + | 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 '' | 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 '' | ||
| Line 256: | Line 265: | ||
| AuthservID OpenDMARC | AuthservID OpenDMARC | ||
| TrustedAuthservIDs mail.yourdomain.com | TrustedAuthservIDs mail.yourdomain.com | ||
| - | RejectFailures | + | RejectFailures |
| IgnoreAuthenticatedClients true | IgnoreAuthenticatedClients true | ||
| RequireHeaders true | RequireHeaders true | ||
| Line 479: | Line 488: | ||
| nano / | nano / | ||
| < | < | ||
| + | |||
| + | To setup autodiscovery, | ||
| + | |||
| + | _imap._tcp | ||
| + | _submission._tcp | ||
| + | _imaps._tcp | ||
| + | _submissions._tcp | ||
| + | _autodiscover._tcp | ||
| + | autodiscover | ||
| + | autodiscover | ||
| + | |||
| + | After that, setup your '' | ||
| + | |||
| + | sudo nano / | ||
| | | ||
| - | To check record health after you set your DNS records, you can do the following: | + | Inside that file, enter something similar to this entry below, obviously adjusting for your priority, weight, and desired client configuration behavior: |
| + | |||
| + | <?xml version=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Pretty much everything one needs is now setup. | ||
| | | ||
| dig txt +short _dmarc.jonathanhaack.com | dig txt +short _dmarc.jonathanhaack.com | ||
| Line 503: | Line 570: | ||
| postsuper -d E900C4780073 | postsuper -d E900C4780073 | ||
| postsuper -d ALL | postsuper -d ALL | ||
| - | | ||
| - | These tools prove helpful if/when emails get stuck, etc. | ||
| - | --- // | + | 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 / | ||
| + | auth_username_format = %{user|username|lower} | ||
| + | # | ||
| + | # Editing mailbox location settings | ||
| + | sudo nano / | ||
| + | mail_driver = maildir | ||
| + | mail_path = ~/Maildir | ||
| + | mail_inbox_path = ~/ | ||
| + | #old one was | ||
| + | # | ||
| + | # | ||
| + | # Editing SSL/TLS settings | ||
| + | sudo nano / | ||
| + | #new format for cert and key, longer name, removes the classic “<” character | ||
| + | ssl_server_cert_file = / | ||
| + | ssl_server_key_file = / | ||
| + | # | ||
| + | #comment out diffy helman, now deprecated | ||
| + | # | ||
| + | # Editing Sieve filter settings | ||
| + | sudo nano / | ||
| + | #updating where dovecot looks for sieve rules by default, new format | ||
| + | sieve_script personal { | ||
| + | driver = file | ||
| + | path = ~/sieve | ||
| + | active_path = ~/ | ||
| + | } | ||
| + | #old one was | ||
| + | #plugin { | ||
| + | #sieve = file: | ||
| + | #} | ||
| + | # Editing main Dovecot configuration | ||
| + | sudo nano / | ||
| + | #declare versions | ||
| + | dovecot_storage_version = 2.4.1 | ||
| + | dovecot_config_version = 2.4 | ||
| + | #comment out dictionary (unless you set it up) | ||
| + | #dict { | ||
| + | # quota = file:/ | ||
| + | #} | ||
| + | |||
| + | In May 2025, the Validity RBL switched to a locked model, so you need to disable queries to it in spamassassin by editing '' | ||
| + | |||
| + | 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 | ||
| + | |||
| + | 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:// | ||
| + | |||
| + | --- // | ||