FreeBSD 11.3 RELEASE - qmail - 概要・インストール

クラウディア 
1. 概要
2. qmail
3. procmail
4. checkpassword
5. tcpserver
6. sendmail から qmail へ

1. 概要

 「FreeBSD」では、メールサーバ用のアプリケーションとして、デフォルトで「sendmail」が用意されています。  ここでは、「sendmail」でなく、「qmail」の設定方法を記述します。  「qmail」より「postfix」をお勧めしている方もたくさんいらっしゃいます。  多くの意見を参考にして、御自分でどの「MTA」を使用するかを判断されるのがよいかと思います。  「qmail」の詳細な設定については「メンテナンス・トラブルシュート - メールサーバ」に書いてあります。  ログの設定等についてもそちらをご参照ください。  以下、必要な「ports」をインストールしていきます。

2. qmail


cd /usr/ports/mail/qmail/
make config
 下記が、デフォルトのオプションになります。
「FreeBSD 11.3 RELEASE」-「/usr/ports/mail/qmail」「make config ①」
「FreeBSD 11.3 RELEASE」-「/usr/ports/mail/qmail」「make config ②」

 オプションは、よくわからないものがあり、参考サイトのリンクを掲載していましたが、リンク切れになってしまいました。
 デフォルトの設定に加えて、以下のオプションにチェックをいれておきます。

・DISCBOUNCES_PATCH  ダブルバウンスメールの扱いを他の「MTA」と同様にする
・LOCALTIME_PATCH  日本時間で処理できるようにする

 以下のオプションからはチェックをはずしておきます。

・RCDLINK  qmail の自動起動スクリプトをインストールする(本サイトの設定では使用しません)
・SMTP_AUTH_PATCH  SMTP 認証機能を追加する

 本サイトの設定では SMTP_AUTH_PATCH に対応していませんので チェックを外してください 

 後はデフォルトで構わないかと思います。


cd /usr/ports/mail/qmail/
make
make install
 インストール時のメッセージを掲載しておきます。

Installing netqmail-1.06_4...
===> Creating groups.
Creating group 'qmail' with gid '82'.
Creating group 'qnofiles' with gid '81'.
===> Creating users
Creating user 'alias' with uid '81'.
Creating user 'qmaild' with uid '82'.
Creating user 'qmaill' with uid '83'.
Creating user 'qmailp' with uid '84'.
Creating user 'qmailq' with uid '85'.
Creating user 'qmailr' with uid '86'.
Creating user 'qmails' with uid '87'.
Your hostname is vm.sing.ne.jp.
hard error
Sorry, I couldn't find your host's canonical name in DNS.
You will have to set up control/me yourself.
        ATTENTION:

You can enable qmail as your default mailer executing:
> /var/qmail/scripts/enable-qmail

===> SECURITY REPORT:
      This port has installed the following binaries which execute with
      increased privileges.
/var/qmail/bin/qmail-queue

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.qmail.org/

3. procmail


cd /usr/ports/mail/procmail/
make config
「FreeBSD 11.3 RELEASE」-「」「make config」

 オプションはデフォルトのままで。


cd /usr/ports/mail/procmail/
make
make install

4. checkpassword


cd /usr/ports/security/checkpassword/
make config
「FreeBSD 11.3 RELEASE」-「/usr/ports/security/checkpassword」「make config」

 オプションはデフォルトのままで。


cd /usr/ports/security/checkpassword/
make
make install

5. tcpserver


cd /usr/ports/sysutils/ucspi-tcp/
make config
 デフォルトのオプションです。
「FreeBSD 11.3 RELEASE」-「/usr/ports/sysutils/ucspi-tcp」「make config」「デフォルト」

 SSL ポートを使用する場合、SSL のオプションに必ずチェックをいれておきます。
 SSL のチェックをいれると IPV6 と両立できませんので、必ず  IPV6 のチェックをはずします。

 結局のところわたしが行っている設定は

「FreeBSD 11.3 RELEASE」-「/usr/ports/sysutils/ucspi-tcp」「make config」「わたしの設定」

 他のオプションに関して参考サイトを調べています。

 参考サイト「実用qmailサーバ運用・管理術(3)」-「SPAMメール徹底対策 (2/3)」


cd /usr/ports/sysutils/ucspi-tcp/
make
make install
 インストール時のメッセージを掲載しておきます。

===>  Installing for ucspi-tcp-0.88_2
===>  Checking if ucspi-tcp is already installed
===>   Registering installation for ucspi-tcp-0.88_2
Installing ucspi-tcp-0.88_2...
===>   NOTICE:

The ucspi-tcp port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port

===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/bin/tcpserver

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://cr.yp.to/ucspi-tcp.html

6. sendmail から qmail へ

 前項までの ports をインストールしていれば

/var/qmail/
 以下に qmail 用のディレクトリは自動的に作られていますし、ユーザ群、グループ群も作成されます。  インストール後に vipw コマンドでのぞいてみると

alias:*:81:81::0:0:QMail user:/var/qmail/alias:/nonexistent
qmaild:*:82:81::0:0:QMail user:/var/qmail:/nonexistent
qmaill:*:83:81::0:0:QMail user:/var/qmail:/nonexistent
qmailp:*:84:81::0:0:QMail user:/var/qmail:/nonexistent
qmailq:*:85:82::0:0:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82::0:0:QMail user:/var/qmail:/nonexistent
qmails:*:87:82::0:0:QMail user:/var/qmail:/nonexistent
 という具合に出来上がっているはずです。  qmail インストール後に

/var/qmail/scripts/enable-qmail
 という qmail に置き換えるためのスクリプトが用意されていますので、これを実行します。

> /var/qmail/scripts/enable-qmail
===> I hope you know what you are doing:
===> You just told your system to not
===> automaticaly start sendmail on your
===> next startup.
===> (i.e., added sendmail_enable="NONE" to rc.conf)
===> Do not forget to choose an appropriate qmail startup
===> script. Go through /var/qmail/boot, choose one
===> and copy the chosen script as /var/qmail/rc
===> For example, "cp /var/qmail/boot/proc+df /var/qmail/rc"
ハイスピードプラン【usus ウズウズ】