From ec2aa74d36670d74c153aa0022ab22e79502a061 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Tue, 2 May 2023 01:33:25 -0600 Subject: update to new version of pyssg --- live/blog/a/mail_server_with_postfix.html | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'live/blog/a/mail_server_with_postfix.html') diff --git a/live/blog/a/mail_server_with_postfix.html b/live/blog/a/mail_server_with_postfix.html index 6df0765..c8acc43 100644 --- a/live/blog/a/mail_server_with_postfix.html +++ b/live/blog/a/mail_server_with_postfix.html @@ -3,27 +3,26 @@ " prefix="og: https://ogp.me/ns#"> - - + Create a mail server with Postfix, Dovecot, SpamAssassin and OpenDKIM -- Luevano's Blog - - - + + + - - + + - + - + @@ -78,14 +77,14 @@

The entry is going to be long because it’s a tedious process. This is also based on Luke Smith’s script, but adapted to Arch Linux (his script works on debian-based distributions). This entry is mostly so I can record all the notes required while I’m in the process of installing/configuring the mail server on a new VPS of mine; also I’m going to be writing a script that does everything in one go (for Arch Linux), that will be hosted here.

This configuration works for local users (users that appear in /etc/passwd), and does not use any type of SQL Database. And note that most if not all commands executed here are run with root privileges.

-

Prerequisites

+

Prerequisites

Basically the same as with the website with Nginx and Certbot, with the extras:

-

Postfix

+

Postfix

Postfix is a “mail transfer agent” which is the component of the mail server that receives and sends emails via SMTP.

Install the postfix package:

pacman -S postfix
@@ -174,7 +173,7 @@ newaliases
 
systemctl start postfix.service
 systemctl enable postfix.service
 
-

Dovecot

+

Dovecot

Dovecot is an IMAP and POP3 server, which is what lets an email application retrieve the mail.

Install the dovecot and pigeonhole (sieve for dovecot) packages:

pacman -S dovecot pigeonhole
@@ -289,7 +288,7 @@ account required pam_unix.so
 
systemctl start dovecot.service
 systemctl enable dovecot.service
 
-

OpenDKIM

+

OpenDKIM

OpenDKIM is needed so services like G**gle (we don’t mention that name here [[[this is a meme]]]) don’t throw the mail to the trash. DKIM stands for “DomainKeys Identified Mail”.

Install the opendkim package:

pacman -S opendkim
@@ -357,7 +356,7 @@ systemctl enable opendkim.service
 
 
 

And at this point you could test your mail for spoofing and more.

-

SpamAssassin

+

SpamAssassin

SpamAssassin is just a mail filter to identify spam.

Install the spamassassin package (which will install a bunch of ugly perl packages…):

pacman -S spamassassin
@@ -410,7 +409,7 @@ ExecStart=/usr/bin/vendor_perl/spamd -x -u spamd -g spamd --listen=/run/spamd/sp
 
systemctl start spamassassin.service
 systemctl enable spamassassin.service
 
-

Wrapping up

+

Wrapping up

We should have a working mail server by now. Before continuing check your journal logs (journalctl -xe --unit={unit}, where {unit} could be spamassassin.service for example) to see if there was any error whatsoever and try to debug it, it should be a typo somewhere (the logs are generally really descriptive) because all the settings and steps detailed here just (literally just finished doing everything on a new server as of the writing of this text) worked (((it just werks on my machine))).

Now, to actually use the mail service: first of all, you need a normal account (don’t use root) that belongs to the mail group (gpasswd -a user group to add a user user to group group) and that has a password.

Next, to actually login into a mail app/program/whateveryouwanttocallit, you will use the following settings, at least for thunderdbird(I tested in windows default mail app and you don’t need a lot of settings):

-- cgit v1.2.3-70-g09d2