More postfix config

This commit is contained in:
Jeff Moe 2024-09-01 10:53:05 -06:00
parent 42000fd748
commit 5c43260089
2 changed files with 144 additions and 63 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 10:31-0600\n" "POT-Creation-Date: 2024-09-01 10:53-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 " "Setting up Internet mail servers is a pain. It's nothing like just "
"up a web server... This install is based on this guide:" "setting up a web server... This install is based on this guide:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:10 #: ../../../_source/mail-libre-is.rst:10
@ -42,7 +42,7 @@ msgstr ""
msgid "Main Components" msgid "Main Components"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:16 ../../../_source/mail-libre-is.rst:124 #: ../../../_source/mail-libre-is.rst:16 ../../../_source/mail-libre-is.rst:208
msgid "Dovecot" msgid "Dovecot"
msgstr "" msgstr ""
@ -54,7 +54,7 @@ msgstr ""
msgid "MariaDB" msgid "MariaDB"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:24 ../../../_source/mail-libre-is.rst:150 #: ../../../_source/mail-libre-is.rst:24 ../../../_source/mail-libre-is.rst:234
msgid "OpenDKIM" msgid "OpenDKIM"
msgstr "" msgstr ""
@ -62,7 +62,7 @@ msgstr ""
msgid "`<http://www.opendkim.org/>`_" msgid "`<http://www.opendkim.org/>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:28 ../../../_source/mail-libre-is.rst:158 #: ../../../_source/mail-libre-is.rst:28 ../../../_source/mail-libre-is.rst:242
msgid "OpenDMARC" msgid "OpenDMARC"
msgstr "" msgstr ""
@ -74,7 +74,7 @@ msgstr ""
msgid "`<https://github.com/trusteddomainproject/OpenDMARC>`_" msgid "`<https://github.com/trusteddomainproject/OpenDMARC>`_"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:34 ../../../_source/mail-libre-is.rst:80 #: ../../../_source/mail-libre-is.rst:34 ../../../_source/mail-libre-is.rst:106
msgid "Postfix" msgid "Postfix"
msgstr "" msgstr ""
@ -88,9 +88,9 @@ msgstr ""
#: ../../../_source/mail-libre-is.rst:41 #: ../../../_source/mail-libre-is.rst:41
msgid "" msgid ""
"The Apache webserver is used out of laziness as it allows easy certificate " "The Apache webserver is used out of laziness as it allows easy "
"updates with certbot. A webmail server won't be running on the main mail " "certificate updates with certbot. A webmail server won't be running on "
"server." "the main mail server."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:50 #: ../../../_source/mail-libre-is.rst:50
@ -105,79 +105,102 @@ msgstr ""
msgid "Add databases. Change password to something secure." msgid "Add databases. Change password to something secure."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:81 #: ../../../_source/mail-libre-is.rst:107
msgid "The main SMTP mail server." msgid "The main SMTP mail server."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:90 #: ../../../_source/mail-libre-is.rst:114
msgid "Redis"
msgstr ""
#: ../../../_source/mail-libre-is.rst:91
msgid "" msgid ""
"Note, the licensing of Redis has gone bad. The version in Debian is OK. But " "Set up postfix to use MariaDB. Edit /etc/postfix/mysql-virtual-mailbox-"
"in the future, probably replace with a fork." "domains.cf and add below, using the mailserver password used in MariaDB."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:100 #: ../../../_source/mail-libre-is.rst:127
msgid "rspamd" msgid "Edit /etc/postfix/mysql-virtual-mailbox-maps.cf and add below contents:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:101 #: ../../../_source/mail-libre-is.rst:137
msgid "Spam control." msgid "Edit /etc/postfix/mysql-virtual-alias-maps.cf and add below:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:109 #: ../../../_source/mail-libre-is.rst:147
msgid "Certbot" msgid "Edit /etc/postfix/mysql-email2email.cf and add:"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:110 #: ../../../_source/mail-libre-is.rst:157
msgid "" msgid "Then run these commands:"
"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:125
msgid "Just using encrypted IMAPS, not POP."
msgstr ""
#: ../../../_source/mail-libre-is.rst:132
msgid ""
"Note, since IPv6 isn't being used, the dovecot install barfs. Edit /etc/"
"dovecot/dovecot.conf and add this line, where appropriate:"
msgstr ""
#: ../../../_source/mail-libre-is.rst:139
msgid ""
"Note, this is removing the \"::\" from listen, which using IPv6. Then re-run "
"the install so the packages are happy. Note, the re-install won't overwrite "
"the \"listen\" change."
msgstr ""
#: ../../../_source/mail-libre-is.rst:159
msgid "Requires database setup."
msgstr ""
#: ../../../_source/mail-libre-is.rst:168
msgid "SPF"
msgstr ""
#: ../../../_source/mail-libre-is.rst:169
msgid "Set up SPF."
msgstr ""
#: ../../../_source/mail-libre-is.rst:173
msgid "DNS"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:174 #: ../../../_source/mail-libre-is.rst:174
msgid "Redis"
msgstr ""
#: ../../../_source/mail-libre-is.rst:175
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:184
msgid "rspamd"
msgstr ""
#: ../../../_source/mail-libre-is.rst:185
msgid "Spam control."
msgstr ""
#: ../../../_source/mail-libre-is.rst:193
msgid "Certbot"
msgstr ""
#: ../../../_source/mail-libre-is.rst:194
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:209
msgid "Just using encrypted IMAPS, not POP."
msgstr ""
#: ../../../_source/mail-libre-is.rst:216
msgid ""
"Note, since IPv6 isn't being used, the dovecot install barfs. Edit "
"/etc/dovecot/dovecot.conf and add this line, where appropriate:"
msgstr ""
#: ../../../_source/mail-libre-is.rst:223
msgid ""
"Note, this is removing the \"::\" from listen, which using IPv6. Then re-"
"run the install so the packages are happy. Note, the re-install won't "
"overwrite the \"listen\" change."
msgstr ""
#: ../../../_source/mail-libre-is.rst:243
msgid "Requires database setup."
msgstr ""
#: ../../../_source/mail-libre-is.rst:252
msgid "SPF"
msgstr ""
#: ../../../_source/mail-libre-is.rst:253
msgid "Set up SPF."
msgstr ""
#: ../../../_source/mail-libre-is.rst:257
msgid "DNS"
msgstr ""
#: ../../../_source/mail-libre-is.rst:258
msgid "Set up DNS." msgid "Set up DNS."
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:178 #: ../../../_source/mail-libre-is.rst:262
msgid "Other" msgid "Other"
msgstr "" msgstr ""
#: ../../../_source/mail-libre-is.rst:179 #: ../../../_source/mail-libre-is.rst:263
msgid "Perhaps these too." msgid "Perhaps these too."
msgstr "" msgstr ""

View file

@ -111,6 +111,64 @@ The main SMTP mail server.
sudo apt install postfix sudo apt install postfix
sudo apt install postfix-mysql sudo apt install postfix-mysql
Set up postfix to use MariaDB.
Edit /etc/postfix/mysql-virtual-mailbox-domains.cf
and add below, using the mailserver password used in MariaDB.
.. code-block:: sh
user = mailserver
password = password
hosts = 127.0.0.1
dbname = mailserver
query = SELECT 1 FROM virtual_domains WHERE name='%s'
Edit /etc/postfix/mysql-virtual-mailbox-maps.cf and add below contents:
.. code-block:: sh
user = mailserver
password = password
hosts = 127.0.0.1
dbname = mailserver
query = SELECT 1 FROM virtual_users WHERE email='%s'
Edit /etc/postfix/mysql-virtual-alias-maps.cf and add below:
.. code-block:: sh
user = mailserver
password = password
hosts = 127.0.0.1
dbname = mailserver
query = SELECT destination FROM virtual_aliases WHERE source='%s'
Edit /etc/postfix/mysql-email2email.cf and add:
.. code-block:: sh
user = mailserver
password = password
hosts = 127.0.0.1
dbname = mailserver
query = SELECT email FROM virtual_users WHERE email='%s'
Then run these commands:
.. code-block:: sh
sudo postconf \
virtual_mailbox_domains=mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
sudo postconf \
virtual_mailbox_maps=mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
sudo postconf \
virtual_alias_maps=mysql:/etc/postfix/mysql-virtual-alias-maps.cf
sudo postconf \
virtual_alias_maps=mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
sudo chgrp postfix /etc/postfix/mysql-*.cf
sudo chmod 640 /etc/postfix/mysql-*.cf
Redis Redis
===== =====