如果不小心删除了 /var/spool/mqueue 怎么办

如果不小心删除了 /var/spool/mqueue 怎么办

由于另一个脚本中的错误,var/spool/mqueue 中有 1000 封邮件。

我在某处读到应该删除 /var/spool/mqueue 以防止发送消息。

不幸的是,这样做之后sendmail似乎无法发送邮件!当我尝试发送邮件时,我永远不会收到它。

运行 mailq 给出以下输出:

MSP Queue status...
        /var/spool/mqueue-client (4 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
sAID7J0d003724       13 Tue Nov 18 13:07 me
                 (Deferred: 421 4.3.0 collect: Cannot write ./dfsAID7JS9003725)
                     [email protected]
sAID998F003775       15 Tue Nov 18 13:09 me
                 (Deferred: 421 4.3.0 collect: Cannot write ./dfsAID99Xx003776)
                     [email protected]
sAID7sxW003748      116 Tue Nov 18 13:07 me
                 (Deferred: 421 4.3.0 collect: Cannot write ./dfsAID7sQr003749)
                     [email protected]
sAID6QO1003700      117 Tue Nov 18 13:06 me
                 (Deferred: 421 4.3.0 collect: Cannot write ./dfsAID6Qda003701)
                     [email protected]
        Total requests: 4
MTA Queue status...
/var/spool/mqueue is empty
        Total requests: 0
me@mycomp:/var/spool/mqueue$ 

我该如何解决 ?

编辑:我通常通过以下方式发送邮件:

echo "My message" | sendmail [email protected]

答案1

使用以下命令创建目录

mkdir  /var/spool/mqueue

确保 mqueue 目录具有正确的权限

chown root:mail /var/spool/mqueue

然后重新启动Sendmail

service sendmail restart

相关内容