[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:network_services:postfix_dovecot_mysql:postfix [2015/02/15 08:55 (UTC)] – astrogeek | howtos:network_services:postfix_dovecot_mysql:postfix [2015/02/16 07:15 (UTC)] – astrogeek | ||
---|---|---|---|
Line 3: | Line 3: | ||
<note important> | <note important> | ||
- | We will build and install | + | Postfix |
- | By default | + | We will build and install Postfix using the build script |
- | The essential steps to build postfix are... | + | By default the SBo postfix script builds with dovecot for SASL, which we need, but without the database support we also need. You might want to check the SlackBuild script at the time you build for changes or other options. |
+ | We will assume that you are familiar with SlackBuilds and will provide only the essential steps for building postfix here. For more detailed information please visit the [[http:// | ||
+ | |||
+ | < | ||
+ | |||
+ | The essential steps for building postfix with the required database support are (as root): | ||
+ | < | ||
+ | cd /tmp | ||
+ | wget http:// | ||
+ | tar -xvzf postfix.tar.gz | ||
+ | cd postfix | ||
+ | cat postfix.info | ||
+ | ... | ||
+ | DOWNLOAD=" | ||
+ | MD5SUM=" | ||
+ | ... | ||
+ | |||
+ | # Fetch archive from URL in DOWNLOAD line # | ||
+ | wget http:// | ||
+ | |||
+ | # Verify integrity of archive - compare to MD5SUM line # | ||
+ | md5sum postfix-2.11.3.tar.gz | ||
+ | c3f0f51d8865559b40e9350eb3816011 | ||
+ | |||
+ | # Now build with database support # | ||
+ | chmod +x postfix.SlackBuild | ||
+ | DATABASE=mysql ./ | ||
+ | </ | ||
+ | |||
+ | The resulting package will be found in / | ||
+ | |||
+ | Copy the package file to the target platform if necessary and install: | ||
+ | < | ||
===== Configuring The Postfix MTA ===== | ===== Configuring The Postfix MTA ===== | ||
- | You should | + | You must become familiar with the [[http:// |
+ | |||
+ | <note important> | ||
What follows is a minimum configuration to safely operate a virtual email server on the internet, but you will surely want to adapt it to your specific needs. | What follows is a minimum configuration to safely operate a virtual email server on the internet, but you will surely want to adapt it to your specific needs. | ||
Line 25: | Line 59: | ||
vi / | vi / | ||
- | //Uncomment the following lines...// | + | # Uncomment the following lines # |
smtp inet n | smtp inet n | ||
submission inet n | submission inet n | ||
Line 38: | Line 72: | ||
vi / | vi / | ||
- | //Now enter the following lines...// | + | # Enter the following lines # |
mynetworks_style = host | mynetworks_style = host | ||
myorigin = $mydomain | myorigin = $mydomain | ||
- | #Change my-domain.com to the actual domain name of your server | + | # Change my-domain.com to the actual domain name of your server |
mydomain = my-domain.com | mydomain = my-domain.com | ||
- | # | + | # mydestination must be localhost only to allow postfix to deliver non-virtual system mail # |
mydestination = localhost | mydestination = localhost | ||
#IMPORTANT - relay_domains should be empty to prevent your server from becoming a spam relay! | #IMPORTANT - relay_domains should be empty to prevent your server from becoming a spam relay! | ||
#If you actually need to relay to other domains READ THE DOCUMENTATION CAREFULLY! | #If you actually need to relay to other domains READ THE DOCUMENTATION CAREFULLY! | ||
- | relay_domains = | + | relay_domains = |
+ | # We have no local users, so no local notifications # | ||
biff = no | biff = no | ||
- | append_dot_mydomain = no | ||
</ | </ | ||
Now we need to configure the secure aspects of our mail server, again in main.cf: | Now we need to configure the secure aspects of our mail server, again in main.cf: | ||
- | |||
< | < | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
- | #SSL certificates will be created at these locations when we configure dovecot | + | # SSL certificates will be created at these locations when we configure dovecot |
smtpd_tls_cert_file = / | smtpd_tls_cert_file = / | ||
smtpd_tls_key_file = / | smtpd_tls_key_file = / | ||
Line 87: | Line 120: | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
#Tell postfix to use dovecot lmtp for virtual mail delivery | #Tell postfix to use dovecot lmtp for virtual mail delivery | ||
Line 97: | Line 130: | ||
virtual_alias_maps = mysql:/ | virtual_alias_maps = mysql:/ | ||
- | #Set localhost | + | #Set localhost |
alias_maps = hash:/ | alias_maps = hash:/ | ||
</ | </ | ||
- | The last four files do not yet exist on the system and so, must be created. The virtual | + | The last four files do not yet exist on the system and so, must be created. The files prefixed with " |
First we must tell postfix how to identify which virtual domains it handles mail for by providing a proper query of the virtual database. This query must return true if the domain is in the database: | First we must tell postfix how to identify which virtual domains it handles mail for by providing a proper query of the virtual database. This query must return true if the domain is in the database: | ||
Line 108: | Line 141: | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
user= mailuser | user= mailuser | ||
password = {your mailuser password} | password = {your mailuser password} | ||
Line 128: | Line 160: | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
user= mailuser | user= mailuser | ||
password = {your mailuser password} | password = {your mailuser password} | ||
Line 141: | Line 172: | ||
< | < | ||
- | Next, we must tell postfix how to identify valid aliases in the database. This query too, must return | + | Next, we must tell postfix how to identify valid aliases in the database. This query must return |
< | < | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
user= mailuser | user= mailuser | ||
password = {your mailuser password} | password = {your mailuser password} | ||
Line 164: | Line 194: | ||
vi / | vi / | ||
- | //Enter the following lines...// | + | # Enter the following lines # |
postmaster: root | postmaster: root | ||
- | root: myself | + | root: root |
</ | </ | ||