Hi,

After further investigation, I discovered ./Maildir/ is being
automatically added to the cmd.s array in qmail-local.c (line 1000) , so
delivery will happen regardless of what exit status the .qmail script
returns.  I unfortunately don't have the C skills to hack this out. Can
anyone make a suggestion of how this might be fixed? A good
recommendation for a book on C programing for someone with a Perl
background would also be appreciated.  

Here is an example of what I'm trying to fix

My .qmail file I'm using to test with.
webserver:/var/qmail/maildirs/dwalliance.com/test6 # cat .qmail
| /var/qmail/maildirs/dwalliance.com/test6/exit99.sh
./Maildir/

Currently:
qmail-local will deliver to ./Maildir/ then it will run
/var/qmail/maildirs/dwalliance.com/test6/exit99.sh
it will then exit since this script returns a 99 exit code.

Fixed
qmail-local FIRST runs 
/var/qmail/maildirs/dwalliance.com/test6/exit99.sh
and then will deliver to ./Maildir/ if exit status is NOT 99.

Thanks in advance for any help,

-Kent




On Mon, 2002-12-30 at 13:25, Kent Brake wrote:
> Hi,
> 
> I am attempting to implement spamassassin on a per user configured
> basis, but qmail-local seems to be ignoring the exit status of my .qmail
> script and writing the a message to the Inbox regardless of my exit
> code. I've used the following test to validate
> 
> my .qmail file
> 
> webserver:/var/qmail/maildirs/dwalliance.com/test3 # cat .qmail 
> | ./exit99.sh
> ./Maildir/
> 
> my test script 
> 
> webserver:/var/qmail/maildirs/dwalliance.com/test3 # cat exit99.sh 
> #!/bin/sh
> exit 99
> 
> 
> the dot-qmail man page states:
> 
> " If a program returns exit code 99, qmail-local ignores all succeeding
> lines in .qmail, but it still pays attention to previous forward lines."
> 
> So my conclusion is that qmail-local should not write the message to
> ./Maildir/. Has anyone ran into this in the past, or are familiar with
> .qmail scripts and can show me the error of my ways?
> 
> I'm running
> SuSE 8.1
> qmail-ldap-1.03-20020501
> qmail-ldap-control_20020524
> 
> 
> Here an strace of the issue
> 
> webserver:/var/qmail/maildirs/dwalliance.com/test3 #  echo "$?";cat
> Maildir/cur/1041118461.25382.webserver,S\=1427\:2,S|strace
> /var/qmail/bin/qmail-local -n vmail
> /var/qmail/maildirs/dwalliance.com/test3 vmail '' '' '' '' ./Maildir/ ;
> echo "$?"
> 0
> 
> 
> 
> execve("/var/qmail/bin/qmail-local", ["/var/qmail/bin/qmail-local",
> "-n", "vmail", "/var/qmail/maildirs/dwalliance.com/test3", "vmail", "",
> "", "", "", "./Maildir/"], [/* 47 vars */]) = 0
> uname({sys="Linux", node="webserver", ...}) = 0
> brk(0)                                  = 0x8055564
> open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=50529, ...}) = 0
> old_mmap(NULL, 50529, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000
> close(3)                                = 0
> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\330\332"...,
> 1024) = 1024
> fstat64(3, {st_mode=S_IFREG|0755, st_size=1394238, ...}) = 0
> old_mmap(NULL, 1210816, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> 0x40024000
> mprotect(0x40141000, 43456, PROT_NONE)  = 0
> old_mmap(0x40141000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
> 3, 0x11c000) = 0x40141000
> old_mmap(0x40148000, 14784, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40148000
> close(3)                                = 0
> munmap(0x40017000, 50529)               = 0
> umask(077)                              = 022
> rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
> chdir("/var/qmail/maildirs/dwalliance.com/test3") = 0
> stat64(".", {st_mode=S_IFDIR|0755, st_size=416, ...}) = 0
> time(NULL)                              = 1041283394
> write(1, "unlimited quota", 15unlimited quota)         = 15
> write(1, "\n", 1
> )                       = 1
> open(".qmail", O_RDONLY|O_NONBLOCK)     = 3
> fstat64(3, {st_mode=S_IFREG|0444, st_size=25, ...}) = 0
> read(3, "| ./exit99.sh\n./Maildir/\n", 256) = 25
> read(3, "", 256)                        = 0
> close(3)                                = 0
> write(1, "program  ./exit99.sh", 20program  ./exit99.sh)    = 20
> write(1, "\n", 1
> )                       = 1
> write(1, "maildir ./Maildir/", 18maildir ./Maildir/)      = 18
> write(1, "\n", 1
> )                       = 1
> write(1, "did 1+0+1\n", 10did 1+0+1
> )             = 10
> _exit(0)                                = ?
> 0
-- 
Kent Brake <[EMAIL PROTECTED]>
-- 
Kent Brake <[EMAIL PROTECTED]>

Reply via email to