procmail
[Top] [All Lists]

Re: mailbox too big ?

2002-01-03 01:00:52
Hi Philip,

thank you for your answer.

After several hours of "trial and error" I created an /etc/procmailrc
like this:

# Only do this for one user (the 'traces' below)
:0
* LOGNAME ?? traces
{
        PID=$$
        SHELL=/bin/bash
        DEFAULT=/var/spool/mail-test/traces
        DUMMY=`strace -o $HOME/procmail.strace-$PID -p $PID \
                >/dev/null 2>/dev/null </dev/null &`
        DUMMY=`/bin/sleep 1`
}

The SHELL was necessary, otherwise it didn't create anything; "sleep"
was necessary to create files with contents, and I tried changing
"DEFAULT" to test other filesystems (see below).

I attached the output of strace. The error is indeed "-1 EFBIG (File too
large)".

So I guess, it's a problem of the underlying file system or other parts
of the linux kernel. I'm using SuSE Linux 7.3 with an "inofficially
SuSE-patched" 2.4.16-kernel; /var/spool/mail is on a reiserfs filesystem
and /var/spool/mail-test on an ext2 filesystem - both create the same
error. 

Thus I tried to write a test program to simulate the error (using the
strace output, see the second attachment), but I didn't manage to
simulate the same error with the same data (the test program just
appends the given letter without any errors).

Do you have any idea ?
My current idea is using local delivery without procmail and seeing,
whether this works with large mail boxes.


Olaf.

Philip Guenther wrote:

Olaf Menkens <olaf(_dot_)menkens(_at_)imk(_dot_)fraunhofer(_dot_)de> writes:
Most things work fine, but procmail can't append to large mailboxes.
Some users have inboxes of more than ~40MB. For these I see error
message like this in my log file:

Dec 22 00:29:41 vmsdmnew postfix/local[7741]: 16DB6862F:
to=<jas(_at_)vmsdmail(_dot_)gmd(_dot_)de>,
relay=local, delay=20505, status=deferred (temporary failure. Command
output: procmail: Error while writing to "/var/spool/mail/jas" )

Some additional infos:
- disk space is sufficient,
- no quota configured,
- file permissions are OK,
- delivery to other users (with smaller mailboxes) works without
problems.

That's weird.  It's not obvious what the problem is, so I suggest you
trace the procmail process to see what system call is returning an error.
This is most easily done from the /etc/procmailrc file with something
like:

        # Only do this for one user (the 'jas' below)
        :0
        * LOGNAME ?? ^^jas^^
        {
                pid = $$
                dummy = `strace -o $HOME/procmail.strace -p $pid \
                         >/dev/null 2>/dev/null </dev/null &`
        }

The redirections in the backquote bit are to make sure procmail doesn't
get stuck waiting for a pipe to be closed.

Anyway, once that's in place in the /etc/procmailrc file, send a message
to the user tested for and see what the strace output shows.

Philip Guenther

-- 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Olaf Menkens, IT Manager IMK       Tel. [49-2241-]14-2362
// olaf(_dot_)menkens(_at_)imk(_dot_)fraunhofer(_dot_)de     Fax: 
[49-2241-]14-2040
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
read(5, "", 2039)                       = 0
read(5, "", 1)                          = 0
close(5)                                = 0
wait4(-1, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 3841
--- SIGCHLD (Child exited) ---
alarm(0)                                = 959
lseek(4, 0, SEEK_CUR)                   = 255
read(4, "", 1024)                       = 0
close(4)                                = 0
setregid32(0xc8, 0xffffffff)            = 0
setreuid32(0x2744, 0xffffffff)          = 0
setuid32(0x2744)                        = 0
setregid32(0xffffffff, 0xc8)            = 0
open("/home/traces/.procmailrc", O_RDONLY) = -1 ENOENT (No such file or 
directory)
setuid32(0x2744)                        = 0
stat64("/var/spool/mail-test/traces", {st_mode=S_IFREG|0600, st_size=59937132, 
...}) = 0
wait4(-1, NULL, WNOHANG, NULL)          = -1 ECHILD (No child processes)
time(NULL)                              = 1009987124
lstat64("/var/spool/mail-test/_97.04yM8.vmsdmnew", 0xbffff9cc) = -1 ENOENT (No 
such file or directory)
open("/var/spool/mail-test/_97.04yM8.vmsdmnew", O_WRONLY|O_CREAT|O_EXCL, 0444) 
= 4
write(4, "0", 1)                        = 1
close(4)                                = 0
stat64("/var/spool/mail-test/_97.04yM8.vmsdmnew", {st_mode=S_IFREG|0400, 
st_size=1, ...}) = 0
link("/var/spool/mail-test/_97.04yM8.vmsdmnew", 
"/var/spool/mail-test/traces.lock") = 0
unlink("/var/spool/mail-test/_97.04yM8.vmsdmnew") = 0
setregid32(0xffffffff, 0xc8)            = 0
open("/var/spool/mail-test/traces", O_WRONLY|O_APPEND|O_CREAT, 0667) = 4
lseek(4, 0, SEEK_END)                   = 59937132
wait4(-1, NULL, WNOHANG, NULL)          = -1 ECHILD (No child processes)
lseek(4, 0, SEEK_CUR)                   = 59937132
fcntl64(4, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=59937132, len=0}) = 0
fcntl64(4, F_SETLK, {type=F_WRLCK, whence=SEEK_CUR, start=0, len=0}) = 0
flock(4, LOCK_EX|LOCK_NB)               = 0
lseek(4, 0, SEEK_END)                   = 59937132
write(4, "F", 1)                        = -1 EFBIG (File too large)
--- SIGXFSZ (File size limit exceeded) ---
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define FILE "/var/spool/mail/traces"

main(int argc, char **argv)
{
        int fd;
        off_t ofs;
        ssize_t c;
        static struct flock flck;

        fd=open(FILE, O_WRONLY|O_APPEND|O_CREAT, 0667);
        ofs=lseek(fd,0,SEEK_END);
        ofs=lseek(fd,0,SEEK_CUR);

        flck.l_type=F_WRLCK,flck.l_whence=SEEK_SET;flck.l_len=0;
        flck.l_start=ofs;
        fcntl(fd, F_SETLKW, &flck);

        flck.l_type=F_WRLCK,flck.l_whence=SEEK_CUR;flck.l_len=0;
        flck.l_start=0;
        fcntl(fd, F_SETLK, &flck);

        flock(fd, LOCK_EX|LOCK_NB);

        ofs=lseek(fd,0,SEEK_END);
        c=write(fd,"F",1);
        close(fd);
}
<Prev in Thread] Current Thread [Next in Thread>