张工,您好!
我已经根据您提供的文章修复bug,但是即使配置$policy_bank{'ORIGINATING'} = {},只过滤外部邮件。目前效果上也还是严重影响邮件发送效率。不知道张工有没有其他高效的反垃圾邮件的方法。请告知,谢谢!

ZhangHuangbin 写道:

对于收到的邮件,上面的配置是没问题的,会进行扫描。你可以按照这个文档设置一下 amavisd,从更详细的 log 里检查它是否有在运行:
http://www.iredmail.com/docs/no.x-spam.headers.html

张工,我注释了$policy_bank{'MYUSERS'} 中的配置,反垃圾邮件功能已经生效。但是并没有按我预期的对自己域名不进行扫描方式生效。用户发邮件时全部都通过amavisd进行扫描。严重影响了邮件收发效率。
不知道对于反垃圾邮件这部分功能该如何进行优化,请张工给点建议。谢谢!

我只是希望反垃圾邮件功能能够区别扫描邮件,对于自己域名发件人发邮件给其他域名时不过滤,但对于其他域名发件人发送给我域名的邮件能够进行过滤。

我现在主要是希望邮件系统不要对我的域名发起的邮件进行扫描,所以参考了这篇文章(http://www.iredmail.com/docs/disable.spam.virus.scanning.for.outgoing.mails.html)做了配置。
按张工的意思说,
1.0.9.0版本里在$policy_bank{'MYUSERS'}配置什么都是无效的;
2.为了提高发件速度,禁止对我的域名发起的邮件进行扫描的话,那我应该怎么配置呢?

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:CentOS6.5
- 与您的问题相关的日志信息:
Oct 13 11:58:34 mailserver postfix/qmgr[17692]: 787A23DC05DD: from=<licheng@macrodata.com>, size=1906948, nrcpt=4 (queue active)
Oct 13 11:58:34 mailserver amavis[22094]: (22094-18) Net::Server: 2016/10/13-11:58:34 CONNECT TCP Peer: "[127.0.0.1]:52824" Local: "[127.0.0.1]:10024"
Oct 13 11:58:34 mailserver amavis[22094]: idle_proc, hi : was idle, 10452.5 ms, total idle 75.505 s, busy 12.199 s
Oct 13 11:58:34 mailserver amavis[22094]: loaded base policy bank
Oct 13 11:58:34 mailserver amavis[22094]: lookup_ip_acl (inet_acl) arr.obj: key="127.0.0.1" matches "127.0.0.1", result=1
Oct 13 11:58:34 mailserver amavis[22094]: process_request: fileno sock=12, STDIN=0, STDOUT=1
Oct 13 11:58:34 mailserver amavis[22094]: get_deadline switch_to_my_time(new request) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: prolong_timer switch_to_my_time(new request): timer 336, was 0, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: process_request: suggested_protocol="" on a TCP socket
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) SMTP> 220 [127.0.0.1] ESMTP amavisd-new service ready
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 4: was busy, 4.8 ms, total idle 75.505 s, busy 12.204 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp readline: read 34 bytes, new size: 34
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.6 ms, total idle 75.506 s, busy 12.204 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) SMTP< EHLO mailserver.macrodata.com\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP EHLO) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP EHLO): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-[127.0.0.1]
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-VRFY
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-PIPELINING
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-SIZE
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-ENHANCEDSTATUSCODES
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-8BITMIME
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250-DSN
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250 XFORWARD NAME ADDR PORT PROTO HELO IDENT SOURCE
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 3.2 ms, total idle 75.506 s, busy 12.207 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp readline: read 214 bytes, new size: 214
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.5 ms, total idle 75.506 s, busy 12.207 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< XFORWARD ADDR=10.131.0.149 PORT=50190\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP XFORWARD) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP XFORWARD): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250 2.5.0 Ok XFORWARD
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 1.3 ms, total idle 75.506 s, busy 12.209 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.3 ms, total idle 75.506 s, busy 12.209 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< XFORWARD PROTO=ESMTP HELO=Addison IDENT=787A23DC05DD SOURCE=REMOTE\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP XFORWARD) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP XFORWARD): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250 2.5.0 Ok XFORWARD
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 1.5 ms, total idle 75.506 s, busy 12.210 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.3 ms, total idle 75.507 s, busy 12.210 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< MAIL FROM:<licheng@macrodata.com> SIZE=1906948\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP MAIL) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP MAIL): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) check_mail_begin_task: task_count=19
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_ip_acl (client_ipaddr_policy) arr.obj: key="10.131.0.149" matches "10.0.0.0/8", result=1
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) loaded policy bank "MYNETS"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup: (scalar) matches, result="1"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup [local_domains] => true,  "licheng@macrodata.com" matches, result="1", matching_key="(constant:1)"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) query_keys: licheng@macrodata.com, licheng, @macrodata.com, @.macrodata.com, @.net, @.
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql sel_policy "licheng@macrodata.com", query args: [licheng@macrodata.com,-3], [licheng,-3], [@macrodata.com,-3], [@.macrodata.com,-3], [@.net,-3], [@.,-3]
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql select: SELECT users.*, policy.*, users.id FROM users LEFT JOIN policy ON users.policy_id=policy.id WHERE users.email IN (?,?,?,?,?,?) ORDER BY users.priority DESC
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) sql begin, nontransaction
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) sql: executing clause (6 args): SELECT users.*, policy.*, users.id FROM users LEFT JOIN policy ON users.policy_id=policy.id WHERE users.email IN (?,?,?,?,?,?) ORDER BY users.priority DESC
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql, "licheng@macrodata.com" no match
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql_field(local), "licheng@macrodata.com" no matching records
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup: (scalar) matches, result="1"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup [local_domains] => true,  "licheng@macrodata.com" matches, result="1", matching_key="(constant:1)"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) loaded policy bank "MYUSERS" over "MYNETS"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup [debug_sender] => undef, "licheng@macrodata.com" does not match
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) mesage size set to a declared size 1906948
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250 2.1.0 Sender <licheng@macrodata.com> OK
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 8.1 ms, total idle 75.507 s, busy 12.218 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.3 ms, total idle 75.507 s, busy 12.218 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< RCPT TO:<svbak@macrodata.com> NOTIFY=NEVER\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP RCPT) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP RCPT): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup => undef, "svbak@macrodata.com", no lookup tables
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup: (scalar) matches, result="1"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup [local_domains] => true,  "svbak@macrodata.com" matches, result="1", matching_key="(constant:1)"
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) query_keys: svbak@macrodata.com, svbak, @macrodata.com, @.macrodata.com, @.net, @.
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql sel_policy "svbak@macrodata.com", query args: [svbak@macrodata.com,-3], [svbak,-3], [@macrodata.com,-3], [@.macrodata.com,-3], [@.net,-3], [@.,-3]
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql select: SELECT users.*, policy.*, users.id FROM users LEFT JOIN policy ON users.policy_id=policy.id WHERE users.email IN (?,?,?,?,?,?) ORDER BY users.priority DESC
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) sql begin, nontransaction
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) sql: executing clause (6 args): SELECT users.*, policy.*, users.id FROM users LEFT JOIN policy ON users.policy_id=policy.id WHERE users.email IN (?,?,?,?,?,?) ORDER BY users.priority DESC
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql, "svbak@macrodata.com" no match
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup_sql_field(message_size_limit), "svbak@macrodata.com" no matching records
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) lookup [message_size_limit] => undef, "svbak@macrodata.com" does not match
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 250 2.1.5 Recipient <svbak@macrodata.com> OK
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 4.5 ms, total idle 75.507 s, busy 12.223 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 6: was busy, 4.5 ms, total idle 75.507 s, busy 12.223 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) idle_proc, 5: was idle, 0.3 ms, total idle 75.507 s, busy 12.223 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< DATA\r\n
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx SMTP DATA) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx SMTP DATA): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP:[127.0.0.1]:10024 /var/spool/amavisd/tmp/amavis-20161013T115706-22094-rhb0KtIT: <licheng@macrodata.com> -> <svbak@macrodata.com> SIZE=1906948 Received: from mailserver.macrodata.com ([127.0.0.1]) by localhost (mailserver.macrodata.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <svbak@macrodata.com>; Thu, 13 Oct 2016 11:58:34 +0800 (CST)
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP> 354 End data with <CR><LF>.<CR><LF>
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, smtp response sent
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) switch_to_client_time 480 s, receiving data
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65537
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 65536 bytes into buffer, new size: 65536
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: read 6415 bytes into buffer, new size: 6415
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp copy: 6 bytes still buffered at end
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline switch_to_my_time(rx data-end) - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer switch_to_my_time(rx data-end): timer 336, was 480, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) ESMTP< .<CR><LF>
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) Actual message size 1906950 B greater than the declared 1906948 B
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) smtp connection cache, dt: 10.5, state: 1
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline get_body_digest - deadline in 480.0 s, set to 30.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline digest_pre - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer digest_pre: timer 336, was 336, deadline in 480.0 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_body_digest: reading header section from a file
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_body_digest: sending h/b separator to DKIM
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) get_deadline digest_hdr - deadline in 480.0 s, set to 336.000 s
Oct 13 11:58:34 mailserver amavis[22094]: (22094-19) prolong_timer digest_hdr: timer 336, was 336, deadline in 480.0 s
====
张工,你好!
之前因反垃圾邮件和反病毒功能影响邮件发送效率,后来我停用了该功能。但后来因需要,重新启用反垃圾邮件功能(未启用反病毒功能)并做了小部分的调整。但是从效果上看感觉并没有起到反垃圾的作用。下面是我做的一些调整,麻烦张工帮我分析下对不对。
1.    修改配置文件main.cf
# 启动邮件内容过滤器,去掉以下参数前的注释
content_filter = smtp-amavis:[127.0.0.1]:10024
2.    修改配置文件amavisd.conf
# 取消病毒扫描功能,去掉以下参数前的注释
@bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# 取消对macrodata.com域名发起邮件的扫描,新增以下参数
$policy_bank{'ORIGINATING'} = {

# 20161010
  # don't perform spam/virus/header check.
  bypass_spam_checks_maps => [1],
  bypass_virus_checks_maps => [1],
  bypass_header_checks_maps => [1],

  bypass_banned_checks_maps => [1],  # allow sending any file names and types

}
# 取消对我司邮件客户端发起邮件的扫描,去掉以下参数前的注释
$policy_bank{'MYUSERS'} = {

    # don't perform spam/virus/header check.
    bypass_spam_checks_maps => [1],
    bypass_virus_checks_maps => [1],
    bypass_header_checks_maps => [1],
   
# allow sending any file names and types
bypass_banned_checks_maps => [1],
     …
     }
3.    启动扫描相关服务
chkconfig clamd.amavisd on
chkconfig spamassassin on
4.    重启服务
/etc/init.d/clamd.amavisd start
/etc/init.d/spamassassin start
/etc/init.d/amavisd restart
postfix reload

查看了下,是这个原因造成的。谢谢!

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:CentOS6.5
- 与您的问题相关的日志信息:
Oct 10 18:10:17 mailserver postfix/smtp[26115]: fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter
Oct 10 18:10:18 mailserver postfix/master[25783]: warning: process /usr/libexec/postfix/smtp pid 26115 exit status 1
Oct 10 18:10:18 mailserver postfix/master[25783]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
Oct 10 18:11:18 mailserver postfix/smtp[26117]: fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter
Oct 10 18:11:19 mailserver postfix/master[25783]: warning: process /usr/libexec/postfix/smtp pid 26117 exit status 1
Oct 10 18:11:19 mailserver postfix/master[25783]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
Oct 10 18:12:19 mailserver postfix/smtp[26120]: fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter
Oct 10 18:12:20 mailserver postfix/master[25783]: warning: process /usr/libexec/postfix/smtp pid 26120 exit status 1
Oct 10 18:12:20 mailserver postfix/master[25783]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
====
系统日志中一直报这个错误,之前因为邮件收发慢的问题将clamav和spamssassin过滤功能关闭,现在想重新开启,于是将main.cf配置文件中的content_filter = smtp-amavis:[127.0.0.1]:10024的注释去掉,但是去掉注释后用户就发不出邮件了,且日志里一直报错。不知道是什么原因导致的,smtp_sasl_password_maps参数也是默认值(空),没有另行设置。

-rw------- 1 vmail vmail 8904712 6月  28 08:25 /var/log/dovecot-sieve.log
文件存在,且只有vmail用户有读写权限。而且这种错误只有少量的,如果没有文件,在邮件投递的过程中应该会全部报这个错吧。所以我现在也很疑惑到底是什么原因造成的。

=======maillog
Jun 27 02:29:17 mailserver postfix/local[31583]: 38B133DC0623: to=<sa@mailserver.mail.com>, relay=local, delay=555, delays=555/0.02/0/0.08, dsn=4.3.0, status=deferred (temporary failure. Command output: Can't open log file /var/log/dovecot-sieve.log: Permission denied )
-rw------- 1 vmail vmail 5955639 6月  27 17:32 dovecot-sieve.log
张工,邮件日志里还是有少量这种类型的邮件退信日志。虽然日志里已经说明没有权限访问这个文件(上面是文件的权限),但是我理解是不是有什么其他原因造成的。

========dovecot.log
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 23 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 22 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Warning: read(/var/run/dovecot/dict): dict lookup took 22 seconds
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced
Jun 24 09:11:47 imap(aaa@mail.com): Error: dict quota: Quota update failed, it's now desynced

Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction
Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction
Jun 24 09:12:06 dict: Error: sql dict: commit failed: Lock wait timeout exceeded; try restarting transaction

张工,邮件退信时dovecot组件还报了这些错误。看起来像是dovecot与数据库对接时有问题,不知道这个该怎么处理。

=======dovecot.log
Jun 23 16:33:00 master: Warning: service(dict): process_limit (100) reached, client connections are being dropped
Jun 23 16:33:00 dict: Info: mysql(127.0.0.1): Connected to database vmail

Jun 23 16:33:10 imap(aa@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(bb@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(cc@mail.com): Error: read(/var/run/dovecot/dict) failed: Connection reset by peer
Jun 23 16:33:10 imap(dd@mail.com): Error: Internal quota calculation error

张工,调整完后还是存在少量的退信问题,其中报错日志如上。是不是由于dovecot服务中处理限制的值过小导致的。是否把default_process_limit参数值调大点即可。还是说有其他什么原因造成以上错误。

=======maillog
Jun 24 02:29:17 mailserver postfix/local[30177]: 70BCC3DC05CE: to=<sa@mailserver.mail.com>, relay=local, delay=555, delays=555/0.02/0/0.07, dsn=4.3.0, status=deferred (temporary failure. Command output: Can't open log file /var/log/dovecot-sieve.log: Permission denied )
-rw-------  1 vmail       vmail        32370055 6月  24 09:22 dovecot-sieve.log
还有,日志中报了少量无法打开日志文件,没有权限的问题。我看了下,应该是对该文件有读写的权限,不知道是什么原因导致的。

=========maillog
1)
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf: table lookup problem
Jun 20 10:16:30 mailserver postfix/trivial-rewrite[17190]: warning: virtual_mailbox_domains lookup failure
2)
Jun 20 10:16:42 mailserver postfix/error[20414]: 8B6D93DC0638: to=<bbb@mail.com>, relay=none, delay=17, delays=4.6/0.6/0/12, dsn=4.3.0, status=deferred (address resolver failure)
3)
Jun 22 16:39:18 mailserver postfix/smtpd[1029]: NOQUEUE: reject: RCPT from unknown[172.17.73.1]: 451 4.3.0 <aaa@mail.com>: Temporary lookup failure; from=<aaa@mail.com> to=<lll@mail.com> proto=ESMTP helo=<127.0.0.1>
张工,邮件日志里还有上面几种发送邮件失败的错误(virtual_mailbox_domains lookup failure),(address resolver failure),(Temporary lookup failure),不知道是不是因为数据库连接数不够引起的,还是有其他的原因。

========dovecot.log
Jun 21 15:47:40 dict: Error: mysql(127.0.0.1): Connect failed to database (vmail): Too many connections - waiting for 25 seconds before retry
Jun 21 15:47:40 dict: Error: dict sql lookup failed: Not connected to database
Jun 21 15:47:40 dict: Error: dict sql lookup failed: Not connected to database
========dovecot-sieve.log
Jun 21 15:47:40 lda(lll@mail.com): Error: Internal quota calculation error
Jun 21 15:47:40 lda(lll@mail.com): Error: sieve: msgid=<001a01d1cb8f$d10877d0$73196770$@mail.com>: failed to store into mailbox 'INBOX': Internal error occurred. Refer to server log for more information. [2016-06-21 15:47:40]
Jun 21 15:47:40 lda(lll@mail.com): Error: sieve: script //var/vmail/vmail1/mail.com/y/a/n/lll-2013.03.25.10.30.51//sieve/dovecot.sieve failed with unsuccessful implicit keep (user logfile //var/vmail/vmail1/mail.com/l/l/l/lll-2013.03.25.10.30.51//sieve/dovecot.sieve.log should reveal additional details)

张工,我看了下dovecot.log日志提示数据库连接数不够,已经调整了max_connections参数,但dovecot-sieve.log日志中的错误信息不是很明白,还要做其他调整吗?

邮件服务我在main.cf中注释了content_filter配置,amavisd配置中注释了bypass_spam_checks_maps => [1],bypass_virus_checks_maps => [1],bypass_header_checks_maps => [1]配置,关闭了杀毒和内容过滤的功能,但检查时amavisd和clamd服务仍在跑,不知道和这个有没有关系。

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:centos6.5
- 与您的问题相关的日志信息:
Jun 21 15:47:35 mailserver postfix/pipe[9178]: E07B53DC062D: to=<aa@mail.com>, relay=dovecot, delay=606, delays=593/12/0/0.1, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8937]: E07B53DC062D: to=<dd@mail.com>, relay=dovecot, delay=606, delays=593/0.91/0/11, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8931]: E07B53DC062D: to=<cc@mail.com>, relay=dovecot, delay=606, delays=593/0.82/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8943]: E07B53DC062D: to=<dd@mail.com>, relay=dovecot, delay=606, delays=593/12/0/0.09, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8939]: E07B53DC062D: to=<ee@mail.com>, relay=dovecot, delay=606, delays=593/0.93/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:35 mailserver postfix/pipe[8949]: E07B53DC062D: to=<ff@mail.com>, relay=dovecot, delay=606, delays=593/11/0/1.2, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:35 mailserver postfix/pipe[8012]: E07B53DC062D: to=<gg@mail.com>, relay=dovecot, delay=606, delays=593/12/0/1, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8959]: E07B53DC062D: to=<hh@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.15, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8959]: E07B53DC062D: to=<ii@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.18, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[8955]: E07B53DC062D: to=<jj@mail.com>, relay=dovecot, delay=606, delays=593/13/0/0.15, dsn=4.3.0, status=deferred (temporary failure)
Jun 21 15:47:36 mailserver postfix/pipe[5065]: E07B53DC062D: to=<kk@mail.com>, relay=dovecot, delay=606, delays=593/0.74/0/12, dsn=2.0.0, status=sent (delivered via dovecot service)
Jun 21 15:47:36 mailserver postfix/pipe[8955]: E07B53DC062D: to=<ll@mail.com>, relay=dovecot, delay=607, delays=593/13/0/0.19, dsn=4.3.0, status=deferred (temporary failure)
====
张工,你好!我们公司同事在发邮件(发给将近500个用户)时,出现了大量的temporary failure错误,最终有100多个用户发送失败。之前iredapd升级过,我这边用的是iRedAPD-1.6.0。不知道这是什么问题导致的,该如何解决,请帮忙解答下。谢谢!