主题: 急:只能发邮件不能收邮件

星期五还能正常收发邮件,今天上班就发现只能发不能收了,我用gmai发邮也没有收到退信,日志如下:
Aug 23 20:12:32 www postfix/pipe[22124]: fatal: get_service_attr: unknown group: vmail
Aug 23 20:12:32 www postfix/pipe[22126]: fatal: get_service_attr: unknown group: vmail
Aug 23 20:12:32 www postfix/pipe[22128]: fatal: get_service_attr: unknown group: vmail
Aug 23 20:12:32 www postfix/pipe[22130]: fatal: get_service_attr: unknown group: vmail
Aug 23 20:12:33 www postfix/smtp[22123]: connect to mail.mymail-in.net[217.20.163.8]: Connection refused (port 25)
Aug 23 20:12:33 www postfix/smtp[22129]: connect to mail.mymail-in.net[217.20.163.8]: Connection refused (port 25)
Aug 23 20:12:33 www postfix/smtpd[22131]: connect from unknown[81.223.254.209]
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: premature end-of-input on private/dovecot socket while reading input attribute name
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: private/dovecot socket: malformed response
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: transport dovecot failure -- see a previous warning/fatal/panic logfile record for the problem description
Aug 23 20:12:33 www postfix/master[22118]: warning: process /usr/libexec/postfix/pipe pid 22124 exit status 1
Aug 23 20:12:33 www postfix/master[22118]: warning: /usr/libexec/postfix/pipe: bad command startup -- throttling
Aug 23 20:12:33 www postfix/master[22118]: warning: process /usr/libexec/postfix/pipe pid 22126 exit status 1
Aug 23 20:12:33 www postfix/qmgr[22121]: E659A4004BE: to=<contact@leawo.com>, relay=none, delay=5428, delays=5427/1/0/0, dsn=4.3.0, status=deferred (unknown
mail transport error)
Aug 23 20:12:33 www postfix/master[22118]: warning: process /usr/libexec/postfix/pipe pid 22128 exit status 1
Aug 23 20:12:33 www postfix/master[22118]: warning: process /usr/libexec/postfix/pipe pid 22130 exit status 1
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: premature end-of-input on private/dovecot socket while reading input attribute name
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: private/dovecot socket: malformed response
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: transport dovecot failure -- see a previous warning/fatal/panic logfile record for the problem description
Aug 23 20:12:33 www postfix/qmgr[22121]: 6B0394004A8: to=<hr@moyeasoft.com>, relay=none, delay=1090, delays=1089/1/0/0, dsn=4.3.0, status=undeliverable (unkn
own mail transport error)
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: premature end-of-input on private/dovecot socket while reading input attribute name
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: private/dovecot socket: malformed response
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: transport dovecot failure -- see a previous warning/fatal/panic logfile record for the problem description
Aug 23 20:12:33 www postfix/qmgr[22121]: D91164004BD: to=<info@playerdiy.com>, relay=none, delay=5435, delays=5434/1/0/0, dsn=4.3.0, status=deferred (unknown
mail transport error)
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: premature end-of-input on private/dovecot socket while reading input attribute name
Aug 23 20:12:33 www postfix/qmgr[22121]: warning: private/dovecot socket: malformed response

回复: 急:只能发邮件不能收邮件

Aug 23 20:12:32 www postfix/pipe[22124]: fatal: get_service_attr: unknown group: vmail


vmail 这个组不存在。

Aug 23 20:12:33 www postfix/qmgr[22121]: warning: premature end-of-input on private/dovecot socket while reading input attribute name


Dovecot 服务不正常。

回复: 急:只能发邮件不能收邮件

在etc/group文件里可以看到
vmail:x:2000
dovecot:x:97
这些跟postfix相关的组都存在

回复: 急:只能发邮件不能收邮件

现在是同一个域名下的有些邮箱能正常收发,但有些又不能收邮件,退信提示:Technical details of permanent failure:
DNS Error: Domain name not found 但我拼这个域名的解析IP又是正确的,想不通

回复: 急:只能发邮件不能收邮件

service amavisd start
Starting Mail Virus Scanner (amavisd): Error in config file "/etc/amavisd.conf": Can't open PEM file /var/lib/dkim/moyeamedia.com.pem: Permission denied at /usr/sbin/amavisd line 536.
                                                           [FAILED]
这个服务对收发邮件是否有影响?

回复: 急:只能发邮件不能收邮件

service amavisd start
Starting Mail Virus Scanner (amavisd): Error in config file "/etc/amavisd.conf": Can't open PEM file /var/lib/dkim/moyeamedia.com.pem: Permission denied at /usr/sbin/amavisd line 536.
                                                           [FAILED]
这个服务对收发邮件是否有影响?


有,会导致你收不到邮件。

这样修正它:

# chmod +r /var/lib/dkim/moyeamedia.com.pem
# /etc/init.d/amavisd restart

这时候你的邮件应该可以正常收发了,可以用以下命令强制 postfix 重新投递停留在队列里的邮件:

# postqueue -f

回复: 急:只能发邮件不能收邮件

刚才按你的提示操作:重启时,还是提示
[root@www ~]# /etc/init.d/amavisd restart
Shutting down Mail Virus Scanner (amavisd):                [FAILED]
Starting Mail Virus Scanner (amavisd): Error in config file "/etc/amavisd.conf": dkim_key: selector dkim for domain moyeamedia.com already in use
                                                                                                     [FAILED]

回复: 急:只能发邮件不能收邮件

将以下命令的输出贴上来:

# grep 'dkim_key' /etc/amavisd.conf

如果你是 Debian/Ubuntu 系统,将上面的 /etc/amavisd.conf 的路径改为 /etc/amavis/conf.d/50-user

回复: 急:只能发邮件不能收邮件

[root@www ~]# grep 'dkim_key' /etc/amavisd.conf
# Add dkim_key here.
dkim_key("moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host1.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host3.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');
# Add dkim_key here.
dkim_key("moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host1.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host3.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');


我用的系统是Cent OS 5.3

回复: 急:只能发邮件不能收邮件

你的文件里有两条同样的配置:

dkim_key("moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");


注销掉一个,重启 amavisd 应该就可以了。

回复: 急:只能发邮件不能收邮件

注销掉一条后,重启提示如下:
[root@www ~]# service amavisd start
Starting Mail Virus Scanner (amavisd): No listen sockets or ports specified
                                                           [FAILED]

回复: 急:只能发邮件不能收邮件

你是否重复安装了 iRedMail?这样搞得很多东西无法预料。

贴你完整的 /etc/amavisd.conf 文件吧。

回复: 急:只能发邮件不能收邮件

[root@www ~]# cat /etc/amavisd.conf

# Add dkim_key here.
dkim_key("moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");

# Note that signing mail for subdomains with a key of a parent
# domain is treated by recipients as a third-party key, which
# may 'hold less merit' in their eyes. If one has a choice,
# it is better to publish a key for each domain (e.g. host1.a.cn)
# if mail is really coming from it. Sharing a pem file
# for multiple domains may be acceptable, so you don't need
# to generate a different key for each subdomain, but you
# do need to publish it in each subdomain. It is probably
# easier to avoid sending addresses like host1.a.cn and
# always use a parent domain (a.cn) in 'From:', thus
# avoiding the issue altogether.
#dkim_key("host1.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host3.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");

# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');

@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: moyeamedia.com.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    'postmaster@moyeamedia.com'    => { d => "moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl =>  7*24*3600 },
    #"spam-reporter@moyeamedia.com"    => { d => "moyeamedia.com", a => 'rsa-sha                                                                             256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "moyeamedia.com"  => { d => "moyeamedia.com", a => 'rsa-sha256', ttl => 10*2                                                                             4*3600 },
    #"host1.moyeamedia.com"  => { d => "host1.moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl => 10*24*3600 },
    #"host2.moyeamedia.com"  => { d => "host2.moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl => 10*24*3600 },
    # ---- End domain: moyeamedia.com ----

    # catchall defaults
    '.' => { a => 'rsa-sha256', c => 'relaxed/simple', ttl => 30*24*3600 },
} );

# Set listen IP/PORT.
$notify_method  = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';

# Set default action.
$final_virus_destiny      = D_DISCARD;
$final_banned_destiny     = D_PASS;
$final_spam_destiny       = D_PASS;
$final_bad_header_destiny = D_PASS;
# Add dkim_key here.
#dkim_key("moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");

# Note that signing mail for subdomains with a key of a parent
# domain is treated by recipients as a third-party key, which
# may 'hold less merit' in their eyes. If one has a choice,
# it is better to publish a key for each domain (e.g. host1.a.cn)
# if mail is really coming from it. Sharing a pem file
# for multiple domains may be acceptable, so you don't need
# to generate a different key for each subdomain, but you
# do need to publish it in each subdomain. It is probably
# easier to avoid sending addresses like host1.a.cn and
# always use a parent domain (a.cn) in 'From:', thus
# avoiding the issue altogether.
#dkim_key("host1.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");
#dkim_key("host3.moyeamedia.com", "dkim", "/var/lib/dkim/moyeamedia.com.pem");

# Add new dkim_key for other domain.
#dkim_key('Your_New_Domain_Name', 'dkim', 'Your_New_Pem_File');

@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: moyeamedia.com.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    'postmaster@moyeamedia.com'    => { d => "moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl =>  7*24*3600 },
    #"spam-reporter@moyeamedia.com"    => { d => "moyeamedia.com", a => 'rsa-sha                                                                             256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "moyeamedia.com"  => { d => "moyeamedia.com", a => 'rsa-sha256', ttl => 10*2                                                                             4*3600 },
    #"host1.moyeamedia.com"  => { d => "host1.moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl => 10*24*3600 },
    #"host2.moyeamedia.com"  => { d => "host2.moyeamedia.com", a => 'rsa-sha256'                                                                             , ttl => 10*24*3600 },
    # ---- End domain: moyeamedia.com ----

    # catchall defaults
    '.' => { a => 'rsa-sha256', c => 'relaxed/simple', ttl => 30*24*3600 },
} );

# Set listen IP/PORT.
$notify_method  = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';

# Set default action.
$final_virus_destiny      = D_DISCARD;
$final_banned_destiny     = D_PASS;
$final_spam_destiny       = D_PASS;
$final_bad_header_destiny = D_PASS;

@av_scanners = (

    #### http://www.clamav.net/
    ['ClamAV-clamd',
    \&ask_daemon, ["CONTSCAN {}\n", "/tmp/clamd.socket"],
    qr/\bOK$/, qr/\bFOUND$/,
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

@av_scanners_backup = (

    ### http://www.clamav.net/   - backs up clamd or Mail::ClamAV
    ['ClamAV-clamscan', 'clamscan',
    "--stdout --disable-summary -r --tempdir= {}", [0], [1],
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

# SpamAssassin debugging. Default if off(0).
# Note: '$log_level' variable above is required for SA debug.
$sa_debug = 0;

# Modify email subject, add ''.
#   0:  disable
#   1:  enable
$sa_spam_modifies_subj = 1;

# remove existing headers
#$remove_existing_x_scanned_headers= 0;
#$remove_existing_spam_headers = 0;

# Leave empty (undef) to add no header.
# Modify /usr/sbin/amavisd file to add customize header in:
#
#   sub add_forwarding_header_edits_per_recip
#
#$X_HEADER_TAG = 'X-Virus-Scanned';
#$X_HEADER_LINE = "by amavisd at $myhostname";

1;  # insure a defined return

是的,因为以前服务器出现过一次问题,很多服务都运行不了了,IredMail装了好多次才装上去的,装了好几天才成功,可谓痛苦呀,而且这方面的资料又比较少,只能自己不断的重复摸索

回复: 急:只能发邮件不能收邮件

先把你现在的 /etc/amavisd.conf 备份一下,然后用我附件里的替换掉你现在的。

注意:将里面所有关于域 a.cn 的地方,都替换成你自己的域名,并且注意一下 DKIM文件 的路径。之后基本就可以了。

回复: 急:只能发邮件不能收邮件

以我的系统上,在没有启动amavisd服务时,也一样能正常收发邮件,我用的是:IredMail 0.4版本的

回复: 急:只能发邮件不能收邮件

它只是有默认的配置而已

我现在能给的解决方法就是备份旧配置文件后用新的替代,你可以试试。