postmaster@example.com OK
webmaster@example.com OK
因此,外域只能发送给以上两个Email地址,其他任何地址都将被拒绝。但本机到本机发送不受影响。
最后用postmap生成hash格式的文件:
# postmap sender_access
# postmap recipient_access
启动Postfix:
# /etc/init.d/postfix start
设置到启动组里:
# chkconfig postfix on
现在就可以通过telnet来测试了:(红色是输入的命令)
220 mail.example.com ESMTP Postfix
helo localhost
250 mail.example.com
mail from:test@gmail.com
250 Ok
rcpt to:webmaster@example.com
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
hello!!!!!!
.
250 Ok: queued as D68E41407D0
mail from:test@gmail.com
250 Ok
rcpt to:haha@example.com
554 <haha@example.com>: Recipient address rejected: Access denied
quit
221 Bye