谢谢!
估计是关键字选错了,老搜不到内容。
支持 Red Hat Enterprise Linux, CentOS, Scientific Linux, Debian, Ubuntu, FreeBSD, OpenBSD
您尚未登陆。 请选择登陆或是注册一个新账号。
iRedMail 开源邮件服务解决方案 » 由 tiangangnet 发表的文章
iRedMail 0.6.0
1. 如果让管理域中的某个邮箱无论什么邮件都照单全收?
2. 如果禁止灰名单?
3. 如果让管理域中发送和接受的所有邮件都转发到管理员邮箱?
具体问题见
http://www.iredmail.org/bbs/topic1606-backup-mx.html
我用postfixadmin 将所有备份域的Transfer 都设置为relay仍然解决不了问题。
由于是生产用机,不敢轻易乱试。所以只能一点一点摸索着调试。
在 http://www.postfix.org/STANDARD_CONFIGU … EADME.html
中介绍了,postfix 作为 Backup MX 的配置,如下:
Configuring Postfix as primary or backup MX host for a remote site
This section presents additional configuration. You need to combine this with basic configuration information as discussed the first half of this document.
When your system is SECONDARY MX host for a remote site this is all you need:
1 DNS:
2 the.backed-up.domain.tld IN MX 100 your.machine.tld.
3
4 /etc/postfix/main.cf:
5 relay_domains = . . . the.backed-up.domain.tld
6 smtpd_recipient_restrictions =
7 permit_mynetworks reject_unauth_destination
8
9 # You must specify your NAT/proxy external address.
10 #proxy_interfaces = 1.2.3.4
11
12 relay_recipient_maps = hash:/etc/postfix/relay_recipients
13
14 /etc/postfix/relay_recipients:
15 user1@the.backed-up.domain.tld x
16 user2@the.backed-up.domain.tld x
17 . . .
When your system is PRIMARY MX host for a remote site you need the above, plus:
18 /etc/postfix/main.cf:
19 transport_maps = hash:/etc/postfix/transport
20
21 /etc/postfix/transport:
22 the.backed-up.domain.tld relay:[their.mail.host.tld]
Important notes:
•Do not list the.backed-up.domain.tld in mydestination.
•Do not list the.backed-up.domain.tld in virtual_alias_domains.
•Do not list the.backed-up.domain.tld in virtual_mailbox_domains.
•Lines 1-7: Forward mail from the Internet for "the.backed-up.domain.tld" to the primary MX host for that domain.
•Line 10: This is a must if Postfix receives mail via a NAT relay or proxy that presents a different IP address to the world than the local machine.
•Lines 12-16: Define the list of valid addresses in the "the.backed-up.domain.tld" domain. This prevents your mail queue from filling up with undeliverable MAILER-DAEMON messages. If you can't maintain a list of valid recipients then you must specify "relay_recipient_maps =" (that is, an empty value), or you must specify an "@the.backed-up.domain.tld x" wild-card in the relay_recipients table.
•Line 22: The [] forces Postfix to do no MX lookup.
Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what lookup tables Postfix supports, use the command "postconf -m".
Execute the command "postmap /etc/postfix/transport" whenever you change the transport table.
NOTE for Postfix < 2.2: Do not use the fallback_relay feature when relaying mail for a backup or primary MX domain. Mail would loop between the Postfix MX host and the fallback_relay host when the final destination is unavailable.
•In main.cf specify "relay_transport = relay",
•In master.cf specify "-o fallback_relay =" at the end of the relay entry.
•In transport maps, specify "relay:nexthop..." as the right-hand side for backup or primary MX domain entries.
These are default settings in Postfix version 2.2 and later.
根据上面提示,重要的设置参数,除了DNS MX的设置外,在postfix中main.cf只需要调整
relay_domains
relay_recipient_maps
当iRedMail 安装好后,实际上已经配置好了。
但是为什么会导致无效呢?根据上面的提示,如果作为备份域,域名和用户是决不能出现在
mydestination
virtual_alias_domains
virtual_mailbox_domains
因为我希望作为备份域的服务器既能够作为 主 mx 也能作为其他的备份域。
我利用postmap -q 来检查 这三个配置项中是否能够读取出我的备份域名。
最后发现了,mysql的配置文件存在bug。
mysql_virtual_alias_maps.cf 文件中的query 在查询时,并没有检查domain中的域是否是备份域。所以修改如下:
query = SELECT goto FROM alias,domain WHERE alias.address = '%s' AND alias.active = '1' AND domain.backupmx = '0'
在mysql_domain_alias_maps.cf情景相同,修改如下:
query = SELECT goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_dom
ain) AND alias.active = 1 AND alias_domain.active='1' AND domain.backupmx='0'
在mysql_virtual_mailbox_domains.cf中修改如下:
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx='0' AND active='1'
当我修改好后,再次测试,结果还是不行。于是继续寻找原因。
relay_domains 是来检查是否存在备份域。
relay_recipient_maps 则是检查用户是否存在。
而这两个文件都没有问题。
想来想去,问题只能处在transport上面了。根据Backup MX 的日志,当收到邮件后,relay=dovecot,这显然不对,那么问题可能出现在
transport_maps 参数上了。
iRedMail的默认配置如下:
transport_maps = proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_user.cf, proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_domain.cf
这两个文件中的查询语句都是提取数据库中用户表和域表中的transport,而我用phpmyadmin打开数据库,发现用户表中所有的用户都是 dovecot。
可我是把域设定为relay的,也就是说这可能是postfixadmin 的bug。于是我将备份域的用户全部更新为relay。
再次测试,成功!!
总结:
当安装完iRedMail后,如果想服务器又能够作为主域也能够作为备份域的时候,需要进行如下工作:
1. 在 postfixadmin 中将备份域transport 设定为 relay
2. 在备份域中添加的用户,需要用phpmyadmin打开数据表 mailbox 将字段transport 更新为 relay [或者修改postfixadmin源代码,修正BUG]
3. main.cf中,mydestination 不包含备份域。
4. 修改 mysql_virtual_alias_maps.cf 最后一行:
query = SELECT goto FROM alias,domain WHERE alias.address = '%s' AND alias.active = '1' AND domain.backupmx = '0'
5. 修改 mysql_domain_alias_maps.cf 最后一行:
query = SELECT goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_dom
ain) AND alias.active = 1 AND alias_domain.active='1' AND domain.backupmx='0'
6. 修改 mysql_virtual_mailbox_domains.cf 最后一行:
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx='0' AND active='1'
7. relay_recipient_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
此步骤有待考察,因为按照参数说明,应该是查询的用户账号,也就是邮箱名,但是此文件读取的是路径。可我没有修改,仍然实现了转发。
说明:
以上步骤是建立在iRedMail 安装基础上,如果是独立配置的postfix,还需要参考官方文档。
感谢ZhangHuangbin提供的帮助!
我用postmap 命令分别查询 mysql_virtual_mailbox_domains.cf 和 mysql_relay_domains.cf
运行mysql_relay_domians.cf 能够得出正确的备份域名称,而且mysql_virtual_mailbox_domains.cf 中查不到。
到底是哪里的问题呢?
改回 relay 后 BackupMX 的日志:
Aug 12 12:56:49 sv-010 postfix/smtpd[72533]: connect from mail-qy0-f176.google.com[209.85.216.176]
Aug 12 12:56:50 sv-010 postfix-policyd-sf: connection from: 127.0.0.1 port: 45496 slots: 0 of 1023 used
Aug 12 12:56:50 sv-010 postfix-policyd-sf: rcpt=914, greylist=update, host=209.85.216.176 (mail-qy0-f176.google.com), from=tiangangnet@gmail.com, to=tian@longtou.net, size=0
Aug 12 12:56:50 sv-010 postfix-policyd-sf: rcpt=914, throttle_rcpt=update(a), host=209.85.216.176, from=tiangangnet@gmail.com, to=tian@longtou.net, count=3/64(4), threshold=3
Aug 12 12:56:50 sv-010 postfix/smtpd[72533]: 2E46D295448: client=mail-qy0-f176.google.com[209.85.216.176]
Aug 12 12:56:50 sv-010 postfix/cleanup[72539]: 2E46D295448: message-id=<AANLkTikCYYvw=8zfa85NhVGVoaO4RXoY=r2EMoTvbSJh@mail.gmail.com>
Aug 12 12:56:50 sv-010 postfix/qmgr[72498]: 2E46D295448: from=<tiangangnet@gmail.com>, size=1929, nrcpt=1 (queue active)
Aug 12 12:56:56 sv-010 postfix/smtpd[72543]: connect from localhost[127.0.0.1]
Aug 12 12:56:56 sv-010 postfix/smtpd[72543]: 8DA06295449: client=localhost[127.0.0.1]
Aug 12 12:56:56 sv-010 postfix/cleanup[72539]: 8DA06295449: message-id=<AANLkTikCYYvw=8zfa85NhVGVoaO4RXoY=r2EMoTvbSJh@mail.gmail.com>
Aug 12 12:56:56 sv-010 postfix/smtpd[72543]: disconnect from localhost[127.0.0.1]
Aug 12 12:56:56 sv-010 postfix/qmgr[72498]: 8DA06295449: from=<tiangangnet@gmail.com>, size=2616, nrcpt=1 (queue active)
Aug 12 12:56:56 sv-010 amavis[63304]: (63304-12) Passed CLEAN, LOCAL [209.85.216.176] [209.85.216.176] <tiangangnet@gmail.com> -> <tian@longtou.net>, Message-ID: <AANLkTikCYYvw=8zfa85NhVGVoaO4RXoY=r2EMoTvbSJh@mail.gmail.com>, mail_id: oVwF09QBao4i, Hits: -110.088, size: 1929, queued_as: 8DA06295449, dkim_id=@gmail.com,tiangangnet@gmail.com, 5831 ms
Aug 12 12:56:56 sv-010 postfix/smtp[72541]: 2E46D295448: to=<tian@longtou.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.7, delays=0.85/0.01/0/5.8, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 8DA06295449)
Aug 12 12:56:56 sv-010 postfix/qmgr[72498]: 2E46D295448: removed
Aug 12 12:56:56 sv-010 postfix/pipe[72544]: 8DA06295449: to=<tian@longtou.net>, relay=dovecot, delay=0.02, delays=0/0.01/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 12 12:56:56 sv-010 postfix/qmgr[72498]: 8DA06295449: removed
Aug 12 12:57:21 sv-010 postfix/smtpd[72533]: disconnect from mail-qy0-f176.google.com[209.85.216.176]
Aug 12 12:58:14 sv-010 postfix/smtpd[72533]: connect from mail-qw0-f41.google.com[209.85.216.41]
Aug 12 12:58:14 sv-010 postfix-policyd-sf: rcpt=915, greylist=update, host=209.85.216.41 (mail-qw0-f41.google.com), from=tiangangnet@gmail.com, to=tian@longtou.net, size=0
Aug 12 12:58:14 sv-010 postfix-policyd-sf: rcpt=915, throttle_rcpt=update(a), host=209.85.216.41, from=tiangangnet@gmail.com, to=tian@longtou.net, count=4/64(4), threshold=4
Aug 12 12:58:14 sv-010 postfix/smtpd[72533]: F038C295448: client=mail-qw0-f41.google.com[209.85.216.41]
Aug 12 12:58:15 sv-010 postfix/cleanup[72539]: F038C295448: message-id=<AANLkTimuYW=k7WFC+ZO22tA8DhFbEdcpa+_pHZ0SgeHn@mail.gmail.com>
Aug 12 12:58:15 sv-010 postfix/qmgr[72498]: F038C295448: from=<tiangangnet@gmail.com>, size=1933, nrcpt=1 (queue active)
Aug 12 12:58:21 sv-010 postfix/smtpd[72543]: connect from localhost[127.0.0.1]
Aug 12 12:58:21 sv-010 postfix/smtpd[72543]: 09E92295449: client=localhost[127.0.0.1]
Aug 12 12:58:21 sv-010 postfix/cleanup[72539]: 09E92295449: message-id=<AANLkTimuYW=k7WFC+ZO22tA8DhFbEdcpa+_pHZ0SgeHn@mail.gmail.com>
Aug 12 12:58:21 sv-010 postfix/smtpd[72543]: disconnect from localhost[127.0.0.1]
Aug 12 12:58:21 sv-010 postfix/qmgr[72498]: 09E92295449: from=<tiangangnet@gmail.com>, size=2620, nrcpt=1 (queue active)
Aug 12 12:58:21 sv-010 amavis[63303]: (63303-13) Passed CLEAN, LOCAL [209.85.216.41] [209.85.216.41] <tiangangnet@gmail.com> -> <tian@longtou.net>, Message-ID: <AANLkTimuYW=k7WFC+ZO22tA8DhFbEdcpa+_pHZ0SgeHn@mail.gmail.com>, mail_id: 0K8WjQhn093Y, Hits: -110.088, size: 1933, queued_as: 09E92295449, dkim_id=@gmail.com,tiangangnet@gmail.com, 5505 ms
Aug 12 12:58:21 sv-010 postfix/smtp[72541]: F038C295448: to=<tian@longtou.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.4, delays=0.86/0/0/5.5, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 09E92295449)
Aug 12 12:58:21 sv-010 postfix/qmgr[72498]: F038C295448: removed
Aug 12 12:58:21 sv-010 postfix/pipe[72544]: 09E92295449: to=<tian@longtou.net>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 12 12:58:21 sv-010 postfix/qmgr[72498]: 09E92295449: removed
Aug 12 12:58:45 sv-010 postfix/smtpd[72533]: disconnect from mail-qw0-f41.google.com[209.85.216.41]
我查看了mysql_virtual_mailbox_domains.cf
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx='0' AND active='1'
而且我把BACKUP 的domain backupmx 字段都设定为 1了。
virtual_mailbox_domains ,virtual_mailbox_maps 这两个参数应该无效的。
我现在把Transport 改回 relay了。
sorry,transport 应该是设置为 relay 的。而且应该不需要这两个参数的:
virtual_mailbox_domains virtual_mailbox_maps
这两个参数会将邮件投递到邮箱,而不是保留在队列里等待转发到主服务器。
多谢!!!我试一下!!
我修改 relay_domains = mysql:/usr/local/etc/postfix/mysql_relay_domains.cf
然后把MTX停掉,从hotmail 发送一封,BackupMX 日志如下:
Aug 12 12:20:26 sv-010 postfix/smtpd[71971]: connect from snt0-omc3-s27.snt0.hotmail.com[65.55.90.166]
Aug 12 12:20:26 sv-010 postfix-policyd-sf: connection from: 127.0.0.1 port: 52195 slots: 0 of 1023 used
Aug 12 12:20:26 sv-010 postfix-policyd-sf: rcpt=906, greylist=update, host=65.55.90.166 (snt0-omc3-s27.snt0.hotmail.com), from=tiangangnet@hotmail.com, to=tian@longtou.net, size=1150
Aug 12 12:20:26 sv-010 postfix-policyd-sf: rcpt=906, throttle_rcpt=clear(a), host=65.55.90.166, from=tiangangnet@hotmail.com, to=tian@longtou.net, count=0/64(2), threshold=0
Aug 12 12:20:26 sv-010 postfix/smtpd[71971]: F3679295408: client=snt0-omc3-s27.snt0.hotmail.com[65.55.90.166]
Aug 12 12:20:27 sv-010 postfix/cleanup[71977]: F3679295408: message-id=<SNT113-W40055A3A0A70B0E1BCDDBBAD970@phx.gbl>
Aug 12 12:20:27 sv-010 postfix/qmgr[71938]: F3679295408: from=<tiangangnet@hotmail.com>, size=1420, nrcpt=1 (queue active)
Aug 12 12:20:27 sv-010 postfix/smtpd[71971]: disconnect from snt0-omc3-s27.snt0.hotmail.com[65.55.90.166]
Aug 12 12:20:33 sv-010 postfix/smtpd[71983]: connect from localhost[127.0.0.1]
Aug 12 12:20:33 sv-010 postfix/smtpd[71983]: 4616B29543D: client=localhost[127.0.0.1]
Aug 12 12:20:33 sv-010 postfix/cleanup[71977]: 4616B29543D: message-id=<SNT113-W40055A3A0A70B0E1BCDDBBAD970@phx.gbl>
Aug 12 12:20:33 sv-010 postfix/smtpd[71983]: disconnect from localhost[127.0.0.1]
Aug 12 12:20:33 sv-010 postfix/qmgr[71938]: 4616B29543D: from=<tiangangnet@hotmail.com>, size=1899, nrcpt=1 (queue active)
Aug 12 12:20:33 sv-010 amavis[63303]: (63303-11) Passed CLEAN, LOCAL [65.55.90.166] [65.55.90.136] <tiangangnet@hotmail.com> -> <tian@longtou.net>, Message-ID: <SNT113-W40055A3A0A70B0E1BCDDBBAD970@phx.gbl>, mail_id: YYH5ihrJgrzt, Hits: -110.008, size: 1420, queued_as: 4616B29543D, 5807 ms
Aug 12 12:20:33 sv-010 postfix/smtp[71978]: F3679295408: to=<tian@longtou.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.6, delays=0.74/0.01/0/5.8, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4616B29543D)
Aug 12 12:20:33 sv-010 postfix/qmgr[71938]: F3679295408: removed
Aug 12 12:20:33 sv-010 postfix/pipe[71986]: 4616B29543D: to=<tian@longtou.net>, relay=dovecot, delay=0.02, delays=0/0.01/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 12 12:20:33 sv-010 postfix/qmgr[71938]: 4616B29543D: removed
我查看 postconf(5) ,发现如下内容:
permit_mx_backup_networks (default: empty)
Restrict the use of the permit_mx_backup SMTP access feature to only domains whose primary MX hosts match the listed networks. The parameter value syntax is the same as with the mynetworks parameter; note, however, that the default value is empty.
relay_domains = $mydestination, mysql:/usr/local/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
会不会问题出现在 relay_domains 的$mydestination 上?
我把MTX 停掉,然后用hotmail发了一封邮件,下面的日志是 BACKUP MX 上的 MAILLOG 文件,帮我看一下什么问题!!
Aug 12 12:05:39 sv-010 postfix/smtpd[71758]: connect from snt0-omc3-s16.snt0.hotmail.com[65.55.90.155]
Aug 12 12:05:40 sv-010 postfix-policyd-sf: rcpt=904, greylist=update, host=65.55.90.155 (snt0-omc3-s16.snt0.hotmail.com), from=tiangangnet@hotmail.com, to=tian@longtou.net, size=1156
Aug 12 12:05:40 sv-010 postfix-policyd-sf: rcpt=904, throttle_rcpt=update(a), host=65.55.90.155, from=tiangangnet@hotmail.com, to=tian@longtou.net, count=2/64(3), threshold=1
Aug 12 12:05:40 sv-010 postfix/smtpd[71758]: B6643295420: client=snt0-omc3-s16.snt0.hotmail.com[65.55.90.155]
Aug 12 12:05:41 sv-010 postfix/cleanup[71765]: B6643295420: message-id=<SNT113-W4DBE80F3CB4B47E717FBAAD970@phx.gbl>
Aug 12 12:05:41 sv-010 postfix/qmgr[71656]: B6643295420: from=<tiangangnet@hotmail.com>, size=1426, nrcpt=1 (queue active)
Aug 12 12:05:41 sv-010 postfix/smtpd[71758]: disconnect from snt0-omc3-s16.snt0.hotmail.com[65.55.90.155]
Aug 12 12:05:46 sv-010 postfix/smtpd[71769]: connect from localhost[127.0.0.1]
Aug 12 12:05:46 sv-010 postfix/smtpd[71769]: EC6CE295423: client=localhost[127.0.0.1]
Aug 12 12:05:46 sv-010 postfix/cleanup[71765]: EC6CE295423: message-id=<SNT113-W4DBE80F3CB4B47E717FBAAD970@phx.gbl>
Aug 12 12:05:46 sv-010 postfix/smtpd[71769]: disconnect from localhost[127.0.0.1]
Aug 12 12:05:46 sv-010 postfix/qmgr[71656]: EC6CE295423: from=<tiangangnet@hotmail.com>, size=1905, nrcpt=1 (queue active)
Aug 12 12:05:46 sv-010 amavis[63304]: (63304-10) Passed CLEAN, LOCAL [65.55.90.155] [65.55.90.137] <tiangangnet@hotmail.com> -> <tian@longtou.net>, Message-ID: <SNT113-W4DBE80F3CB4B47E717FBAAD970@phx.gbl>, mail_id: Rq4hH3P6XlYr, Hits: -110.008, size: 1426, queued_as: EC6CE295423, 5753 ms
Aug 12 12:05:46 sv-010 postfix/smtp[71766]: B6643295420: to=<tian@longtou.net>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.6, delays=0.82/0.01/0/5.8, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as EC6CE295423)
Aug 12 12:05:46 sv-010 postfix/qmgr[71656]: B6643295420: removed
Aug 12 12:05:46 sv-010 postfix/pipe[71772]: EC6CE295423: to=<tian@longtou.net>, relay=dovecot, delay=0.02, delays=0/0.01/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 12 12:05:46 sv-010 postfix/qmgr[71656]: EC6CE295423: removed
我现在吧 Transport 改为 dovecot,因为我觉得其他的更不像正确的。
那么我之前备份域收下来的邮件该怎么传递回MTX?
很急啊!!
我认为Backup MX 应该 Transport 设为Relay 啊?
那我应该设置为什么?
昨天晚上,MTX 宕机了。
今天早上开机后,发现 BACKUP MX 接收的邮件没有转发会 Master MX.
MTX 的配置
# postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_name = iRedMail
mail_owner = postfix
mail_version = 0.6.0
mailbox_command = /usr/local/libexec/dovecot/deliver
mailbox_size_limit = 15728640
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = longtou.net
myhostname = sv-009.mydomain.net
mynetworks = 127.0.0.0/8, xxx.xxx.95.64/27
mynetworks_style = subnet
myorigin = sv-009..net
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
sample_directory = /usr/local/etc/postfix
sender_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_user.cf
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/usr/local/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl.spamhaus.org, reject_rbl_client cblplus.anti-spam.org.cn, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_user.cf, proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf, proxy:mysql:/usr/local/etc/postfix/mysql_domain_alias_maps.cf
virtual_gid_maps = static:1002
virtual_mailbox_base = /data/vmail
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1002
virtual_transport = dovecot
virtual_uid_maps = static:1002
BACKUP MX 配置:
postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_name = iRedMail
mail_owner = postfix
mail_version = 0.6.0
mailbox_command = /usr/local/libexec/dovecot/deliver
mailbox_size_limit = 15728640
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = longtou.net
myhostname = sv-010.mydomain.net
mynetworks = 127.0.0.0/8,xxx.xxx.95.64/27
mynetworks_style = subnet
myorigin = sv-010.mydomain.net
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
sample_directory = /usr/local/etc/postfix
sender_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_user.cf
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/usr/local/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_user.cf, proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf, proxy:mysql:/usr/local/etc/postfix/mysql_domain_alias_maps.cf
virtual_gid_maps = static:1002
virtual_mailbox_base = /data/vmail
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1002
virtual_transport = dovecot
virtual_uid_maps = static:1002
备份域的postfixadmin 中设定域为 Backup MX,我将Transport 设定为 relay 不知道是不是这里设置错误?
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_name = iRedMail
mail_owner = postfix
mail_version = 0.6.0
mailbox_command = /usr/local/libexec/dovecot/deliver
mailbox_size_limit = 15728640
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = hokkaisoft.net
myhostname = sv-010.hokkaisoft.net
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
myorigin = sv-010.hokkaisoft.net
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = no
recipient_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_recipient_bcc_maps_user.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
sample_directory = /usr/local/etc/postfix
sender_bcc_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_domain.cf, proxy:mysql:/usr/local/etc/postfix/mysql_sender_bcc_maps_user.cf
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_enforce_tls = no
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated, check_helo_access pcre:/usr/local/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_path = dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/usr/local/etc/postfix/mysql_sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_user.cf, proxy:mysql:/usr/local/etc/postfix/mysql_transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf, proxy:mysql:/usr/local/etc/postfix/mysql_domain_alias_maps.cf
virtual_gid_maps = static:1002
virtual_mailbox_base = /data/vmail
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1002
virtual_transport = dovecot
virtual_uid_maps = static:1002
***********************************
域设定是通过postfixadmin设定的,
Domain: longtou.net
Description: longtou.net
Aliases: 0
Mailboxes: 0
Max Quota: 0
Transport: relay
Mail server is backup MX: 1
Active: 1
***********************************
/usr/local/etc/postfix/aliases
#root: www@longtou.net
#policyd: www@longtou.net
root: tian@longtou.net
policyd: tian@longtou.net
*************************************
用户是通过postfixadmin添加的设定了密码并且 active :1
***************************
其他设定都是安装iRedMail时默认的。
我设置了两台邮件服务器,一台是主MX,一台是备份MX。
backup mx 这台机器的root 邮件安装iRedMail后发送到www邮箱,我想象,因为是backup mx ,所以应该会将此邮箱的邮件自动发送到主mx服务器。但是,并没有。登陆backup mx 的www用户可以看到邮件。
因为我已经将backup上面的域设备 backup mx 且Transport 设定为 relay了。
我想请问,为什么backup mx 上的邮件未能够自动发送到 master mx上去?
我将iRedMail 0.4.0 迁移到另一台服务器 0.6.0 上,将硬盘上所有用户邮件打包到新服务器再解包,可以发现就邮件在WEB MAIL 及 客户端软件中都看不见。请问我该怎样恢复?我们这里都是用的IMAP。
急!
我在论坛里搜到设定 RBL的服务器地址,但是大多都无法解析IP地址,请问现在可以使用的是哪些服务器?如何判断服务器的有效性?另外我如果增加RBL,是应该增加在smtpd_client_restrictions 还是 smtpd_recipient_restrictions ?
谢谢!
老大有没有OpenLDAP 地址簿的教程或者链接啊?
搜索了论坛没找到。。。。
我在FreeBSD上安装了iRedMail,采用MySQL后台,请问,能否再安装OpenLDAP然后实现全局地址簿功能?
应该怎样实现?
谢谢!
Return-Path: <offscreen@avhp.nl>
Delivered-To: tian@hokkaisoft.net
Received: from localhost (mail.hokkaisoft.net [127.0.0.1])
by mail.hokkaisoft.net (iRedMail) with ESMTP id A274040D0797
for <tian@hokkaisoft.net>; Mon, 5 Jul 2010 21:51:54 +0000 (UTC)
X-Virus-Scanned: amavisd-new at mail.hokkaisoft.net
Received: from mail.hokkaisoft.net ([127.0.0.1])
by localhost (mail.hokkaisoft.net [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id QPTItO1rHztZ for <tian@hokkaisoft.net>;
Tue, 6 Jul 2010 05:51:53 +0800 (CST)
X-Original-Helo: yfuxcm.rtolaf.com (iRedMail: http://code.google.com/p/iredmail/)
Received: from yfuxcm.rtolaf.com (unknown [151.62.5.145])
by mail.hokkaisoft.net (iRedMail) with SMTP id B164D40D075B
for <tian@hokkaisoft.net>; Mon, 5 Jul 2010 21:51:50 +0000 (UTC)
Message-ID: <4C3251EE3858012@financie.sk>
Date: Mon, 05 Jul 2010 23:51:45 +0200
From: Widowski Sticker <offscreen@avhp.nl>
MIME-Version: 1.0
To: Willaby Reppond <tian@hokkaisoft.net>
Subject: the bright and happy fancies wh
Content-Type: multipart/mixed;
boundary="----_006_150D368C2CFE728E7807pretentious_"
------_006_150D368C2CFE728E7807pretentious_
Content-Type: image/png;
name="precisionise.png"
Content-Transfer-Encoding: base64
当通过postfixadmin 删除用户 或者 删除域时,用户所在的maildir 还保存在域目录中,请问该如何处理?
Bibby 说:
好的
你搜索了论坛么?我记得我回复过关于 backup mx 的问题
tiangangnet 说:
搜了以后,页面显示空白页。。。
Bibby 说:
你在 google 里搜: backup mx site:iredmail.org/bbs/ <http://iredmail.org/bbs/>
tiangangnet 说:
好的
Bibby 说:
或者: backup mx site:iredmail.org/oldbbszh/ <http://iredmail.org/oldbbszh/>
后面一个是早前的论坛。
你进去搜索一下试试
tiangangnet 说:
搜到了,我看看的
Bibby 说:
ok
tiangangnet 说:
那我问的关于修改main.cf里面的设置完全没必要喽?
Bibby 说:
我再看下。==
tiangangnet 说:
多谢
Bibby 说:
iredmail 默认情况下是假设你在这台 backup mx 上也有那台机器的所有帐号。所以加了 replay_domains, relay_recipient_maps。
tiangangnet 说:
我刚刚测试了一下,我把一个域名的主MX指导一个空IP,让新安装的iRedMail作为备份MX,现在看maillog好像已经发到备份域了,不过被灰名单给挡了,我再等几分钟。
Bibby 说:
如果你没有帐号在这台机器上,应该注释掉这两个参数。
tiangangnet 说:
那我明白了,就是作为备份域,我也应该把所有用户账号加到数据库,这样就很方便管理了对吧?
另外,FreeBSD 下安装没能自动设定 IPFW 。在 iRedMail.tips里也没提。
Bibby 说:
作为备份域,是可以不将帐号加到数据库的。加到数据库的好处时,对于发给不存在的帐号的邮件,会直接拒收,这样可以减轻你的服务器负载。
不然的话,所有的邮件都会被你收下,包括垃圾邮件。都会收下。
tiangangnet 说:
明白了!多谢!
Bibby 说:
ok
tiangangnet 说:
已经成功啦!多谢!
Bibby 说:
http://www.iredmail.org/bbs/post8061.html#p8061
你反馈的问题我已经修正了。
谢谢
tiangangnet 说:
不客气!
奇怪!!
为啥备份域的邮件我登录WEB mail 也能看到???
如果我看过后,还会发到主域么?
Bibby 说:
备份域当然会收下邮件啊
tiangangnet 说:
我认为备份域应该不会放到用户邮箱里呢。
Bibby 说:
等它自动检测到主域恢复之后,会自动将邮件都转发到主域上。
tiangangnet 说:
明白了!多谢!
安装完成后,生成的 iRedMail.tips 中,关于spamassasin 存放路径写错了。如下:
SpamAssassin:
* Configuration files:
- /etc/mail/spamassassin/
- Rules:
* /usr/share/spamassassin/
实际上存储在
SpamAssassin:
* Configuration files:
- /usr/local/etc/mail/spamassassin/
- Rules:
* /usr/local/share/spamassassin/
iRedMail 开源邮件服务解决方案 » 由 tiangangnet 发表的文章
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2010 PunBB.
页面生成时间 0.011 秒, 共执行查询 62 条