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 | ||
howtos:network_services:postfix_with_cyrus [2013/07/21 12:50 (UTC)] badirca |
howtos:network_services:postfix_with_cyrus [2019/02/16 16:44 (UTC)] pedro.herrero [Sources] |
||
---|---|---|---|
Line 11: | Line 11: | ||
# cd /tmp | # cd /tmp | ||
- | # mkdir cyrus-sal | + | # mkdir cyrus-sasl |
# cd cyrus-sasl | # cd cyrus-sasl | ||
# wget ftp:// | # wget ftp:// | ||
Line 57: | Line 57: | ||
# installpkg / | # installpkg / | ||
- | Before we continue with installation of Imap server we need to assure that Postfix is working and we can authenticate with sasl. Let's make some basic Postfix configuration and some basic SASL configuration. I will be explaining plain auth because later on we will use it togheter with sasl to authenticate. | + | Before we continue with installation of IMAP server we need to assure that Postfix is working and we can authenticate with sasl. Let's make some basic Postfix configuration and some basic SASL configuration. I will be explaining plain auth because later on we will use it togheter with SASL to authenticate. |
- | First of all we need to make our aliases and tell postfix | + | First of all we need to make our aliases and tell Postfix |
# joe / | # joe / | ||
Line 72: | Line 72: | ||
# 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 83: | Line 83: | ||
Now edit / | Now edit / | ||
- | root: your_user | + | root : slackware_user |
- | office: | + | office: |
| | ||
Now update your aliases database issuing the command : | Now update your aliases database issuing the command : | ||
Line 139: | Line 139: | ||
< | < | ||
<note important> | <note important> | ||
+ | ====== Installing Mail Delivery and Cyrus IMAP ====== | ||
+ | |||
+ | # cd /tmp | ||
+ | # mkdir cyrus-imap | ||
+ | # cd cyrus-imap | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # mkdir patches | ||
+ | # cd patches/ | ||
+ | # wget http:// | ||
+ | # wget http:// | ||
+ | # cd / | ||
+ | # groupadd -g 238 cyrus | ||
+ | # useradd -d /var/imap -s /bin/sh -u 238 -g 238 cyrus -G mail | ||
+ | # sh cyrus-imapd.SlackBuild | ||
+ | # installpkg / | ||
+ | # mkdir -m 750 -p /var/imap / | ||
+ | # chown cyrus:mail /var/imap / | ||
+ | # su - cyrus | ||
+ | # / | ||
+ | # su - root | ||
+ | Edit / | ||
+ | sasl_mech_list: | ||
+ | allowplaintext: | ||
+ | Edit / | ||
+ | mailbox_transport = lmtp: | ||
+ | The last step to do is to add users to your imap server. For that you need to issue these commands : | ||
+ | # passwd cyrus | ||
+ | and add a password for cyrus user | ||
+ | # cyradm --user cyrus --server localhost --auth plain | ||
+ | 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. | ||
+ | |||
+ | ====== SSL / TLS Postfix and Cyrus ====== | ||
+ | |||
+ | Let's start by creating our certificates and configuring POSTFIX to use STARTTLS. | ||
+ | # cd /etc/ssl | ||
+ | # misc/CA.pl -newca ( complete all entries) | ||
+ | # openssl req -new -nodes -keyout mailkey.pem -out mailreq.pem -days 36500 | ||
+ | # openssl ca -out mail_signed_cert.pem -infiles mailreq.pem | ||
+ | # cp / | ||
+ | # cp / | ||
+ | # chown root / | ||
+ | # chmod 400 / | ||
+ | # cp / | ||
+ | Now add the followings to / | ||
+ | smtpd_use_tls = yes | ||
+ | smtpd_tls_key_file = / | ||
+ | smtpd_tls_cert_file = / | ||
+ | smtpd_tls_CAfile = / | ||
+ | <note important> | ||
+ | | ||
+ | -o smtpd_tls_wrappermode=yes | ||
+ | -o smtpd_sasl_auth_enable=yes | ||
+ | </ | ||
+ | Now let's configure IMAP to use STARTTLS | ||
+ | # openssl req -new -nodes -out req.pem -keyout key.pem | ||
+ | # openssl rsa -in key.pem -out new.key.pem | ||
+ | # openssl x509 -in req.pem -out ca-cert -req -signkey new.key.pem -days 36500 | ||
+ | # cp new.key.pem / | ||
+ | # rm new.key.pem | ||
+ | # cat ca-cert >> / | ||
+ | # chown cyrus:mail / | ||
+ | # chmod 600 / | ||
+ | # echo tls_ca_file: | ||
+ | # echo tls_cert_file: | ||
+ | # echo tls_key_file: | ||
+ | | ||
+ | ====== Adding daemons to rc.local ====== | ||
+ | | ||
+ | Now the last step is to add all daemons to rc.local so they can start when machine boots. So open / | ||
+ | # Starting saslauthd daemon | ||
+ | if [ ! -r / | ||
+ | echo " | ||
+ | / | ||
+ | fi | ||
+ | |||
+ | # Starting IMAP daemon | ||
+ | if [ -x / | ||
+ | echo " | ||
+ | / | ||
+ | fi | ||
+ | |||
+ | # Starting POSTFIX daemon | ||
+ | / | ||
+ | |||
Line 144: | Line 241: | ||
====== Sources ====== | ====== Sources ====== | ||
- | <!-- If you are copying information from another source, then specify that source --> | + | Postfix The Definitive Guide, Kyle D. Dent, O' |
- | <!-- * Original source: | + | |
- | <!-- Authors are allowed to give credit to themselves! --> | + | Official Postfix Documentation, |
- | <!-- * Originally written by [[wiki: | + | {{tag>howtos author_badirca}} |
- | <!-- * Contributions by [[wiki: | + | |
- | <!-- Please do not modify anything below, except adding new tags.--> | ||
- | <!-- You must remove the tag-word " | ||
- | {{tag> |