SASLのインストール
# portinstall security/cyrus-sasl2-saslauthd
/etc/make.conf に以下を追加
SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl2
sendmail のコンパイルとインストール
# cd /usr/src/lib/libsm
# make obj && make depend && make
# cd /usr/src/lib/libsmutil
# make obj && make depend && make
# cd /usr/src/usr.sbin/sendmail
# make obj && make depend && make && make install
(ソースコードの取得は「FreeBSDのソースコード取得」を参照)
sendmail の make で次のようなエラーが出る場合
cc1: warnings being treated as errors
/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sasl.c: In function 'sm_sasl_init':
/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sasl.c:141: warning: passing argument 1 of 'sasl_set_alloc' from incompatible pointer type
/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sasl.c:141: warning: passing argument 2 of 'sasl_set_alloc' from incompatible pointer type
/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sasl.c:141: warning: passing argument 3 of 'sasl_set_alloc' from incompatible pointer type
*** [sasl.o] Error code 1
/usr/src/contrib/sendmail/src/sasl.c を以下のように修正
--- /usr/src/contrib/sendmail/src/sasl.c 2014-09-23 10:16:56.000000000 +0900
+++ /usr/src/contrib/sendmail/src/sasl.c.new 2014-09-23 10:18:05.000000000 +0900
@@ -137,8 +137,8 @@
void
sm_sasl_init()
{
- sasl_set_alloc(sm_sasl_malloc, sm_sasl_calloc,
- sm_sasl_realloc, sm_sasl_free);
+ sasl_set_alloc((sasl_malloc_t *)sm_sasl_malloc, (sasl_calloc_t *)sm_sasl_calloc,
+ (sasl_realloc_t *)sm_sasl_realloc, (sasl_free_t *)sm_sasl_free);
}
/*
** INTERSECT -- create the intersection between two lists