構成は
postfix
dovecot
SSLはWebサーバーのLets Encryptから引っ張る
bindを走らせる。
fml8でメーリングリストを可能とする。
ユーザはスクリプトで一括作成
というような設定。
※saslを明示的に入れる必要は無さそうだ。
手っ取り早く入れるのであれば、
apt-get install postfix dovecot-pop3d dovecot-imapd maildrop -y
(1)bind9
pkg search bind9 とすると、bind9が該当するので、入れる
apt-get install bind9
bind9utilsも依存ファイルとしてインストールされる。
(2)postfix
"postfix/stable 3.4.14-0+deb10u1 armhf"が該当。
apt-get install postfix
現用中の鯖からmain.cfとmaster.cfを引っ張ってくるので、一番上の"No Configuration"を選んで終了。
(3)dovecot
dovecot-core/stable 1:2.3.4.1-5+deb10u4 armhf
secure POP3/IMAP server - core files
dovecot-imapd/stable 1:2.3.4.1-5+deb10u4 armhf
secure POP3/IMAP server - IMAP daemon
dovecot-pop3d/stable 1:2.3.4.1-5+deb10u4 armhf
secure POP3/IMAP server - POP3 daemon
と3つ候補が出てきたが、dovecot-pop3d と dovecot-imapdを入れるとdovecot-core が入った筈(うろおぼえ)なので以下とする。
apt-get install dovecot-pop3d dovecot-imapd
The following additional packages will be installed:
dovecot-core libexttextcat-2.0-0 libexttextcat-data liblua5.3-0 libsodium23 libstemmer0d
当たりで良かった。
(4)sasl2
sasl2-bin/stable 2.1.27+dfsg-1+deb10u1 armhf Cyrus SASL - administration programs for SASL users database
これが該当。
apt-get install sasl2-bin
あと↓を入れ忘れて大変な目にあった。
apt-get install libsasl2-modules
(5)maildrop
maildrop/stable 2.9.3-2+b1 armhf
mail delivery agent with filtering abilities (set-GID=mail)
これが該当。
apt-get install maildrop
(6)spamassassin
spamassassin/stable 3.4.2-1+deb10u2 all
Perl-based spam filter using text analysis
これが該当
apt-get install spanassassin
あとそれから、
update-rc.d
としないと、spamdが起動しないので注意。
sa-update した後、/etc/mail/spamassassin/local.cf を適宜編集。
12c12
< rewrite_header Subject *****SPAM*****
---
> # rewrite_header Subject *****SPAM*****
18c18
< report_safe 1
---
> # report_safe 1
34c34
< required_score 5.0
---
> # required_score 5.0
(6)/etc/skel の編集
・dot.mailfilter を作成。permissionを600にしておく。
・dot.spamassassin ディレクトリを作成、permissionは777
・maildirmake Maildir として、maildirを作成。
(7)ユーザをスクリプトで作る
例えばuid:10000 で admin なるユーザを作るときは
/usr/sbin/groupadd -g 10000 admin
/usr/sbin/useradd -u 10000 -g 10000 -p `perl -e "print(crypt('password', '12'));"` -s /bin/bash -m -d /home/admin admin
というように書く。
※FreeBSDではこの方法が使えないので、pwコマンドにて、半自動。