Debian sendmail Cannot write

8,189

Solution 1

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.

Solution 2

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:
8,189

Related videos on Youtube

Nicolas Beauvais
Author by

Nicolas Beauvais

Updated on September 18, 2022

Comments

  • Nicolas Beauvais
    Nicolas Beauvais almost 2 years

    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=<[email protected]>, 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=<[email protected]>, 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: [email protected], 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 :)

  • jontsai
    jontsai almost 8 years
    Had this same issue, and this fixed it. Thank you so much!
  • Pierre.Sassoulas
    Pierre.Sassoulas about 7 years
    In other words : sudo chown root var/spool/mqueue