0

配置postfix转发局域网邮件以及邮件黑洞

 7 months ago
source link: https://bajie.dev/posts/20240124-postfix_blackhole/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

配置postfix转发局域网邮件以及邮件黑洞

2024-01-24 1 分钟阅读

配置postfix允许自由转发内网的邮件,就改一个地方即可,添加允许发送的内网网段:

vi /etc/postfix/main.cf  
...
mynetworks = 127.0.0.0/8, 172.16.0.0/16  
...

配置黑洞,所有邮件都接受,然后drop丢掉

relayhost =  
relay_transport = relay  
relay_domains = static:ALL  
smtpd_end_of_data_restrictions = check_client_access static:discard  

当然,也可以把这些邮件都给送到amavis去,训练它识别垃圾邮件

测试邮件发送的命令:

echo "body of your email" | mail -s "This is a Subject os version" -r "[email protected]" [email protected]  

注意:CentOSUbuntu默认居然都没有mail这条命令的话

yum install mailx  
apt-get install bsd-mailx  

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK