[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:misc:postifx_with_cyrus [2013/07/21 13:19 (UTC)] – badirca | howtos:network_services:postfix_with_cyrus [2017/10/18 04:32 (UTC)] – grammar, minor formatting corrections, spelling, and minimalism klaatu | ||
---|---|---|---|
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 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 the Slackware |
- | Before | + | Before |
- | Let's get started then , we will need to install Cyrus-SASL, Postfix, Cyurs-IMAP and then configure them all to use Certificates | + | You will install Cyrus-SASL, Postfix, Cyurs-IMAP, and then configure them 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: | ||
| | ||
- | 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, | + | To begin Postfix installation, you must create |
# 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 | + | |
# 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 let' | + | Now add a user to your Slackware machine, a user who will also can read and send mail. |
# adduser | # adduser | ||
| | ||
- | Login name for new user []:xxxxxx | + | Login name for new user []: slackware_user |
User ID (' | User ID (' | ||
Initial group [ users ]: 200 | Initial group [ users ]: 200 | ||
Line 79: | Line 77: | ||
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: your_user | + | root : slackware_user |
- | office: | + | office: |
| | ||
- | Now update | + | 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 97: | Line 98: | ||
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 105: | Line 108: | ||
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 137: | Line 146: | ||
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 168: | Line 180: | ||
# / | # / | ||
# 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 we have an functional Mail Server but with users authenticating in plain text . So the next step is innevitabile. | + | At this point, you have a functional Mail Server, but with users authenticating in plain text . So the next step is inevitable. |
====== SSL / TLS Postfix and Cyrus ====== | ====== SSL / TLS Postfix and Cyrus ====== | ||
- | Let's start by creating | + | Start by creating certificates and configuring POSTFIX to use STARTTLS. |
# cd /etc/ssl | # cd /etc/ssl | ||
# misc/CA.pl -newca ( complete all entries) | # misc/CA.pl -newca ( complete all entries) | ||
Line 195: | Line 214: | ||
# 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 205: | Line 227: | ||
-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 218: | Line 242: | ||
# echo tls_key_file: | # echo tls_key_file: | ||
| | ||
- | ====== Adding | + | ====== Adding |
| | ||
- | Now the last step is to add all daemons to rc.local so they can start when machine boots. | + | The final 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 244: | Line 269: | ||
Managing IMAP, Dianna Mullet & Kevin Mullet, O' | Managing IMAP, Dianna Mullet & Kevin Mullet, O' | ||
Official Postfix Documentation, | Official Postfix Documentation, | ||
- | {{tag> | + | {{tag> |