Package: sendmail-bin
Version: 8.14.4-4
Severity: normal
File: /usr/lib/sm.bin/mail.local


The wheezy mail.local is unable to deliver mail. I was getting syslog
lines like:

Jan 26 07:41:37 bari mail.local[11136]: lockmailbox psz failed; error code 75 
Jan 26 07:41:37 bari sm-mta[11135]: s0PKfb67011134: 
to=<p...@bari.maths.usyd.edu.au>, delay=00:00:00, xdelay=00:00:00, 
mailer=local, pri=30977, dsn=4.0.0, stat=Deferred: local mailer 
(/usr/lib/sm.bin/mail.local) exited with EX_TEMPFAIL

Looking into the problem with strace, I noticed that running mail.local
with "strace -f" allowed it to succeed. A possible workaround is to move
mail.local to some new name and replacing or wrapping it with a script:

#!/bin/bash -
# mail.local fails, but behind strace it works just fine... weird??!!
# Start by doing:
#   mv -i /usr/lib/sm.bin/mail.local /usr/lib/sm.bin/mail.local.REAL
# then create this script in its place.
exec strace -o /dev/null -f /usr/lib/sm.bin/mail.local.REAL "$@"


=====


The following short C code demonstrates the issue.


/*
   Testing with code mimicking sendmail mail.local .
   Compile with
     cc mytest.c -llockfile
   Fails when running "plain" or with strace, but succeeds
   when running with  strace -f  as shown below:
root# ./a.out
lockmailbox psz code 2 errno=1
root# strace -o outx ./a.out
lockmailbox psz code 2 errno=1
root# strace -o outy -f ./a.out
root# 
   Another oddity: in the output of "strace -f" I see
   geteuid32() return 0 within the children (in the execed
   /usr/bin/dotlockfile): should not that return 1001?
*/

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <maillock.h>

int
main(argc, argv)
        int argc;
        char *argv[];
{
        /* name and UID of some plain user */
        char *p         = "psz";
        uid_t uid       = 1001;

        int off;

        /* use a reasonable umask */
        (void) umask(0077);

        /* change UID for quota checks */
        if (setreuid(0, uid) < 0)
        {
                printf("450 setreuid(0, %d) errno=%d (r=%d, e=%d)\n",
                        (int) uid, errno, (int) getuid(), (int) geteuid());
                exit(1);
        }

        if ((off = maillock(p, 15)) != 0)
        {
                printf("lockmailbox %s code %d errno=%d\n", p, off, errno);
        }

        mailunlock();
}


=====

Thanks, Paul

Paul Szabo   p...@maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia


-- Package-specific info:
Ouput of /usr/share/bug/sendmail-bin/script:

ls -alR /etc/mail:
/etc/mail:
total 124
drwxr-sr-x   7 smmta smmsp  1024 Jan 23 07:41 .
drwxr-xr-x 172 root  root  10240 Jan 23 11:11 ..
-rwxr-xr--   1 root  smmsp  8043 Jan 23 09:00 Makefile
-rw-------   1 root  root   4261 Jan 22 12:35 access
-rw-r-----   1 smmta smmsp  3072 Dec 22  2009 access.db
-rw-r--r--   1 root  smmsp     0 Dec 22  2009 aliases
-rw-r-----   1 smmta smmsp  3072 Jan 23 07:41 aliases.db
-rw-r--r--   1 root  smmsp  2804 Jan 23 09:00 databases
-rw-r--r--   1 root  root   5657 Jul 17  2008 helpfile
-rw-r--r--   1 root  smmsp    33 Dec 22  2009 local-host-names
drwxr-sr-x   2 smmta smmsp  1024 Dec 22  2009 m4
drwxr-xr-x   2 root  root   1024 Jan 22 12:35 peers
drwxr-xr-x   2 root  smmsp  1024 Jul 16  2008 sasl
-rw-r--r--   1 root  smmsp  9491 Jan 23 07:41 sendmail.cf
-rw-r--r--   1 root  root   8997 Jan 22 12:35 sendmail.cf.old
-rw-r--r--   1 root  root  10032 May  6  2002 sendmail.conf
-rw-r--r--   1 root  smmsp    46 Jan 23 07:41 sendmail.mc
drwxr-sr-x   2 smmta smmsp  1024 Dec 22  2009 smrsh
-rw-r--r--   1 root  smmsp  8844 Jan 23 07:41 submit.cf
-rw-r--r--   1 root  smmsp    55 Jan 22 12:35 submit.cf.errors
-rw-r--r--   1 root  root   8350 Jan 22 12:35 submit.cf.old
-rw-r--r--   1 root  smmsp    59 Jan 23 07:41 submit.mc
drwxr-xr-x   2 smmta smmsp  1024 Dec 22  2009 tls
-rw-r--r--   1 root  smmsp     0 Dec 22  2009 trusted-users

/etc/mail/m4:
total 2
drwxr-sr-x 2 smmta smmsp 1024 Dec 22  2009 .
drwxr-sr-x 7 smmta smmsp 1024 Jan 23 07:41 ..
-rw-r----- 1 root  smmsp    0 Dec 22  2009 dialup.m4
-rw-r----- 1 root  smmsp    0 Dec 22  2009 provider.m4

/etc/mail/peers:
total 2
drwxr-xr-x 2 root  root  1024 Jan 22 12:35 .
drwxr-sr-x 7 smmta smmsp 1024 Jan 23 07:41 ..

/etc/mail/sasl:
total 2
drwxr-xr-x 2 root  smmsp 1024 Jul 16  2008 .
drwxr-sr-x 7 smmta smmsp 1024 Jan 23 07:41 ..

/etc/mail/smrsh:
total 2
drwxr-sr-x 2 smmta smmsp 1024 Dec 22  2009 .
drwxr-sr-x 7 smmta smmsp 1024 Jan 23 07:41 ..
lrwxrwxrwx 1 root  smmsp   26 Dec 22  2009 mail.local -> 
/usr/lib/sm.bin/mail.local
lrwxrwxrwx 1 root  smmsp   17 Dec 22  2009 procmail -> /usr/bin/procmail
lrwxrwxrwx 1 root  smmsp   17 Dec 22  2009 vacation -> /usr/bin/vacation

/etc/mail/tls:
total 23
drwxr-xr-x 2 smmta smmsp 1024 Dec 22  2009 .
drwxr-sr-x 7 smmta smmsp 1024 Jan 23 07:41 ..
-rw-r--r-- 1 root  root     7 Dec 22  2009 no_prompt
-rw------- 1 root  root  1191 Dec 22  2009 sendmail-client.cfg
-rw-r--r-- 1 root  smmsp 1249 Dec 22  2009 sendmail-client.crt
-rw------- 1 root  root  1025 Dec 22  2009 sendmail-client.csr
-rw-r----- 1 root  smmsp 1675 Dec 22  2009 sendmail-common.key
-rw-r----- 1 root  smmsp 1582 Dec 22  2009 sendmail-common.prm
-rw------- 1 root  root  1191 Dec 22  2009 sendmail-server.cfg
-rw-r--r-- 1 root  smmsp 1249 Dec 22  2009 sendmail-server.crt
-rw------- 1 root  root  1025 Dec 22  2009 sendmail-server.csr
-rwxr--r-- 1 root  root  3260 Jan 22 12:35 starttls.m4

sendmail.conf:
DAEMON_MODE="Daemon";
DAEMON_PARMS="";
DAEMON_HOSTSTATS="Yes";
DAEMON_MAILSTATS="No";
QUEUE_MODE="${DAEMON_MODE}";
QUEUE_INTERVAL="10";
QUEUE_PARMS="";
MSP_MODE="${QUEUE_MODE}";
MSP_INTERVAL="${QUEUE_INTERVAL}";
MSP_PARMS="${QUEUE_PARMS}";
MSP_MAILSTATS="No";
MISC_PARMS="";
CRON_MAILTO="root";
CRON_PARMS="";
AGE_DATA="";
DAEMON_STATS="${DAEMON_MAILSTATS}";
MSP_STATS="${MSP_MAILSTATS}";


sendmail.mc:
[trigger for usr/share/sendmail/sm_helper.sh]

submit.mc...
FEATURE(`msp [trigger for usr/share/sendmail/sm_helper.sh]


-- System Information:
Debian Release: 7.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 3.2.51-pk06.21-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages sendmail-bin depends on:
ii  libc6          2.13-38
ii  libdb5.1       5.1.29-5
ii  libldap-2.4-2  2.4.31-1+nmu2
ii  liblockfile1   1.09-5
ii  libsasl2-2     2.1.25.dfsg1-6+deb7u1
ii  libssl1.0.0    1.0.1e-2+deb7u3
ii  libwrap0       7.6.q-24
ii  procps         1:3.3.3-3
ii  sendmail-base  8.14.4-4
ii  sendmail-cf    8.14.4-4

sendmail-bin recommends no packages.

Versions of packages sendmail-bin suggests:
ii  libsasl2-modules  2.1.25.dfsg1-6+deb7u1
ii  openssl           1.0.1e-2+deb7u3
pn  sasl2-bin         <none>
ii  sendmail-doc      8.14.4-4

Versions of packages sensible-mda depends on:
ii  libc6     2.13-38
ii  procmail  3.22-20

Versions of packages rmail depends on:
ii  libc6          2.13-38
ii  libldap-2.4-2  2.4.31-1+nmu2

-- Configuration Files:
/etc/init.d/sendmail changed [not included]

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to