執行以下指令, 建立 server 端的 CA 與 key-pair.
請特別留意, 當畫面上提示輸入 Common Name 的時候, 請務必輸入機器的全名(FQDN)否則將來 user 連線都時候將會出現警告訊息, 造成 user 的困擾.另外mail address的路徑請設為 /var/mail
當螢幕提示輸入 PEM pass phrase 的時候, 請輸入上一步驟中的公正單位密碼.
加入以下幾行:
dnl The following lines are used to enable the STARTTLS function
define(`CERT_DIR', `/etc/mail/cert')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/cacert.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
dnl The following lines are used to enable CYRUS-SASL function
define(`confAUTH_MECHANISMS',`CRAM-MD5 DIGEST-MD5 LOGIN PLAIN')dnl
TRUST_AUTH_MECH(`CRAM-MD5 DIGEST-MD5 LOGIN PLAIN')dnl
FEATURE(`access_db')dnl
FEATURE(local_procmail)
MAILER(procmail)dnl
MAILER(smtp)dnl
4.2 clamav-milter
Nigel Horne’s clamav-milter is a very fast email scanner designed for Sendmail. It’s
written entirely in C and only depends on clamd. You can find detailed installation
instructions in the INSTALL file that comes with the clamav-milter sources. Basically,
to connect it with Sendmail add the following lines to /etc/mail/sendmail.mc:
INPUT_MAIL_FILTER(‘clmilter’,‘S=local:/var/run/clmilter.sock,
F=, T=S:4m;R:4m’)dnl
define(‘confINPUT_MAIL_FILTERS’, ‘clmilter’)
Check entry in clamd.conf of the form:
LocalSocket /var/run/clamd.sock
Start clamav-milter
/usr/local/sbin/clamav-milter -lo /var/run/clmilter.sock
and restart sendmail.
當然原廠也會提供適當的參數和方法供我們使用
首先安裝clamav
cd /usr/ports/security/clamav
make install clean
修改sendmail.mc
# vi sendmail.mc
加入以下幾行:
dnl The following lines are used to enable the STARTTLS function
define(`CERT_DIR', `/etc/mail/cert')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/cacert.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
dnl The following lines are used to enable CYRUS-SASL function
define(`confAUTH_MECHANISMS',`CRAM-MD5 DIGEST-MD5 LOGIN PLAIN')dnl
TRUST_AUTH_MECH(`CRAM-MD5 DIGEST-MD5 LOGIN PLAIN')dnl
FEATURE(`access_db')dnl
FEATURE(`delay_checks')dnl
FEATURE(local_procmail)
MAILER(procmail)dnl
MAILER(smtp)dnl
INPUT_MAIL_FILTE(`clmilter',`S=local:/var/run/clamav/clmilter.sock,F=, T=S:4m;R:4m')
define(`confINPUT_MAIL_FILTERS', `clmilter')