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配置&使用的更多相关文章

  1. linux邮件服务器postfix配置实例

    linux邮件服务器postfix配置实例(超级详细!!!) 2013-03-13 13:30:21 标签:邮件服务器 linux 1. 系统安装:1)centos4.3 选上MAIL组件里的全部.2 ...

  2. postfix配置积累(不断的积累)

    postfix 配置 1.mail_name 默认是Postfix.在收件人信头可以查看,如果不想让别人知道你是用postfix发的,则可以改成其它名字,如:postconf -e mail_name ...

  3. Postfix配置Q&A

    原文地址:http://space.doit.com.cn/51460/viewspace-4943.html 在配置Postfix中遇到的一些问题及相关的解决方法,希望在遇到相同的问题时能起参考的作 ...

  4. postfix配置spf认证和dkim认证

    1.为邮箱域名添加spf认证: 登录域名解析控制台添加txt记录: v=spf1 include:spf1.domain.com ~all spf1.domain.com  A记录解析到你的固定IP ...

  5. Linux postfix配置方法

    第七题 配置邮件服务器 postfix学习网站:https://blog.csdn.net/mycms5/article/details/78773308  system1和systemc2分别执行 ...

  6. 烂泥:Postfix邮件服务器搭建之软件安装与配置

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb Postfix邮件服务器的搭建需要使用到几个软件,分别是cyrus-sasl.postf ...

  7. CentOS6.5_64位系统下安装配置postfix邮件系统 启用并配置SMTP在第三方上边使用发送邮件

    一前言 本来使用qq邮箱发送邮件,然后借助sendEmail来发送邮件告警,但是有每天的200封限制,很是不爽,于是想到来自己搭建邮件服务器来解决这个问题,关于使用sendEmail来借助qq邮箱来发 ...

  8. Linux学习19-gitlab配置邮箱postfix(新用户激活邮件)

    前言 gitlab新增新用户有两种方式,第一种可以用户主动注册(自己设置密码):第二种也可以通过root管理员用户直接添加用户,发个邮件到用户的邮箱里,收到邮件后激活. 如果是第二种方式添加新用户的话 ...

  9. Linux中Postfix邮件安装配置(二)

    本套邮件系统的搭建,从如何发邮件到收邮件到认证到虚拟用户虚拟域以及反病毒和反垃圾邮件等都有详细的介绍.在搭建过程中必须的参数解释以及原理都有告诉,这样才能更好地理解邮件系统. 卸载自带postfix ...

随机推荐

  1. python实现文件的复制

      # 练习: # 1. 写程序,实现文件的复制,(注:只复制文件,不复制文件夹) # 要求: # 1) 要考虑文件关闭的问题 # 2) 要考虑超大文件无法一下加载到内存的问题 # 3) 要能复制二进 ...

  2. border-radius,box-shadow兼容性解决办法

    css3 border-radius不支持IE8/IE7的四种解决方法 标签: cssborder-radius兼容性   时间:2016-07-18 css3 border-radius用于设置HT ...

  3. Problem: Time(一道水却有意思的题

    Problem Description Digital clock use 4 digits to express time, each digit is described by 3*3 chara ...

  4. 3--TestNG多线程

    第一: 注解方式 public class MultiThreadOnAnnotation{ @test(invocationCount=10,threadPoolSize=10) public vo ...

  5. css+jquery 实现图片局部放大预览

    今天有时间开始动手,使用css+jquery实现了图片局部放大的组件,首先看看效果图: 界面设计思路如下: 1.两个div,左边放图片的缩略图 2.在左边缩略图鼠标移动的时候,区域(效果图中的网格) ...

  6. 使用XHProf查找PHP性能瓶颈

    XHProf是facebook 开发的一个测试php性能的扩展,本文记录了在PHP应用中使用XHProf对PHP进行性能优化,查找性能瓶颈的方法. 一.安装Xhprof扩展 //github上下载ht ...

  7. Lesson Learned

    最近,中兴ZTE违反美国商务部禁令,向伊朗出售敏感技术,被美国下达长达7年的禁止令,教训十分深刻.以诚待人,信守承诺,才能在商业社会站稳脚跟. 还是说说最近自己上的一课吧.上了港台服以后,奇奇怪怪的问 ...

  8. 20个可用于商业用途的免费 CC0 授权的高分辨率图库

    如今国人已经越来越重视版权了. 而用CC0 授权的图片不用担心版权的问题,那么什么是CC0授权呢?简单来说就是「公共领域贡献宣告」授权,当创作者在自身作品使用 CC0 授权时,代表于符合法律规定的最大 ...

  9. Linux 学习之路 --------ip地址虚拟网络

    // ifconfig 查看IP地址 网络信息   我的IP  39.161.136.25 ①     为网卡临时配置IP地址 ifconfig eth0 39.161.136.5 (netmask ...

  10. firefox support.mozilla.org 的管理员没有正确配置好此网站。为避免您的信息失窃,Firefox 并未与此网站建立连接。

    1.在地址栏输入:"about:config"-我了解此风险: 2.右键-新建-布尔: 3.在框内输入:security.enterprise_roots.enabled-确定-搜 ...