postfix配置&使用
myorigin = $mydomain #以“user@example.com”(而不是“user@hostname.example.com”)发送邮件,
#这样就没有理由将邮件发送到“user@hostname.example.com”。
# 一般使用domain name,而不使用hostname
relayhost = $mydomain #将所有邮件转发到负责“example.com”域的邮件服务器。
#如果在某些远程目标无法访问时关闭邮件,则可以防止邮件卡在空客户端上。
#如果您的“example.com”域没有MX记录,请在此处指定真实的主机名。
# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
# transport table (转发规则表) > relayhost > $mydestination
inet_interfaces = loopback-only #不接受来自网络的邮件。
# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on.指定接受邮件的网卡地址
mynetworks = 127.0.0.0/ 10.0.0.0/ #指定可信网络。
# The mynetworks parameter specifies the list of "trusted" SMTP clients that have more privileges than "strangers".
relay_domains = #此主机不会从不受信任的网络中继邮件。
#The relay_domains parameter restricts what destinations this system will relay mail to.# 指定收件人的域名,也就是允许中继的域名
mydestination = #禁用本地邮件传递。所有邮件都按照第【relay_domains】的说明进入邮件服务器。
# The mydestination parameter specifies the list of domains that this
# machine considers itself the final destination for.# 指定本地邮件域
例子1:
mydomain = qq.com #inet_interfaces = localhost
inet_interfaces = all # 所有网卡都接受邮件 mynetworks_style = subnet # 通过子网形式显示信任网络 mynetworks = 168.100.189.0/, 127.0.0.0/8 # 指定信任网络 #relay_domains = $mydestination
relay_domains = #relayhost = [gateway.my.domain]
relayhost = [gateway.my.domain]
例子2:
mydomain = qq.com #inet_interfaces = localhost
inet_interfaces = all #mynetworks_style = subnet #mynetworks = 168.100.189.0/, 127.0.0.0/ #relay_domains = $mydestination
relay_domains = qq1.com,qq2.com... # 只允许中继这些域 #relayhost = [gateway.my.domain]
relayhost = [gateway.my.domain]
# 强制发送队列中的邮件
postfix flush
postqueue -f
# 查看邮件队列大小
mailq | wc -l
postqueue -p |wc -l
# 查看队列中的邮件
mailq
postqueue -p
# 查看特定邮件内容
postcat -q Queue_ID
# 按邮件ID删除队列中的邮件
postsuper -d Queue_ID
# 暂缓发送队列中的邮件
postsuper -h Queue_ID
postsuper -h ALL deferred
# 解除暂缓发送
postsuper -H Queue_ID
postsuper -H ALL deferred
# 重新加入队列
postsuper -r Queue_ID
postsuper -r ALL
# 删除队列中的问题邮件
postsuper -d ALL deferred
find /var/spool/postfix/deferred -type f -exec rm -vf {} \;
# 删除3天以内未发出的邮件
find /var/spool/postfix/deferred -type f -mtime +3 -exec rm -f {} \;
# 删除超过5天的问题邮件的退信记录
find /var/spool/postfix/defer -type f -mtime +5 -exec rm -f {} \;
# 列出所有问题邮件
find /var/spool/postfix/deferred -type f -exec ls -l --time-style=+%Y-%m-%d_%H:%M:%S {} \;
# 复杂用法:利用grep得到特定的邮件ID,再删除,如:(待确认????????????????)
mailq | grep -B 1 "Hotconcerts@gmail.com" | cut -f 1 -d ! > deletionIDs" $ cat deletionIDs | postsuper -d -
postfix有四种不同的邮件队列,并且由队列管理进程统一进行管理:
1. maildrop:本地邮件放置在maildrop中,同时也被拷贝到incoming中。
2. incoming:放置正在到达或队列管理进程尚未发现的邮件。
3. active:放置队列管理进程已经打开了并正准备投递的邮件,该队列有长度的限制。
4. deferred:放置不能被投递的邮件。
## 常用管理命令
# 重新读取postfix配置文件
postfix reload
# 检查配置
postfix check
# 显示配置内容,在mail.cf配置过的
postconf -n
# 所有配置内容,包括默认配置内容
postconf
postfix配置&使用的更多相关文章
- linux邮件服务器postfix配置实例
linux邮件服务器postfix配置实例(超级详细!!!) 2013-03-13 13:30:21 标签:邮件服务器 linux 1. 系统安装:1)centos4.3 选上MAIL组件里的全部.2 ...
- postfix配置积累(不断的积累)
postfix 配置 1.mail_name 默认是Postfix.在收件人信头可以查看,如果不想让别人知道你是用postfix发的,则可以改成其它名字,如:postconf -e mail_name ...
- Postfix配置Q&A
原文地址:http://space.doit.com.cn/51460/viewspace-4943.html 在配置Postfix中遇到的一些问题及相关的解决方法,希望在遇到相同的问题时能起参考的作 ...
- postfix配置spf认证和dkim认证
1.为邮箱域名添加spf认证: 登录域名解析控制台添加txt记录: v=spf1 include:spf1.domain.com ~all spf1.domain.com A记录解析到你的固定IP ...
- Linux postfix配置方法
第七题 配置邮件服务器 postfix学习网站:https://blog.csdn.net/mycms5/article/details/78773308 system1和systemc2分别执行 ...
- 烂泥:Postfix邮件服务器搭建之软件安装与配置
本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb Postfix邮件服务器的搭建需要使用到几个软件,分别是cyrus-sasl.postf ...
- CentOS6.5_64位系统下安装配置postfix邮件系统 启用并配置SMTP在第三方上边使用发送邮件
一前言 本来使用qq邮箱发送邮件,然后借助sendEmail来发送邮件告警,但是有每天的200封限制,很是不爽,于是想到来自己搭建邮件服务器来解决这个问题,关于使用sendEmail来借助qq邮箱来发 ...
- Linux学习19-gitlab配置邮箱postfix(新用户激活邮件)
前言 gitlab新增新用户有两种方式,第一种可以用户主动注册(自己设置密码):第二种也可以通过root管理员用户直接添加用户,发个邮件到用户的邮箱里,收到邮件后激活. 如果是第二种方式添加新用户的话 ...
- Linux中Postfix邮件安装配置(二)
本套邮件系统的搭建,从如何发邮件到收邮件到认证到虚拟用户虚拟域以及反病毒和反垃圾邮件等都有详细的介绍.在搭建过程中必须的参数解释以及原理都有告诉,这样才能更好地理解邮件系统. 卸载自带postfix ...
随机推荐
- java中字符串“不可变性”的破坏,使用反射破坏final属性。以及涉及到字符串常量池的问题。
大家都清楚java中String类是不可变的,它的定义中包含final关键字.一旦被创建,值就不能被改变(引用是可以改变的). 但这种“不可变性”不是完全可靠的,可以通过反射机制破坏.参考一下代码: ...
- 微信小程序中的小小的遮罩层
<view class='pop_wx_er'> <view>ddddddddddddd</view> <view>ddddddddddddd</ ...
- python基础—字符串的常用函数“”
#字符串常用语法name = "wang yan li"print(name.capitalize())#首字母大写print(name.count("n")) ...
- Python_文件处理
1.Python 文件处理 打开文件---->读取内容---->获得内容 读取文件方式: r 只读文件 w 只写模式 a 追加模式 r+b 读写模式 w+b 写读模式 a+b ...
- ios12更新开发者需要做的
1.StatusBar内部结构改变 现象:crash crash log: -[_UIStatusBarIdentifier isEqualToString:]: unrecognized selec ...
- TFS2015安装、配置
一.安装,参考:http://www.cnblogs.com/WilsonWu/archive/2011/11/24/2261674.html 二.配置,参考:http://www.cnblogs.c ...
- WEB学习笔记5-标准的HTML页面结构
完整的文档包含一下 <html> <head> </head> <body> </body> </html> 在HTML5规范中 ...
- yarn安装
Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载.React Native的命令行工具用于执行创建.初始化.更新项目.运行打包服务(packager)等任务. 先安装nod ...
- OO第三次博客总结
一. 规格发展历史 从20世纪60年代开始,就存在着许多不同的形式规格说明语言和软件开发方法.在形式规格说明领域一些最主要的发展过程列举如下: 1969-1972 C.A.R Hoare撰写了&quo ...
- docker3
Docker容器的设置资源(cpu,内存)限制: #docker run –memory=200M xxxx-image --vm 1 –verbose #docker run --cpu-s ...