postfix 邮件网关之一

1, 58.215.76.168 (内部接受邮件服务器)

接受邮局服务器

[[email protected] conf]# cat main.cf

alias_database = hash:/usr/prima/postfix/conf/aliases

alias_maps = hash:/usr/prima/postfix/conf/aliases

append_at_myorigin = yes

append_dot_mydomain = no

command_directory = /usr/prima/postfix/sbin

config_directory = /usr/prima/postfix/conf

daemon_directory = /usr/prima/postfix/libexec

debug_peer_level = 2

disable_vrfy_command = yes

inet_interfaces = all

local_recipient_maps = $alias_maps hash:/usr/prima/postfix/conf/virtual

mail_owner = postfix

mailbox_transport = maildrop

maildrop_checkquota = yes

# The maildrop_checkquota_all controls whether reject mail only when all

# receipts are out of quota. This should be turned off.

maildrop_checkquota_all = no

maildrop_destination_recipient_limit = 1

mailq_path = /usr/bin/mailq

manpage_directory = /usr/prima/postfix/man

maximal_backoff_time = 3600s

maximal_queue_lifetime = 5400s

minimal_backoff_time = 1800s

mydestination = $myhostname $transport_maps

myhostname = mail6.edong.com

mynetworks = 127.0.0.0/8

mynetworks_style = subnet

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

queue_run_delay = 60s

readme_directory = /usr/prima/postfix/conf/README_FILES

sample_directory = /usr/prima/postfix/conf/samples

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

smtp_skip_4xx_greeting = no

smtpd_etrn_restrictions = reject

smtpd_helo_required = yes

smtpd_recipient_limit = 100

# freemail host checks

smtpd_restriction_classes = from_freemail_host

from_freemail_host = xheader_if_reject check_client_access hash:/usr/prima/postfix/conf/freemail_hosts,

reject

smtpd_recipient_restrictions = reject_unauth_pipelining,

permit_mynetworks,

reject_unknown_recipient_domain,

permit_sasl_authenticated,

#       xheader_if_reject reject_unknown_client,

#       xheader_if_reject reject_unknown_hostname,

#       xheader_if_reject reject_unknown_sender_domain,

#        xheader_if_reject reject_invalid_hostname,

#        xheader_if_reject reject_non_fqdn_hostname,

#        xheader_if_reject reject_non_fqdn_sender,

#        xheader_if_reject reject_non_fqdn_recipient,

#       check_sender_access hash:/usr/prima/postfix/conf/freemail_access,

reject_unauth_destination,

check_client_access hash:/usr/prima/postfix/conf/filter_server,

check_recipient_access regexp:/usr/prima/postfix/conf/mail_filter,

check_client_access hash:/usr/prima/postfix/conf/white_list_server,

reject_rbl_client zen.spamhaus.org

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = $myhostname

soft_bounce = no

strict_rfc821_envelopes = yes

transport_maps = hash:/usr/prima/postfix/conf/transport

virtual_alias_maps = hash:/usr/prima/postfix/conf/virtual

bounce_queue_lifetime = 0

smtpd_timeout = 60s

parent_domain_matches_subdomains =

relayhost = [gw2.edong.com]

always_bcc =

message_size_limit = 31457280

2, filter_server主要作用是接受来自如下两ip的信件。

(注:在76.168接受所有邮件后会通过mail_filter转向到gw1.edong.com及203.191.144.138上,所以在通过main.cf内check_client_access hash:/usr/prima/postfix/conf/filter_server,

check_recipient_access regexp:/usr/prima/postfix/conf/mail_filter,

的过滤后来接受来自网关的信件。这样可以过滤点一大部分垃圾邮件。)

[[email protected] conf]# cat filter_server

203.191.144.138 OK

203.191.144.137 OK

3, 接受客户发来的信件

[[email protected] conf]# cat white_list_server

58.215.76.168 OK

4,  将接受到的邮件发到网关gw1.edong.com进行过滤后再返回正常进入接受队列。

[[email protected] conf]# cat mail_filter

/techsun.com.cn/ FILTER spamfilter:[gw1.edong.com]:10025

#/[c-fC-F].*.com.cn/ FILTER spamfilter:[gw1.edong.com]:10025

/[email protected]/ FILTER spamfilter:[gw1.edong.com]:10025

#/.*/ FILTER spamfilter:[gw1.edong.com]:10025

5,

transport_maps这个参数对应的是所有目标接受方的地址。

[[email protected] conf]# cat transport

weilesci.com maildrop:

talentbright.com maildrop:

shbizun.com maildrop:

zambon.com.cn smtp:

ags.co.th smtp:

oweb.cn smtp:oweb.cn

decens.cn maildrop:

6,master.conf

spamfilter unix -       -       n       -       -       smtp    -o smtp_send_xforward_command=yes

需要注意的是这条,spamfilter是通过这条来对初次接收到的邮件转发到网关上去,它主要这个功能。

有些老的postfix不只能spamfilter的功能,需要|grep spamfilter,看是否有相关的rpm,如果有则支持。

# ==========================================================================

# service type private unpriv chroot wakeup maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

smtp      inet n       -       n       -       -       smtpd

#628      inet n       -       n       -       -       qmqpd

pickup    fifo n       -       n       60      1       pickup

cleanup   unix n       -       n       -       0       cleanup

#qmgr      fifo n       -       n       300     1       qmgr

qmgr     fifo n       -       n       300     1       nqmgr

rewrite   unix -       -       n       -       -       trivial-rewrite

bounce    unix -       -       n       -       0       bounce

defer     unix -       -       n       -       0       bounce

flush     unix n       -       n       1000?   0       flush

proxymap unix -       -       n       -       -       proxymap

smtp      unix -       -       n       -       -       smtp

relay     unix -       -       n       -       -       smtp

#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq     unix n       -       n       -       -       showq

error     unix -       -       n       -       -       error

local     unix -       n       n       -       -       local

virtual   unix -       n       n       -       -       virtual

lmtp      unix -       -       n       -       -       lmtp

#

# Interfaces to non-Postfix software. Be sure to examine the manual

# pages of the non-Postfix software to find out what options it wants.

#

# maildrop. See the Postfix MAILDROP_README file for details.

#

maildrop unix -       n       n       -       -       pipe

flags=DORhu user=vmail argv=/usr/prima/maildrop/bin/maildrop -d ${recipient} -w 90

#

# The Cyrus deliver program has changed incompatibly, multiple times.

#

old-cyrus unix -       n       n       -       -       pipe

flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}

# Cyrus 2.1.5 (Amos Gouaux)

cyrus     unix -       n       n       -       -       pipe

user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}

uucp      unix -       n       n       -       -       pipe

flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

ifmail    unix -       n       n       -       -       pipe

flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)

bsmtp     unix -       n       n       -       -       pipe

flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient

spamfilter unix -       -       n       -       -       smtp    -o smtp_send_xforward_command=yes

2009-04-28

时间: 2024-08-21 09:47:55

postfix 邮件网关之一的相关文章

关于Postfix邮件网关无法重启问题

最近在研究Postfix邮件网关,由于自己还是Linux界的小白菜,所以在研究路上免不了遇到一些问题,比如今天就遇到了Postfix服务无法启动的问题,最后经过排查后发现是一个配置影响的,但还是觉得应该分享出来排错和解决的方法,以便有同我一样也在开始研究Postfix的朋友能在遇到此问题时,少走弯路,好了报错截图如下附上: 好,重启无法成功,那么先不要着急想是哪里出问题,先来看看这个Postfix实际的状态都提示什么报错?当执行" [[email protected] spool]# /etc/

Postfix邮件网关投递邮件报“fatal: open database /etc/postfix/transport.db: No su

今天完成了Postfix邮件网关的配置,配置完成后,尝试进行邮件投递时,发现未收到投递的邮件,当时第一想法,先看看邮件队日志是否有记录,利用如下命令查看时时日志. [[email protected] Postfix_Conifgure]# tail -f /var/log/maillog 发现了如下报错:   看来是找不到transport.db文件,那么利用如下命令执行生成即可: 首先,来检查transport究竟有几个文件及属性是什么?如下: [[email protected] post

关于利用Postfix邮件网关接收外网投递邮件失败问题的解决方法

今天完成Postfix邮件网关配置后,尝试进行一次邮件投递,但是迟迟不见有邮件收进来,再次利用" tail -f /var/log/maillog"查看时时日志,发现邮件已经到达邮件网关,只是卡在了这个位置,如下图所示截图: 当时一直在想,邮件投递后,应该是转发给后端的Exchange服务器的Hub才对呀,可是现在很明显,未正常投递呀,而我在/etc/postfix/main.cf,也因为要做内容筛选,所以加了这条,很有可能是这条导致的投递失败. 将上述的这条进行注释,注释后保后如下:

关于Postfix邮件网关搭建中cdcc info运行错误解决方法

今天在研究Postfix邮件网关时,配置到了对cdcc网络连通性测试时,执行cdcc info 命令,出现了如下报错信息: 解决方法如下: 再次执行cdcc info可看到已经正常,如下图所示:

postfix邮件网关代理outlook

1.组件 操作系统centos5.4 postfix:MTA clamd:反病毒引擎 spamassassin:反垃圾邮件 amavisd-new:是邮件代理服务器(MTA)和防毒软件之间的中间件 fail2ban:防止邮箱暴力破解 2.工作原理 第一步:postfix 接收邮件(MTA) postfix,通过25端口,接受所有的邮件 第二步:邮件交给amavisd-new amavisd-new负责调用clamd对邮件进行病毒扫描,负责调用SpamAssassin对邮件内容进行过滤:amavi

通过Postfix构建Exchange Server 2010邮件网关部署系列一:创建新域环境

在企业部署邮件平台实例中,我们不仅仅只是完成Exchange Server 2010平台的搭建,我们还需要考虑到Exchange如何发布?端口有哪些?邮件网关用什么样的? 那么关于端口发布部分我们后期会再介绍,本次我们主要介绍利用开源平台下的Postfix如何实现邮件网关功能,来保证企业邮件的安全性. 在系列部署系列第一讲中,我主要介绍最基本的如何搭建域环境,来满足Exchange Server 2010搭建的基础要求. [演示环境IP地址信息]     [演示环境主机名] 新建域控制器:  

通过Postfix构建Exchange Server 2010邮件网关部署系列二:证书服务器安装

在本系列文章中,主要介绍关于微软证书服务器的安装方法,具体配置方法如下: [安装证书服务] 在执行下列安装步骤前,请先确保证书服务器已经正常加入域环境. 1.在下图所示页面中,选择"添加角色": 2.在下图所示页面中,单击"下一步"按钮: 3.在下图所示页面中,勾选"Active Directory证书服务"; 4.在下图所示页面中,单击"下一步"按钮: 5.勾选下图所示各项,单击"下一步"按钮: 6.在下

过Postfix构建Exchange Server 2010邮件网关部署系列三:安装Exchange 2010先决性条件

1.将Exchange Server 2010服务器加入域. 2.在"开始"菜单上,依次导航到"所有程序">"附件">"Windows PowerShell".打开提升的 Windows PowerShell 控制台并运行以下命令: Import-Module ServerManager 3.使用 Add-WindowsFeature cmdlet 安装必要的操作系统组件,由于本实例安装只做演示,所以采用典型安装,

过Postfix构建Exchange Server 2010邮件网关部署系列四:Exchange 2010典型安装

1.加载Exchange Server 2010 SP1安装光盘 2.在下图所示页面的步骤3中,选择"仅从DVD安装语言" 3.在下图所示页面中,单击"步骤4:--" 4.在下图所示页面中,单击"下一步"按钮: 5.在下图所示页面中,勾选"我接受许可协议中的条款" 6.在下图所示页面中,勾选"否",单击"下一步"按钮: 7.在下图所示页面中,选择"自定义Exchange Ser