Subject: zmailer + cyrus deliver failure

From: Jeff Warnica <[email-masked]>
Date: Wed, 6 Mar 2002 09:46:15 -0400

Greetings all..

Im working on installing zmailer + cyrus into a black box (with ldap) style mail
system, though I am having trouble convincing zmailer and deliver to put
messages into users mailboxes.

I always get bounced mail "error: nosuchuser". The user/mailbox exists; I can
'deliver' to them from the command line.

Ive googled around and found that others have had similar problems. One was
resolved with the realization that "nosuchuser" sometimes means "accessdenied",
though I have verified that the ACLs are correct. Another site fixed there
problem by changing from deliver-wrapper to deliver. Ive tried the reverse, as
well as changing around what arguments I give to deliver.

Strangely, quickly installing sendmail (from rpm's) and updating its
configuration allows mail to be delivered. While this is a fresh instalation and
I could easily use sendmail, I realy would rather not.

server information (for what its worth)

Redhat 7.2 (2.4.7-10)
Cyrus IMAP4 v2.0.16
ZMailer Server 2.99.56-pre1 (cvs)
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to [email-masked]

---

From: Arnt Gulbrandsen <[email-masked]>
Date: Wed, 6 Mar 2002 15:14:28 +0100

It sounds to me as if deliver, as run by cyrus, might not be able to read
something. I suggest using strace. In scheduler.conf, say something like
command="strace -o /tmp/mumble deliver" and see what strace writes to
/tmp/mumble.

--Arnt
-

---

From: alvin <[email-masked]>
Date: Wed, 06 Mar 2002 09:59:37 -0500

> the body of a message to [email-masked]

We have been running this configration for a while.

I think the deliver script could be smarter. We also return the mail if
the user is overquota by forcing a nonrecoveralble error. It also does
some extra logging that is useful for debugging.

I believe the following is all that is required. 

from sm.conf:

#
# the following entries are included to illustrate other possibilities
#
#local  mS      /usr/lib/mail/localm            localm -r $g $u
cyrus   Pn      /usr/cyrus/bin/zmdeliver                zmdeliver  $u
#               # CYRUS example from: Tom Samplonius <[email-masked]>

from scheduler.conf
#
# This fallback "local/*" can be used to yield different local
# delivery mechanism -- mailbox / CMU cyrus IMAP server / procmail
#
# The latter two can not do deliveries to explicite files / pipes,
# thus you need the  "local/file*" and "local/pipe*" above.
#

local/*
        interval=5m
        idlemax=9m
        # Originally we had 3 hour expiry, but if your local system goes
to
        # a fizz (freezes, that is), your local mail may start to bounce
        # before anybody notices anything...
        expiry=3d
        # want 20 channel slots, but only one HOST
        maxchannel=15
        maxring=5
        #
        #
        # Do MIME text/plain; Quoted-Printable -> text/plain; 8BIT
        # conversion on flight!
        #command="mailbox -8"
        # Or with CYRUS server the following might do:
        command="sm -8c $channel cyrus"
        # Or with PROCMAIL as the local delivery agent:
        #command="sm -8c $channel procm"

from /usr/cyrus/bin/zmdeliver(note: this is set UID&GID as the cyrus
user)

#!/usr/bin/perl
$i = 0;
while($#ARGV >= $i){

# Truncate @iplink.net, etc. to give the mailbox name:

        $ARGV[$i] =~s/\@.*//;

#    Email addresses are case-insensitive.  Some of our email addresses
#    are the same as mailbox names, so we make mailbox names
#    case insensitive too, but this means that only
#    mailboxes with lowercase names will work.

        $ARGV[$i] =~tr/A-Z/a-z/;
        $i = $i + 1;
}
$cmd="/usr/cyrus/bin/deliver @ARGV";
$force="/usr/cyrus/bin/deliver -q @ARGV";
$rc = 0xffff & system("$cmd");
if ($rc == 0) {
    exit $rc;
}

open MYLOG, '>>/tmp/zmdeliver.log';

printf MYLOG "system($cmd) returned %#04x: ", $rc;
if ($rc == 0xff00) {
    print MYLOG "command failed: $!\n";
}
elsif (($rc & 0xff) == 0) {
    $rc >>= 8;
    if ($rc == 75) {
        $rc = 69;
        print MYLOG "ran with non-zero exit status $rc (over quota)\n";
    }
    else {
        print MYLOG "ran with non-zero exit status $rc\n";
    }
}
else {
    print MYLOG "ran with ";
    if ($rc &   0x80) {
        $rc &= ~0x80;
        print MYLOG "coredump from ";
    }    print MYLOG "signal $rc\n";
}

exit $rc;

-- 
Alvin Starr                   ||   voice: (416)785-4051
Interlink Connectivity        ||   fax:   (416)785-3668
[email-masked]              ||
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to [email-masked]