📄 1408.html
字号:
<br>
Point you Browser to http://tis.foobar.fi/software/ and download the current versions of Cyrus-SASL and Postfix (if you want to use the Postfix SRPM also) to your future smtp-server.<br>
<br>
Note:<br>
By the time of writing this HOWTO current versions of Cyrus-SASL and Postfix are:<br>
cyrus-sasl-1.5.27-t22.src.rpm<br>
postfix-1.1.7-t4.src.rpm<br>
We'll be using these throughout this HOWTO.<br>
<br>
New to RPM?<br>
Source RPMs (or SRPMS) do not contain the ready-to-run binaries, but merly the sourcecode that still needs to be compiled. So we will compile the SRPMS first and install the RPM that we built afterwards. If you want to know more about RPM read this RPM HOWTO.<br>
Step 2: Install SRPMS for compilation<br>
<br>
First we have to install the SRPMS into the RPM framework. Before you do that, please read this tiny Building RPMS and consider to follow the concept.<br>
<br>
Login and cd to the directory where you put the two RPMs. Then install the two RPMs:<br>
<br>
[rpm_user@example.com]# rpm -ivh cyrus-sasl-1.5.27-t22.src.rpm<br>
<br>
Now the source.rpms are installed. Our next step is to configure and build them.<br>
Step 3: Configure and build RPM from SRPM<br>
<br>
In Order to configure our RPMs whe need to add some changes to the specification files. We change to the location the RedHat Package Manager has put it to:<br>
<br>
[root@example.com]# cd /usr/src/redhat/SPECS/<br>
<br>
Remember: Postfix needs the SASL libraries when at compilation time. So we have to compile and install Cyrus-SASL first and turn to build Postfix only then.<br>
Step 4: Build Cyrus-SASL<br>
<br>
Cyrus-SASL builds nicely the way it is and we do not need to pass any extra configuration options. All we have to do, is build it:<br>
<br>
[rpm_user@example.com]# rpmbuild -ba cyrus-sasl.spec<br>
Step 5: Check for existing Cyrus-SASL<br>
<br>
You should check if you already have an existing version on your machine. It doesn't matter if you already have an existing version of cyrus-sasl installed, as we are going to install Tuomos Version anyway. All we need to know is if we have to install a complete new cyrus-sasl or if we 'only' need to update the existing one.<br>
<br>
This is how we check. We query the RPM Database to tell us if there is a Cyrus-SASL RPM installed:<br>
<br>
[root@example.com]# rpm -q cyrus-sasl<br>
<br>
If it reads<br>
<br>
[root@example.com]# package cyrus-sasl is not installed<br>
<br>
go to Install Cyrus-SASL otherwise if the output is<br>
<br>
[root@example.com]# cyrus-sasl-XX<br>
<br>
else proceed with Update Cyrus-SASL.<br>
Step 6: Cyrus-SASL installation<br>
Step 6.1: Install Cyrus-SASL<br>
<br>
Change to the directory where the now completed and compiled Cyrus-SASL RPM was dropped by the RPM Build.<br>
<br>
[rpm_user@example.com]# cd $HOME/rpm/RPMS/i386<br>
<br>
Let's see what we have:<br>
<br>
[rpm_user@example.com]# ls cyr*<br>
cyrus-sasl-1.5.27-t22.i386.rpm<br>
cyrus-sasl-authd-1.5.27-t22.i386.rpm<br>
cyrus-sasl-devel-1.5.27-t22.i386.rpm<br>
cyrus-sasl-gssapi-1.5.27-t22.i386.rpm<br>
cyrus-sasl-md5-1.5.27-t22.i386.rpm<br>
cyrus-sasl-plain-1.5.27-t22.i386.rpm<br>
<br>
We need at least the following RPMs installed in order to make Cyrus-SASL and Postfix work and Postfix get what it needs to when it has to compile with SASL support:<br>
<br>
cyrus-sasl-1.5.27-t22.i386.rpm<br>
cyrus-sasl-authd-1.5.27-t22.i386.rpm<br>
cyrus-sasl-devel-1.5.27-t22.i386.rpm<br>
<br>
Then you have to choose at least on of the following mechanisms to use when authenticating users:<br>
<br>
cyrus-sasl-gssapi-1.5.27-t22.i386.rpm<br>
cyrus-sasl-md5-1.5.27-t22.i386.rpm<br>
cyrus-sasl-plain-1.5.27-t22.i386.rpm<br>
<br>
In this HOWTO we are going to install all of them. We su to root and type:<br>
<br>
[root@example.com]# rpm -ivh cyrus-sasl-*<br>
<br>
That's it for now. We leave Cyrus-SASL the way it is and will build and install Postfix before we will return to configure SASL. Your next Step is Step 7.<br>
Step 6.2: Update Cyrus-SASL<br>
<br>
Let's see what we have:<br>
<br>
[rpm_user@example.com]# ls cyr*<br>
cyrus-sasl-1.5.27-t22.i386.rpm<br>
cyrus-sasl-authd-1.5.27-t22.i386.rpm<br>
cyrus-sasl-devel-1.5.27-t22.i386.rpm<br>
cyrus-sasl-gssapi-1.5.27-t22.i386.rpm<br>
cyrus-sasl-md5-1.5.27-t22.i386.rpm<br>
cyrus-sasl-plain-1.5.27-t22.i386.rpm<br>
<br>
We need at least the following RPMs installed in order to make Cyrus-SASL and Postfix work and Postfix get what it needs to when it has to compile with SASL support:<br>
<br>
cyrus-sasl-1.5.27-t22.i386.rpm<br>
cyrus-sasl-authd-1.5.27-t22.i386.rpm<br>
cyrus-sasl-devel-1.5.27-t22.i386.rpm<br>
<br>
Then you have to choose at least on of the following mechanisms to use when authenticating users:<br>
<br>
cyrus-sasl-gssapi-1.5.27-t22.i386.rpm<br>
cyrus-sasl-md5-1.5.27-t22.i386.rpm<br>
cyrus-sasl-plain-1.5.27-t22.i386.rpm<br>
<br>
In this HOWTO we are going to update and install the missing ones. We su to root and type:<br>
<br>
[root@example.com]# rpm -Uvh cyrus-sasl-*<br>
<br>
Before you go and get some fresh coffee, let's wrap things up to now up.<br>
Summary: Cyrus-SASL SRPM installation<br>
<br>
Tuomos Cyrus-SASL RPM did the following when we installed it:<br>
Cyrus-SASL<br>
<br>
* install cyrus-sasl binaries and libraries<br>
* install Cyrus-SASL mechanisms<br>
* add an init-script /etc/init.d/saslauthd to start the saslauthd required by the latter /usr/lib/sasl/smtpd.conf<br>
* add a /etc/pam.d/cyrus file, which will be used by the saslauthd to connect to PAM. <br>
<br>
That's it for now. We leave Cyrus-SASL the way it is and will build and install Postfix before we will return to configure SASL.<br>
<br>
Howto smtp auth with Postfix(8)<br>
<br>
(24 阅读) <br>
<br>
<br>
<br>
Postfix Installation from SRPMS provided by Tuomo Soini<br>
<br>
Tuomo Soini currently provides RPMs for Cyrus-SASL and for Postfix. He constructed the RPMs so that they fit together well, which means that when you install both of his RPMs you will be half the way through on your way to a nicely working version of Cyrus-SASL and Postfix.<br>
<br>
Tuomos RPMs are SOURCE RPMs. This means that they have to be compiled before we can install them. But before we do this, we'll have to download them.<br>
<br>
New to RPM?<br>
Source RPMs (or SRPMS) do not contain the ready-to-run binaries, but merly the sourcecode that still needs to be compiled. So we will compile the SRPMS first and install the RPM that we built afterwards. If you want to know more about RPM read this RPM HOWTO.<br>
Step 1: Download the SRPMS<br>
<br>
Point you Browser to http://tis.foobar.fi/software/ and download the current version of the Postfix SRPM to your future smtp-server.<br>
<br>
Note:<br>
By the time of writing this HOWTO current versions of Cyrus-SASL and Postfix are:<br>
cyrus-sasl-1.5.27-t22.src.rpm<br>
postfix-1.1.7-t4.src.rpm<br>
We'll be using these throughout this HOWTO.<br>
Step 2: Install SRPMS for compilation<br>
<br>
First we have to install the SRPMS into the RPM framework. Before you do that, please read this tiny Building RPMS and consider to follow the concept.<br>
<br>
Login and cd to the directory where you put the SRPM and install it with:<br>
<br>
[rpm_user@example.com]# rpm -ivh postfix-1.1.7-t4.src.rpm<br>
<br>
Now the SRPM is installed. Our next step is to configure and build it.<br>
Step 3: Configure and build Postfix-RPM from -SRPM<br>
<br>
First we change to the SPECS directory of our RPM framework:<br>
<br>
[rpm_user@example.com]# cd rpm/SPECS/<br>
<br>
Remember<br>
Postfix needs the SASL libraries at compilation time. If you don't have Cyrus-SASL installed yet, your Postfix build will fail. To get a working SASL either install from Cyrus-SASL SRPM or from Cyrus-SASL SOURCE.<br>
Tuomo's Version of Postfix comes with support for many additional features. You can trigger enabling or disabling them when you build the RPM. All you need to do is add --with FEATURE or --without FEATURE to the command line. We want SASL and TLS for this HOWTO and will not add anything else. If you want more features you either add them to the following statement or rebuild and reinstall Postfix later once you have smtp auth up and running. So let's find out what is in the SRPM to help you decide.<br>
<br>
In order to get to know the features that come with the SRPM you use the following command:<br>
<br>
[rpm_user@example.com]# rpm -qpil postfix-1.1.7-t4.src.rpm<br>
<br>
We build the RPM as follows:<br>
<br>
[rpm_user@example.com]# rpmbuild -ba --without ldap --without pgsql --without mysql postfix.spec<br>
<br>
In case that the RPM Manager complains about missing dependencies you decide on your own if you need to install them first or just tell the RPM Manager to build --without. If everything runs through we've successfully configured and built our customized Postfix RPM.<br>
Step 4: Remove Sendmail<br>
<br>
RedHat Linux comes with Sendmail preinstalled. Since we want to use Postfix instead, we first will have to remove the sendmail RPM. If we only issue rpm -e sendmail the RedHat Package Manager will complain that there are many other applications that need Sendmails functionality.<br>
<br>
Right, but we want Postfix to take over and Postfix will provide binaries that will mend what we will break. So we override the RedHat Package Manager's complaints and advise it, not to check for dependencies when ordered to erase existing Sendmail RPM. Since not every user is allowed to install and uninstall software we su to root first.<br>
<br>
[root@example.com]# rpm -e --nodeps sendmail<br>
<br>
So Sendmail has just left the building. In comes Postfix...<br>
Step 5: Install Postfix<br>
<br>
To install the Postfix RPM we go back to the directory where our newly built RPMs have been put by the RedHat Package Manager:<br>
<br>
[root@example.com]# cd ~rpm_user/rpm/RPMS<br>
[root@example.com]# rpm -ivh postfix-1.1.7-t4.i386.rpm postfix-utils-1.1.7-t4.i386.rpm<br>
<br>
Note<br>
The postfix-utils-1.1.7-t4.i386.rpm installs a few utilities e.g. a perl script that summarizes the daily mailtraffic and prints out a lot of other useful information. It will be called by a cron-job and the output will be mailed to postmaster@localhost.<br>
<br>
That's it for the installation. If everything wen't fine you've successfully installed Postfix from RPM.<br>
<br>
Before you go and get some fresh coffee, let's wrap things up to now up.<br>
Summary<br>
<br>
Tuomos Postfix RPM did the following when you installed it:<br>
Postfix<br>
<br>
* install Postfix binaries and helper applications<br>
* install the configuration files to /etc/postfix/<br>
* install the samples and LICENSE to /etc/postfix/samples/<br>
* install documentation (man, html)<br>
* add a smtpd.conf file to /usr/lib/sasl<br>
This file tells sasl how we want to authenticate smtpd queries for authentication. By default it is set to 'pwcheck_method:saslauthd', which means that it we want to use the saslauth deamon. If you want to use sasldb stick with this HOWTO. We will enquire this as we get to know our way around configuring Cyrus-SASL<br>
* install /etc/cron.daily/postfix.cron a cron file that is run on a daily basis. It rebuilds your .db files and copies changed files to the chroot-dir even if you don't have that configuration enabled.<br>
* additionally if you installed: postfix-utils-1.1.7-t4.i386.rpm<br>
install /usr/sbin/pflogsumm.pl a perl-script that will mail you daily stats, if you add this script 1postfix to /etc/cron.daily and chmod 755 1postfix and chown root:root 1postfix the file. <br>
<br>
OK. Now take a break. The upcomming configuration will need your full attention again... ;-)<br>
<br>
Howto smtp auth with Postfix(9)<br>
<br>
(20 阅读) <br>
<br>
<br>
<br>
Cyrus-SASL configuration (saslauthd)<br>
You installed SASL from Tuomos RPM?<br>
<br>
There's nothing to be configured at the moment. Tuomos Cyrus-SASL and Postfix RPMs took care of the most basic needs, when they added a few extra files and directories.<br>
All we need for the moment is to start the saslauthd.<br>
<br>
[root@example.com]# /etc/init.d/saslauthd start<br>
<br>
Howto smtp auth with Postfix(10)<br>
<br>
(34 阅读) <br>
<br>
<br>
<br>
Basic Postfix configuration and preparation for smtp auth<br>
<br>
Before we proceed to our part of the configuration we must disable a feature that was set when Tuomos Postfix RPM was installed. Remember it comes built with support for the Cyrus-IMAP Server? We're not going to use the Cyrus-IMAP Server in this HOWTO. So let's disable this setting, as we don't want it to interfere with our setup at the moment.<br>
Edit main.cf<br>
<br>
Postfix main configuration is done in the /etc/postfix/main.cf. Use your favorite editor to edit the file. We are going to use vi throughout this HOWTO.<br>
<br>
[root@example.com]# vi /etc/postfix/main.cf<br>
Step 1: Disable Cyrus-IMAP setting<br>
<br>
We will not need mailbox_transport = lmtp:unix:/var/imap/socket/lmtp because this is a setting that applies not only but especially for Cyrus-IMAP server which we will not be using. Find the line that reads mailbox_transport = lmtp:unix:/var/imap/socket/lmtp and disable it. When you are done it should read as follows:<br>
<br>
#mailbox_transport = lmtp:unix:/file/name<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -