From 39d0f88abf4fa149561c0ca2ec93a868e29fb1b2 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sat, 17 Oct 2026 22:27:58 -0400 Subject: [PATCH] for some fuckass reason this part of the readme never got uploaded --- README.md | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 894635b..9f50e10 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ BullMail is a no-bullshit solution to setup an E-Mail server on a Debian/Ubuntu shitbox. ## Now updated to work with Debian 13 Trixie -If you ran this script before, simply run it again. Just a heads up, it will generate new DKIM keys. I recommend you generate new ones otherwise this shit might break. +If you ran this script before, simply run it again. Just a heads up, it will generate new DKIM keys. I recommend you generate new ones otherwise this shit might break. If you need it to work on Debian 12, please clone this revision instead: ## What it does - Creates an `SMTP` server (`postfix`, to send and receive E-Mails) @@ -44,12 +44,30 @@ Log onto your registrar and set and A and AAAA record onto your domain that poin Now, you want to point these records in a way that `mail.yourdomain.com` resolves to your server's IP. +Now, make sure to also add this TXT record (this TXT records have no name. Input `@` if it forces you to put a name in): +``` +v=spf1 mx a:mail.yourdomain.com ip4:51.79.70.119 ip6:2607:5300:205:200::35c2 -all +``` + +Also add this record. Give it the `_dmarc` name. +``` +v=DMARC1; p=reject; rua=mailto:postmaster@yourdomain.com; fo=1 +``` +Replace the domain, ip4 and ip6 with your own. + +Lastly, add this `MX` record to your domain: +``` +mail.yourdomain.com +``` + +If it asks for a distance/priority parameter, input `10`. + **Keep your domain's DNS manager open, we're not done with it.** ## Step 2 Go to your host's server configuration panel and set the rDNS (Reverse DNS) to `mail.yourdomain.com` (obviously, replace `yourdomain.com` with your own). This helps some exotic mail servers to perceive your E-Mails as not spam. After setting up the rDNS, restart the server and run this from your local machine: -``` +```sh will@fuckedmachine:~$ ping yourdomain.com PING yourdomain.com (x.x.x.x) 56(84) bytes of data. 64 bytes from mail.yourdomain.com (x.x.x.x): icmp_seq=1 ttl=52 time=13.4 ms @@ -63,26 +81,26 @@ The 3rd line is the interesting part. It should say `64 bytes from mail.yourdoma ## Step 3 SSH onto your shitbox and become root -``` +```sh sudo su ``` ## Step 4 Create your mail user. Note that all users with the `mail` group will be able to send and receive mail. -``` +```sh useradd -m yourname -G mail passwd yourname ``` OR... If you already have an user that you use (say, `will`), do this instead: -``` +```sh usermod -aG mail will ``` `-aG` tells your stupid server "hey, `mail` is a secondary group for `will`!" `-G` says it's the primary group. ## Step 5 Run these commands (don't run `bullmail.sh` quite yet you moron) -``` +```sh git clone https://git.lolcat.ca/lolcat/bullmail cd bullmail/script chmod +x bullmail.sh @@ -90,7 +108,7 @@ chmod +x bullmail.sh ## Step 6 Edit `bullmail.sh` and change the variables at the top to what matches your configuration. In my case, this is what I used: -``` +```ini # # Input your settings here # @@ -106,11 +124,11 @@ I know this is not the first time you're trying to install a mail server. Make s ## Step 8 Run the script. Make sure you're root and inside the `script` folder -``` +```sh ./bullmail.sh ``` -Wait for it to complete. Trust the plan. +Wait for it to complete. Trust the plan. When postfix asks questions, pick "Internet site" and when it asks for a domain enter `yourdomain.com` (obviously, replace yourdomain.com with your own domain. Don't add `mail.` in front of it) ## Step 9 The script should output something like this at the end: @@ -122,7 +140,10 @@ mail._domainkey IN TXT ( "v=DKIM1; k=rsa; " Bye! ``` -In your DNS settings of your domain, create a TXT record called `mail._domainkey` with the value `v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvrB...` (truncated) +In your DNS settings of your domain, create a TXT record called `mail._domainkey` with this shit in it. Notice how you need to remove the weird quotes the script outputs after `k=rsa; "`. Example: +``` +v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvrB... (truncated) +``` Make sure to copy-paste what the script outputs, not the bullshit I gave as an example, you moron. @@ -163,6 +184,9 @@ Content-Transfer-Encoding: 7bit test ``` +# Additional configuration +`rspamd` is your spam filter. You can tweak it manually to instruct it to block specific E-Mails, depending of your situation. + # Screenshots ## Inbox ![Inbox screenshot](img/inbox.png)