# tar zxf postfix-2.1.5.tar.gz
# cd postfix-2.1.5 # make # make installいくつか質問されますが,デフォルトのままでOKです.
# cd postfix-2.1.5 # make tidy (以前コンパイルした場合) # make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/include" AUXLIBS="-L/usr/lib -lsasl" # make # make installいくつか質問されますが,デフォルトのままでOKです.
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.kmisu.net #メールサーバのドメイン名を含めたホスト名
mydomain = kmisu.net # メールサーバのドメイン名
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain, thisserver.$mydomain # 受信するドメイン名
unknown_local_recipient_reject_code = 450
mynetworks_style = subnet
mynetworks = 192.168.0.0/24, 127.0.0.0/8 # ルータの内側にいるので,プライベートアドレスで指定
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = no
allow_mail_to_commands = alias,forward,include # fmlのための設定
## SASL認証のための設定
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
## Reject_Listのための設定
smtpd_client_restrictions=permit_mynetworks,check_client_access hash:/etc/postfix/reject_list,reject_unauth_destination
content_filter = smtp:127.0.0.1:10024 # 後述のAntiVir用の設定
html_directory = no |
# /usr/sbin/postmap /etc/postfix/reject_list # service postfix reloadとコマンド入力します.
smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
localhost:smtp-backdoor inet n - n - - smtpd -o content_filter= # AntiVir用
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
trace unix - - n - 0 bounce
verify unix - - n - 1 verify |
# vi pwcheck_method: saslauthd saslauthd_version: 2
# saslpasswd2 -c -u kmisu.net user1 # 最初は『-c』をつける # saslpasswd2 -u kmisu.net user2 # 2人目以降 # saslpasswd2 -u kmisu.net user3
# saslpasswd2 -d -u kmisu.net UserName
# sasldblistusers2 user1@kmisu.net: userPassword user2@kmisu.net: userPassword user3@kmisu.net: userPassword
# chgrp smmsp /etc/sasldb2 # chmod 640 /etc/sasldb2
# tar zxf antivir-mailgate-pers.tar.gz
-b /usr/lib/AntiVir -b /usr/sbin/avgated -b /usr/sbin/avgatefwd |
# cd antivir-mailgate-pers # perl avinstall.pl
# Content Filter for postfix antivir 10024/tcp #Port for avgated smtp-backdoor 10025/tcp #Port for postfix |
EmailTo root@kmisu.net LogTo /var/log/antivir.log AutoUpdateDaily AutoUpdateTime 4:23 |
# Select interface and port, the smtp daemon will listen on. # Port may be given as a number or a service name. ListenAddress localhost port antivir # Select how mail should be forwarded. # Send mail by piping it thru sendmail (this is the default) #ForwardTo /usr/sbin/sendmail -oem -oi # Or if you want the mail to be sent by SMTP ForwardTo SMTP: localhost port smtp-backdoor |
localhost:smtp-backdoor inet n - n - - smtpd -o content_filter= |
# for Antivir MailGate
content_filter = smtp:127.0.0.1:10024 |
# /usr/lib/AntiVir/antivir --update
このサイト上で提供しているインストール法,設定例を,
適用した結果生じたいかなる障害・損害に対しても,
私(K.Misu)は責任を負いません.
このサイト上で提供している情報を利用する場合は,
各人の自己責任にて判断,適用して下さい.