Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I had a working sendmail configuration on my debian server, i tried to put a postfix to receive email but abandoned, remove postfix, re install sendmail but nothing work anymore :(

here is my mail.log

Feb  2 12:35:56 sd-42311 sendmail[14881]: s12BZuYe014881: from=root, size=69, class=0, nrcpts=1, msgid=<201402021135.s12BZuYe014881@sd-42311.dedibox.fr>, relay=root@localhost
Feb  2 12:35:56 sd-42311 sm-mta[14882]: s12BZuRw014882: SYSERR(root): collect: Cannot write ./dfs12BZuRw014882 (bfcommit, uid=0, gid=113): No such file or directory
Feb  2 12:35:57 sd-42311 sm-mta[14882]: s12BZuRw014882: from=<root@sd-42311.dedibox.fr>, size=336, class=0, nrcpts=1, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb  2 12:35:57 sd-42311 sendmail[14881]: s12BZuYe014881: to=n.beauvais78@gmail.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30069, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dfs12BZuRw014882 (bfcommit, uid=0, gid=113): No such file or directory

I already done some research on superuser/stackoverflow and other, here is my var/spool/, i itried several owner / chmod nothing worked

drwxr-xr-x 5 root root   4096 nov.  12 21:13 cron
lrwxrwxrwx 1 root root      7 févr.  1 21:54 mail -> ../mail
drwxr-xr-x 2 root root   4096 janv.  5 19:14 mlmmj
drwxrwsrwt 2 root smmsp  4096 févr. 11  2013 mqueue
drwxrws--- 2 root smmsp 12288 févr.  2 13:40 mqueue-client
drwxr-xr-x 2 root root   4096 mars   5  2013 rsyslog

I think my postfix is totaly removed, and no postfix daemon are running.

aptitude remove postfix --purge

Did somebody have a hint for my problem ? Thanks :)

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Sometimes the sendmail process refuses to die even if you have removed sendmail, and that could cause such issues.

In your case, just see if you have an existing sendmail process

$ sudo service sendmail stop $ ps auxwww | grep sendmail

If you find one, kill it and the 'No such file..' error should go.

share|improve this answer

Sendmail refuses to work if file/directory permissions are too broad for security reasons as described in DontBlameSendmail documentation. [DontBlameSendmail is THE LAST RESORT FIX.]

Your "world writable" permission for queue directory (mqueue) are insecure.

SECURITY file in sendmail distribution recomends:

drwx ------ root wheel ... /var/spool/mqueue
share|improve this answer

I followed instruction of DontBlameSendmail and the security file.

The command

sendmail -v -d44.4 -bv postmaster

give me

safefile(/etc/mail/sendmail.cf, uid=0, gid=0, flags=6000, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6000, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100444, mode 400]         OK
safefile(/etc/mail/local-host-names, uid=0, gid=0, flags=6580, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6580, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100644, mode 400]         OK
safefile(/etc/mail/relay-domains, uid=0, gid=0, flags=6580, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6580, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100644, mode 400]         OK
safefile(/etc/mail/service.switch, uid=0, gid=0, flags=6480, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6580, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100644, mode 400]         OK
safefile(/etc/mail/service.switch, uid=0, gid=0, flags=6480, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6580, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100644, mode 400]         OK
safedirpath(/var/spool/mqueue, uid=0, gid=0, flags=4, level=0, offset=0):
        [dir /var/spool/mqueue] OK
safefile(/etc/mail/service.switch, uid=0, gid=0, flags=6480, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=6580, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 0, nlink 1, stat 100644, mode 400]         OK
safefile(/etc/mail/aliases.db, uid=0, gid=0, flags=584, mode=400):
safedirpath(/etc/mail, uid=0, gid=0, flags=584, level=0, offset=0):
        [dir /etc/mail] OK
        [uid 110, nlink 1, stat 100640, mode 400]       OK
postmaster... aliased to root
root... aliased to hackstrong
safedirpath(/home/hackstrong, uid=1000, gid=1000, flags=1985, level=0, offset=0):
        [dir /home/hackstrong] OK
safefile(/home/hackstrong/.forward.sd-42311, uid=1000, gid=1000, flags=1895, mode=400):
        [uid 0, nlink 1, stat 100644, mode 4]   OK
hackstrong... deliverable: mailer local, user hackstrong

I don't see any error here ?

I also modified permission for sendmail but i'm not sure about what 'wheel' usergroup is ? :

var/spool/

drwxr-xr-x 5 root  root   4096 nov.  12 21:13 cron
lrwxrwxrwx 1 root  root      7 févr.  1 21:54 mail -> ../mail
drwxr-xr-x 2 root  root   4096 janv.  5 19:14 mlmmj
drwx------ 2 root  smmsp  4096 févr. 11  2013 mqueue
drwxrwx--- 2 smmsp smmsp 20480 févr.  3 10:05 mqueue-client
drwxr-xr-x 2 root  root   4096 mars   5  2013 rsyslog

usr/sbin/sendmail -> /usr/lib/sm.bin/sendmail

-r-xr-sr-x 1 root smmsp 868256 févr. 11  2013 sendmail

etc/mail

-r--r--r-- 1 root smmsp 64486 févr.  2 11:42 sendmail.cf
-r--r--r-- 1 root smmsp 44006 févr.  2 11:42 submit.cf

I still have the same error in my mail.log file :(

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.