简体   繁体   English

邮件因Exim错误而停止工作

[英]Mail stopped working with exim error

I'm using the mail library with Sinatra. 我正在使用Sinatra的邮件库。 It was working before; 它以前工作过; I'm not exactly sure what change may have caused this error, but now when I look at mail.err , I see this: 我不完全确定是什么变化导致了此错误,但是现在当我查看mail.err ,我看到了:

Mar 6 07:35:01 App exim4: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken
Mar 6 07:35:02 App exim4: PANIC: sending out e-mail warning has failed, exim has non-zero return code

Upon further inspection, looking at the paniclog, I see the following: 经过进一步检查,查看紧急消息,我看到以下内容:

2015-03-06 12:54:31 Exim configuration file /var/lib/exim4/config.autogenerated
has the wrong owner, group, or mode
2015-03-06 12:59:34 Exim configuration file /var/lib/exim4/config.autogenerated
has the wrong owner, group, or mode

When I try to delete this paniclog, the error remains. 当我尝试删除此paniclog时,错误仍然存​​在。 Looking at the permissions of the aforementioned file, I see: 查看上述文件的权限,我看到:

drwxrwxr-x  2 root root         4096 Jan 28 18:59 .
drwxrwxr-x 33 root root         4096 Jan 22 11:30 ..
-rwxrwxr-x  1 root root            4 May  3  2013 berkeleydbvers.txt
-rwxrwxr-x  1 root Debian-exim 23661 Jan 28 18:59 config.autogenerated

Since it worked before, I don't know why permissions may be of issue, but if they are, I'm not sure is accessing this and what permissions further up the chain would be necessary to work this properly. 由于它以前曾经工作过,所以我不知道为什么权限可能会出现问题,但是,如果存在问题,我不确定是否要访问此权限,以及正确运行该权限需要进一步的权限。 Any suggestions would be very much appreciated!!! 任何建议将不胜感激!!!

Elaboration of permissions below: 详细说明以下权限:

/var/log/exim4$ namei -lm /var/lib/exim4/config.autogenerated
f: /var/lib/exim4/config.autogenerated
drwxr-xr-x root root        /
drwxrwxr-x root root        var
drwxrwxr-x root root        lib
drwxrwxr-x root root        exim4
-rwxrwx--- root Debian-exim config.autogenerated

The config file should not be executable, so try this: 配置文件不应是可执行文件,因此请尝试以下操作:

chmod 0660 config.autogenerated

This sets the file to read and write, for the owner and group. 这将所有者和组的文件设置为读写。

Possibly your file's permissions were changed by an update: 您的文件的权限可能已通过更新进行了更改:

update−exim4.conf changes the file permissions of the output file to the value of the environment variable CFILEMODE. update-exim4.conf将输出文件的文件权限更改为环境变量CFILEMODE的值。 If CFILEMODE is neither set in /etc/exim4/update−exim4.conf.conf nor in the environment it defaults to 0644. Change this to 0640 if you are keeping sensitive information (LDAP credentials et. al.) in there. 如果既不在/etc/exim4/update-exim4.conf.conf中也未在环境中设置CFILEMODE,则其默认值为0644。如果要在其中保存敏感信息(LDAP凭证等),请将其更改为0640。

Possibly your file's permissions were changed by something else, such as a script with an error, or a user accident. 可能是您的文件的权限被其他更改,例如带错误的脚本或用户事故。 Your .txt file in the same directory also has incorrect permissions, so a good area of investigation is to look at the file modification times, then see what else was happening on your system at the same time. 您在同一目录中的.txt文件也具有不正确的权限,因此,一个很好的研究领域是查看文件修改时间,然后查看系统上同时发生了什么。

You may want to look at other files nearby to see if they also have unexpected permissions, such as any file that you expect to be plain text that shows as executable. 您可能需要查看附近的其他文件,以查看它们是否也具有意外的权限,例如您希望将其作为纯文本显示为可执行文件的任何文件。

In my experience, this kind of error can be caused by as something like an overzealous cron script doing a recursive chmod to make a directory tree accessible, such as chmod o+rx /var . 以我的经验,这种错误可能是由于诸如过度热情的cron脚本执行递归chmod以使目录树可访问而引起的,例如chmod o+rx /var

There was bugs in exim which lead to security issues in Exim which permitted external third-parties to gain remote access to a system by exploiting a bug within the config file handling code. exim中存在一些错误,这些错误会导致Exim中的安全性问题,从而使外部第三方可以通过利用config文件处理代码中的错误来远程访问系统。

So it should be NOT writeable by user you mail system runs. 因此,您运行邮件系统的用户应该不能写它。 Please set mode to 0644 or 0640. 请将模式设置为0644或0640。

chmod 0640 config.autogenerated

0644 is debian policy by default so check what was breaking it and try to run update-exim4.conf to ensure it's rebuilding with correct mode. 默认情况下,0644是debian策略,因此请检查破坏它的原因,然后尝试运行update-exim4.conf以确保其以正确的模式进行重建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM