dovecot config, rsyslog

This commit is contained in:
Jeff Moe 2024-09-01 11:28:59 -06:00
parent ab4704408e
commit 44cd652fe2
2 changed files with 168 additions and 79 deletions

View file

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Libre Developers Documentation 0\n" "Project-Id-Version: Libre Developers Documentation 0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 11:07-0600\n" "POT-Creation-Date: 2024-09-01 11:28-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n" "Language: en\n"
@ -30,8 +30,8 @@ msgstr ""
#: ../../../_source/mail-libre-is.rst:6 #: ../../../_source/mail-libre-is.rst:6
msgid "" msgid ""
"Setting up Internet mail servers is a pain. It's nothing like just " "Setting up Internet mail servers is a pain. It's nothing like just setting "
"setting up a web server..." "up a web server..."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:11 #: ../../../_source/mail-libre-is.rst:11
@ -47,10 +47,11 @@ msgid "`<https://workaround.org/ispmail-bookworm/>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:17 #: ../../../_source/mail-libre-is.rst:17
msgid "For more information and details about what is what, refer to that site." msgid ""
"For more information and details about what is what, refer to that site."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:20 ../../../_source/mail-libre-is.rst:212 #: ../../../_source/mail-libre-is.rst:20 ../../../_source/mail-libre-is.rst:222
msgid "Dovecot" msgid "Dovecot"
msgstr "" msgstr ""
@ -58,11 +59,11 @@ msgstr ""
msgid "`<https://dovecot.org/>`_" msgid "`<https://dovecot.org/>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:25 ../../../_source/mail-libre-is.rst:58 #: ../../../_source/mail-libre-is.rst:25 ../../../_source/mail-libre-is.rst:68
msgid "MariaDB" msgid "MariaDB"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:28 ../../../_source/mail-libre-is.rst:257 #: ../../../_source/mail-libre-is.rst:28 ../../../_source/mail-libre-is.rst:327
msgid "OpenDKIM" msgid "OpenDKIM"
msgstr "" msgstr ""
@ -70,7 +71,7 @@ msgstr ""
msgid "`<http://www.opendkim.org/>`_" msgid "`<http://www.opendkim.org/>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:32 ../../../_source/mail-libre-is.rst:265 #: ../../../_source/mail-libre-is.rst:32 ../../../_source/mail-libre-is.rst:335
msgid "OpenDMARC" msgid "OpenDMARC"
msgstr "" msgstr ""
@ -82,7 +83,7 @@ msgstr ""
msgid "`<https://github.com/trusteddomainproject/OpenDMARC>`_" msgid "`<https://github.com/trusteddomainproject/OpenDMARC>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:38 ../../../_source/mail-libre-is.rst:110 #: ../../../_source/mail-libre-is.rst:38 ../../../_source/mail-libre-is.rst:120
msgid "Postfix" msgid "Postfix"
msgstr "" msgstr ""
@ -91,138 +92,156 @@ msgid "`<https://www.postfix.org/>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:44 #: ../../../_source/mail-libre-is.rst:44
msgid "Apache" msgid "Debian"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:45 #: ../../../_source/mail-libre-is.rst:45
msgid "" msgid ""
"The Apache webserver is used out of laziness as it allows easy " "Install Debian stable (bookworm). Install rsyslog for old school convenience:"
"certificate updates with certbot. A webmail server won't be running on "
"the main mail server."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:54 #: ../../../_source/mail-libre-is.rst:54
msgid "Apache"
msgstr ""
#: ../../../_source/mail-libre-is.rst:55
msgid ""
"The Apache webserver is used out of laziness as it allows easy certificate "
"updates with certbot. A webmail server won't be running on the main mail "
"server."
msgstr ""
#: ../../../_source/mail-libre-is.rst:64
msgid "Open up firewall ports 80 and 443." msgid "Open up firewall ports 80 and 443."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:59 #: ../../../_source/mail-libre-is.rst:69
msgid "The main database server." msgid "The main database server."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:67 #: ../../../_source/mail-libre-is.rst:77
msgid "Add databases. Change password to something secure." msgid "Add databases. Change password to something secure."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:111 #: ../../../_source/mail-libre-is.rst:121
msgid "The main SMTP mail server." msgid "The main SMTP mail server."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:118 #: ../../../_source/mail-libre-is.rst:128
msgid "" msgid ""
"Set up postfix to use MariaDB. Edit /etc/postfix/mysql-virtual-mailbox-" "Set up postfix to use MariaDB. Edit /etc/postfix/mysql-virtual-mailbox-"
"domains.cf and add below, using the mailserver password used in MariaDB." "domains.cf and add below, using the mailserver password used in MariaDB."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:131 #: ../../../_source/mail-libre-is.rst:141
msgid "Edit /etc/postfix/mysql-virtual-mailbox-maps.cf and add below contents:" msgid "Edit /etc/postfix/mysql-virtual-mailbox-maps.cf and add below contents:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:141 #: ../../../_source/mail-libre-is.rst:151
msgid "Edit /etc/postfix/mysql-virtual-alias-maps.cf and add below:" msgid "Edit /etc/postfix/mysql-virtual-alias-maps.cf and add below:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:151 #: ../../../_source/mail-libre-is.rst:161
msgid "Edit /etc/postfix/mysql-email2email.cf and add:" msgid "Edit /etc/postfix/mysql-email2email.cf and add:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:161 #: ../../../_source/mail-libre-is.rst:171
msgid "Then run these commands:" msgid "Then run these commands:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:178 #: ../../../_source/mail-libre-is.rst:188
msgid "Redis" msgid "Redis"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:179
msgid ""
"Note, the licensing of Redis has gone bad. The version in Debian is OK. "
"But in the future, probably replace with a fork."
msgstr ""
#: ../../../_source/mail-libre-is.rst:188
msgid "rspamd"
msgstr ""
#: ../../../_source/mail-libre-is.rst:189 #: ../../../_source/mail-libre-is.rst:189
msgid "Spam control." msgid ""
msgstr "" "Note, the licensing of Redis has gone bad. The version in Debian is OK. But "
"in the future, probably replace with a fork."
#: ../../../_source/mail-libre-is.rst:197
msgid "Certbot"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:198 #: ../../../_source/mail-libre-is.rst:198
msgid "" msgid "rspamd"
"Encryption certificates with Let's Encrypt. Not using an Apache webserver"
" on the mail server makes getting new certificates a bit more complex."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:213 #: ../../../_source/mail-libre-is.rst:199
msgid "Spam control."
msgstr ""
#: ../../../_source/mail-libre-is.rst:207
msgid "Certbot"
msgstr ""
#: ../../../_source/mail-libre-is.rst:208
msgid ""
"Encryption certificates with Let's Encrypt. Not using an Apache webserver on "
"the mail server makes getting new certificates a bit more complex."
msgstr ""
#: ../../../_source/mail-libre-is.rst:223
msgid "Just using encrypted IMAPS, not POP." msgid "Just using encrypted IMAPS, not POP."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:220 #: ../../../_source/mail-libre-is.rst:230
msgid "" msgid ""
"Note, since IPv6 isn't being used, the dovecot install barfs. Edit " "Note, since IPv6 isn't being used, the dovecot install barfs. Edit /etc/"
"/etc/dovecot/dovecot.conf and add this line, where appropriate:" "dovecot/dovecot.conf and add this line, where appropriate:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:227 #: ../../../_source/mail-libre-is.rst:237
msgid "" msgid ""
"Note, this is removing the \"::\" from listen, which using IPv6. Then re-" "Note, this is removing the \"::\" from listen, which using IPv6. Then re-run "
"run the install so the packages are happy. Note, the re-install won't " "the install so the packages are happy. Note, the re-install won't overwrite "
"overwrite the \"listen\" change." "the \"listen\" change."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:236 #: ../../../_source/mail-libre-is.rst:246
msgid "Add user and set up configs" msgid "Add user and set up configs"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:266 #: ../../../_source/mail-libre-is.rst:274
msgid "Requires database setup." msgid "Edit /etc/dovecot/conf.d/10-master.conf and add:"
msgstr ""
#: ../../../_source/mail-libre-is.rst:275
msgid "SPF"
msgstr ""
#: ../../../_source/mail-libre-is.rst:276
msgid "Set up SPF."
msgstr ""
#: ../../../_source/mail-libre-is.rst:280
msgid "DNS"
msgstr ""
#: ../../../_source/mail-libre-is.rst:281
msgid "Set up DNS."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:285 #: ../../../_source/mail-libre-is.rst:285
msgid ""
"Edit /etc/dovecot/conf.d/10-ssl.conf, set key locations, and make it "
"required."
msgstr ""
#: ../../../_source/mail-libre-is.rst:294
msgid ""
"Edit /etc/dovecot/dovecot-sql.conf.ext file and add these lines at the "
"bottom, changing the password to the mailserver database password."
msgstr ""
#: ../../../_source/mail-libre-is.rst:317
msgid "Set file permissions and restart server."
msgstr ""
#: ../../../_source/mail-libre-is.rst:336
msgid "Requires database setup."
msgstr ""
#: ../../../_source/mail-libre-is.rst:345
msgid "SPF"
msgstr ""
#: ../../../_source/mail-libre-is.rst:346
msgid "Set up SPF."
msgstr ""
#: ../../../_source/mail-libre-is.rst:350
msgid "DNS"
msgstr ""
#: ../../../_source/mail-libre-is.rst:351
msgid "Set up DNS."
msgstr ""
#: ../../../_source/mail-libre-is.rst:355
msgid "Other" msgid "Other"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:286 #: ../../../_source/mail-libre-is.rst:356
msgid "Perhaps these too." msgid "Perhaps these too."
msgstr "" msgstr ""
#~ msgid ""
#~ "Setting up Internet mail servers is "
#~ "a pain. It's nothing like just "
#~ "setting up a web server... This "
#~ "install is based on this guide:"
#~ msgstr ""
#~ msgid "Add user."
#~ msgstr ""

View file

@ -40,6 +40,16 @@ Postfix
`<https://www.postfix.org/>`_ `<https://www.postfix.org/>`_
Debian
======
Install Debian stable (bookworm).
Install rsyslog for old school convenience:
.. code-block:: sh
sudo apt install rsyslog
Apache Apache
====== ======
The Apache webserver is used out of laziness as it allows easy The Apache webserver is used out of laziness as it allows easy
@ -253,6 +263,66 @@ Add user and set up configs
's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/g' \ 's/#!include auth-sql.conf.ext/!include auth-sql.conf.ext/g' \
/etc/dovecot/conf.d/10-auth.conf /etc/dovecot/conf.d/10-auth.conf
sudo sed -i -e \
's/^mail_location.*/mail_location = maildir:~\/Maildir/g' \
/etc/dovecot/conf.d/10-mail.conf
sudo sed -i -e \
's/#mail_plugins =/mail_plugins = quota/g' \
/etc/dovecot/conf.d/10-mail.conf
Edit /etc/dovecot/conf.d/10-master.conf and add:
.. code-block:: cfg
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
Edit /etc/dovecot/conf.d/10-ssl.conf, set key locations, and make it
required.
.. code-block:: cfg
ssl = required
ssl_cert = </etc/letsencrypt/live/mail.libre.is/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.libre.is/privkey.pem
Edit /etc/dovecot/dovecot-sql.conf.ext file and add these lines at
the bottom, changing the password to the mailserver database password.
.. code-block:: cfg
driver = mysql
connect = \
host=127.0.0.1 \
dbname=mailserver \
user=mailserver \
password=password
user_query = SELECT email as user, \
concat('*:bytes=', quota) AS quota_rule, \
'/var/vmail/%d/%n' AS home, \
5000 AS uid, 5000 AS gid \
FROM virtual_users WHERE email='%u'
password_query = SELECT password FROM virtual_users WHERE email='%u'
iterate_query = SELECT email AS user FROM virtual_users
Set file permissions and restart server.
.. code-block:: sh
sudo chown root:root /etc/dovecot/dovecot-sql.conf.ext
sudo chmod 600 /etc/dovecot/dovecot-sql.conf.ext
sudo systemctl restart dovecot
OpenDKIM OpenDKIM
======== ========