当前位置:网站首页>Postfix变成垃圾邮件中转站后的补救
Postfix变成垃圾邮件中转站后的补救
2022-04-23 05:43:00 【慕美文】
公司邮件服务器最近被当作中转站大量转发广告邮件,这里记录下补救过程。
- 先把队列里的垃圾邮件发送任务清空;
停止sendmail服务
#service sendmail stop
清空发件任务
#rm -rf /var/spool/mqueue/*
启动sendmail服务
#service sendmail start
- 禁止转发,启用黑名单
修改postfix的配置文件main.cf
#vim /etc/postfix/main.cf
将myhostname指向邮件服务的域名
myhostname = mail.xiabian.com
mydomain参数指向根域
mydomain = xiabian.com
myorigin指向mydomain
myorigin = $mydomain
mydestination指向mydomain
mydestination = $mydomain
监听所有IP
inet_interfaces = all
设置只信任本机
mynetworks_style = host
配置mydomain才能够被Postfix转发
relay_domains = $mydomain
对邮件的发送进行控制
外域到本域的邮件,全部接收
本域到外域的邮件,只允许本机发送
外域到外域的邮件,拒绝发送
设置发件人规则,允许本域地址,且拒绝sender_access文件里包含的发件人
防止其他用户从外部以[email protected]身份发送邮件,但登录到本机再发送则不受影响
第一条规则permit_mynetworks是允许本机登录用户发送邮件
smtpd_sender_restrictions = permit_mynetworks, check_sender_access
hash:/etc/postfix/sender_access, permit
/etc/postfix/sender_access的内容
xiabian.com REJECT
设置收件人规则,允许本域地址,且允许recipient_access文件里包含的收件人
smtpd_recipient_restrictions = permit_mynetworks, check_recipient_access
hash:/etc/postfix/recipient_access, reject
/etc/postfix/recipient_access的内容
外域只能发送给以下两个Email地址,其他任何地址都将被拒绝,但本机到本机发送不受影响
[email protected] OK
[email protected] OK
用postmap生成hash格式的文件
#postmap sender_access
#postmap recipient_access
启动Postfix
#/etc/init.d/postfix start
版权声明
本文为[慕美文]所创,转载请带上原文链接,感谢
https://blog.csdn.net/penetrate/article/details/92834541
边栏推荐
- Excel sets row and column colors according to cell contents
- MySQL lock mechanism
- MySQL的锁机制
- 一文读懂当前常用的加密技术体系(对称、非对称、信息摘要、数字签名、数字证书、公钥体系)
- C语言——恶搞关机小程序
- JDBC连接数据库
- Error 2003 (HY000) when Windows connects MySQL: can't connect to MySQL server on 'localhost' (10061)
- MySQL transaction
- 多线程与高并发(2)——synchronized用法详解
- Issue 36 summary of atcoder beginer contest 248
猜你喜欢
随机推荐
C语言——恶搞关机小程序
Flutter 新一代圖形渲染器 Impeller
热键,界面可视化配置(界面交互)
No.1.#_ 6 Navicat shortcuts
AcWing 1096. Detailed notes of Dungeon Master (3D BFS) code
一文读懂当前常用的加密技术体系(对称、非对称、信息摘要、数字签名、数字证书、公钥体系)
Frequently asked interview questions - 2 (computer network)
Data mining -- understanding data
Character recognition easyocr
protected( 被 protected 修饰的成员对于本包和其子类可见)
Establish excel bookkeeping book through setting context menu
MySQL创建oracle练习表
opensips(1)——安装opensips详细流程
SQL statement simple optimization
mysql如何将存储的秒转换为日期
POI exports to excel, and the same row of data is automatically merged into cells
JVM系列(3)——内存分配与回收策略
Sword finger offer II 022 The entry node of the link in the linked list
mysql sql优化之Explain
MySQL的锁机制