简体   繁体   中英

Mail stopped working with exim error

I'm using the mail library with 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:

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. 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. 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.

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.

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 .

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.

So it should be NOT writeable by user you mail system runs. Please set mode to 0644 or 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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