Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
howtos:network_services:postfix_with_cyrus [2017/10/18 04:32 (UTC)] klaatu grammar, minor formatting corrections, spelling, and minimalism |
howtos:network_services:postfix_with_cyrus [2019/02/16 16:43 (UTC)] pedro.herrero [Sources] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Making Slackware Mail Server ====== | ====== Making Slackware Mail Server ====== | ||
- | This article shows how to make an Slackware machine your personal Mail Server. This howto is for Slackware 64 13.37, but with few changes you can adapt it to the newest member of the Slackware | + | This article shows how to make an Slackware machine your personal Mail Server. This howto is for Slackware 64 13.37, but with few changes you can adapt it to the newest member of Slackware |
- | Before | + | Before |
- | You will install Cyrus-SASL, Postfix, Cyurs-IMAP, and then configure them to use certificates | + | Let's get started then , we will need to install Cyrus-SASL, Postfix, Cyurs-IMAP and then configure them all to use Certificates |
====== Installing Cyrus-SASL ====== | ====== Installing Cyrus-SASL ====== | ||
Line 45: | Line 45: | ||
# joe postfix.Slackbuild | # joe postfix.Slackbuild | ||
| | ||
- | Edit the following line and replace " | + | Edit the following line and replace " |
SASL=${SASL: | SASL=${SASL: | ||
| | ||
- | To begin Postfix installation, you must create | + | In order to begin Postfix installation you will need to create postfix user and group (also keep in mind that we need to add user postfix and user cyrus to the same group, |
# groupadd -g 200 postfix | # groupadd -g 200 postfix | ||
Line 57: | Line 57: | ||
# installpkg / | # installpkg / | ||
- | Before | + | Before |
+ | |||
+ | First of all we need to make our aliases and tell Postfix to use aliases maps from / | ||
# joe / | # joe / | ||
| | ||
- | Edit these lines and make them look like this: | + | Edit these lines and make them look like this : |
alias_maps = hash:/ | alias_maps = hash:/ | ||
alias_database = hash:/ | alias_database = hash:/ | ||
| | ||
- | Now add a user to your Slackware machine, a user who will also can read and send mail. | + | Now let' |
# adduser | # adduser | ||
Line 77: | Line 79: | ||
Do you wish to change the sheel? (Y/n): n | Do you wish to change the sheel? (Y/n): n | ||
Expiry date (YYYY-MM-DD) []: press ENTER | Expiry date (YYYY-MM-DD) []: press ENTER | ||
- | + | | |
- | Press ENTER and input full name and other account-related | + | |
| | ||
- | Now edit / | + | Now edit / |
root : | root : | ||
office: | office: | ||
| | ||
- | Update | + | Now update |
# postalias hash:/ | # postalias hash:/ | ||
- | + | It is now time to make our important configurations for Postfix | |
- | Make the required configuration changes | + | |
# joe / | # joe / | ||
myhostname = mx.yourdomain.tld | myhostname = mx.yourdomain.tld | ||
Line 98: | Line 97: | ||
mydestination = $myhostname, | mydestination = $myhostname, | ||
mynetworks = 127.0.0.0/8 | mynetworks = 127.0.0.0/8 | ||
- | + | Let's now configure | |
- | Configure | + | |
# mkdir /etc/sasl2 | # mkdir /etc/sasl2 | ||
# cd /etc/sasl2 | # cd /etc/sasl2 | ||
Line 108: | Line 105: | ||
pwcheck_method: | pwcheck_method: | ||
mech_list: PLAIN LOGIN | mech_list: PLAIN LOGIN | ||
- | + | Now let' | |
- | Next, configure Postfix to have users authenticate using SASL. Edit / | + | |
smtpd_sasl_auth_enable = yes | smtpd_sasl_auth_enable = yes | ||
broken_sasl_auth_clients = yes | broken_sasl_auth_clients = yes | ||
smtpd_recipient_restrictions = permit_mynetworks, | smtpd_recipient_restrictions = permit_mynetworks, | ||
- | + | Let's start the daemons and test our configurations until now: | |
- | Start the daemons and test our configurations until now: | + | |
# saslauthd -a shadow | # saslauthd -a shadow | ||
# postfix start | # postfix start | ||
- | + | Then from another machine telnet into your mail server on port 25 and issue the following commands : | |
- | Then from another machine, telnet into your mail server on port 25 and issue the following commands : | + | |
# telnet mx.mailserver.com 25 | # telnet mx.mailserver.com 25 | ||
ehlo user.mailserver.tld | ehlo user.mailserver.tld | ||
Line 146: | Line 137: | ||
250 2.0.0 Ok: queued as 4C0EE221E93 | 250 2.0.0 Ok: queued as 4C0EE221E93 | ||
QUIT | QUIT | ||
- | | ||
< | < | ||
- | |||
<note important> | <note important> | ||
- | |||
====== Installing Mail Delivery and Cyrus IMAP ====== | ====== Installing Mail Delivery and Cyrus IMAP ====== | ||
Line 180: | Line 168: | ||
# / | # / | ||
# su - root | # su - root | ||
- | |||
Edit / | Edit / | ||
- | |||
sasl_mech_list: | sasl_mech_list: | ||
allowplaintext: | allowplaintext: | ||
- | | ||
Edit / | Edit / | ||
- | |||
mailbox_transport = lmtp: | mailbox_transport = lmtp: | ||
- | + | The last step to do is to add users to your imap server. | |
- | The last step to do is to add users to your imap server. | + | |
# passwd cyrus | # passwd cyrus | ||
+ | and add a password for cyrus user | ||
# cyradm --user cyrus --server localhost --auth plain | # cyradm --user cyrus --server localhost --auth plain | ||
localhost> | localhost> | ||
localhost> | localhost> | ||
localhost> | localhost> | ||
- | | ||
< | < | ||
- | At this point, you have a functional Mail Server, but with users authenticating in plain text . So the next step is inevitable. | + | At this point we have an functional Mail Server but with users authenticating in plain text . So the next step is innevitabile. |
====== SSL / TLS Postfix and Cyrus ====== | ====== SSL / TLS Postfix and Cyrus ====== | ||
- | Start by creating certificates and configuring POSTFIX to use STARTTLS. | + | Let's start by creating |
# cd /etc/ssl | # cd /etc/ssl | ||
# misc/CA.pl -newca ( complete all entries) | # misc/CA.pl -newca ( complete all entries) | ||
Line 214: | Line 195: | ||
# chmod 400 / | # chmod 400 / | ||
# cp / | # cp / | ||
- | + | Now add the followings to / | |
- | Add the followings to / | + | |
smtpd_use_tls = yes | smtpd_use_tls = yes | ||
smtpd_tls_key_file = / | smtpd_tls_key_file = / | ||
smtpd_tls_cert_file = / | smtpd_tls_cert_file = / | ||
smtpd_tls_CAfile = / | smtpd_tls_CAfile = / | ||
- | | ||
<note important> | <note important> | ||
| | ||
Line 227: | Line 205: | ||
-o smtpd_sasl_auth_enable=yes | -o smtpd_sasl_auth_enable=yes | ||
</ | </ | ||
- | + | Now let' | |
- | Now configure IMAP to use STARTTLS: | + | |
# openssl req -new -nodes -out req.pem -keyout key.pem | # openssl req -new -nodes -out req.pem -keyout key.pem | ||
# openssl rsa -in key.pem -out new.key.pem | # openssl rsa -in key.pem -out new.key.pem | ||
Line 244: | Line 220: | ||
====== Adding daemons to rc.local ====== | ====== Adding daemons to rc.local ====== | ||
| | ||
- | The final step is to add all daemons to **rc.local** so they can start when machine boots. | + | Now the last step is to add all daemons to rc.local so they can start when machine boots. |
# Starting saslauthd daemon | # Starting saslauthd daemon | ||
if [ ! -r / | if [ ! -r / | ||
Line 268: | Line 243: | ||
Postfix The Definitive Guide, Kyle D. Dent, O' | Postfix The Definitive Guide, Kyle D. Dent, O' | ||
Managing IMAP, Dianna Mullet & Kevin Mullet, O' | Managing IMAP, Dianna Mullet & Kevin Mullet, O' | ||
- | Official Postfix Documentation, | + | Official Postfix Documentation, |
{{tag> | {{tag> | ||
+ | [[http:// |