I'm seeing some strange behaviour with fastforward-0.51 and qmail-1.03
on Solaris-2.5.1. No patches applied to any DJB software.

I have entries in ~alias/projects as follows

    teladm-others@:
            [EMAIL PROTECTED],
            # [EMAIL PROTECTED],
            # [EMAIL PROTECTED],
    ;

    teladm-postmaster@:
            | forward\ `teladm\ $SENDER`\ &&\ exit\ 99,
    ;

The teladm program simpy uses echo to generate a new recipient name
depending on where the original mail came from. Mail from me is not
special so the default of teladm-others is generated. Here is the
full text of teladm:

    #!/bin/sh
    #
    # Split mail from the TelAIN sites to appropriate support people
    # Author: Gordon Rowell <[EMAIL PROTECTED]>

    case $1 in
        *esda* | *csda* | *paum* | *paus* ) 
                    echo teladm-auc
                    ;;

        *hmk* | *lon* | *inp* | *inq* | *int* | *inu* )
                    echo teladm-one3
                    ;;

        *)
                    echo teladm-others
                    ;;
    esac

After making the cdb file I see

cdbdump < projects.cdb | grep teladm | cat -vet
+15,26::teladm-others@->&[EMAIL PROTECTED]^@$
+19,37::teladm-postmaster@->|forward `teladm $SENDER` && exit 99^@$

There are also entries for teladm-auc and teladm-one3 which have the
same value as teladm-postmaster.

The contents of my ~alias/.qmail-default file is

    | fastforward -p /var/qmail/alias/users.cdb
    | fastforward -p /var/qmail/alias/pizzatrek.cdb
    | fastforward -p /var/qmail/alias/projects.cdb
    | bouncesaying "Sorry, no mailbox here by that name. (#5.1.1)"

When I send mail to teladm-postmaster I see the following details in
my logs:

    958104165.945254 new msg 227911
    958104165.945271 info msg 227911: bytes 950 from
        <[EMAIL PROTECTED]> qp 15902 uid 29991
    958104165.958683 starting delivery 18590: msg 227911 to local
        [EMAIL PROTECTED]
    958104165.958711 status: local 1/10 remote 0/20
    958104166.177476 new msg 227912
    958104166.177496 info msg 227912: bytes 1068 from
        <[EMAIL PROTECTED]> qp 15913 uid 29990
    958104166.191252 starting delivery 18591: msg 227912 to local
        [EMAIL PROTECTED]
    958104166.191479 status: local 2/10 remote 0/20
*   958104166.191603 delivery 18590: deferral: forward:_qp_15913/
    958104166.191622 status: local 1/10 remote 0/20
    958104166.446515 new msg 227913
    958104166.446714 info msg 227913: bytes 1182 from
        <[EMAIL PROTECTED]> qp 15921 uid 29990
    958104166.462780 starting delivery 18592: msg 227913 to local
        [EMAIL PROTECTED]
    958104166.462804 status: local 2/10 remote 0/20
    958104166.463569 delivery 18591: success: fastforward:_qp_15921/did_0+0+3/
    958104166.466888 status: local 1/10 remote 0/20
    958104166.467536 end msg 227912
    958104166.672388 delivery 18592: success: did_0+0+1/
    958104166.676126 status: local 0/10 remote 0/20
    958104166.676145 end msg 227913

Note the deferral line. This message sits in the queue and is
repeatedly resent to teladm-postmaster. Poor Gordon is receiving
multiple copies of the message.

To prove to myself that it is fastforward rather than forward I set up
the following test:

Add the following to projects

    dummy@:
        | exit\ 99,
    ;

and regenerate the cdb file.

cdbdump < projects.cdb | grep dummy | cat -vet
+7,9::dummy@->|exit 99^@$

Send mail to [EMAIL PROTECTED] Log messages show:

    958104598.198493 new msg 227912
    958104598.198513 info msg 227912: bytes 831 from
        <[EMAIL PROTECTED]> qp 16537 uid 29991
    958104598.216392 starting delivery 18607: msg 227912 to local
        [EMAIL PROTECTED]
    958104598.216416 status: local 1/10 remote 0/20
*   958104598.309939 delivery 18607: deferral: 
    958104598.310061 status: local 0/10 remote 0/20


Now create ~alias/.qmail-dummy

    echo "| echo 99" > ~alias/.qmail-dummy
    cat ~alias/.qmail-dummy
    | echo 99

The existence of this file means that fastforward will not be called
for all local mail sent to dummy.

Send mail to [EMAIL PROTECTED] Log messages show:

    958104722.062910 new msg 227912
    958104722.063275 info msg 227912: bytes 831 from
        <[EMAIL PROTECTED]> qp 16714 uid 29991
    958104722.081279 starting delivery 18610: msg 227912 to local
        [EMAIL PROTECTED]
    958104722.081387 status: local 1/10 remote 0/20
*   958104722.127589 delivery 18610: success: 99/did_0+0+1/
    958104722.131485 status: local 0/10 remote 0/20
    958104722.132367 end msg 227912

Success. So fastforward is the culprit. If I change the fastforward entry to

    dummy@:
        | exit\0,
    ;

And remove ~alias/.qmail-dummy

    cdbdump < projects.cdb | grep dummy | cat -vet
    +7,8::dummy@->|exit 0^@$
    ls -l ~alias/.qmail-dummy
    /var/qmail/alias/.qmail-dummy: No such file or directory

then send mail to [EMAIL PROTECTED], the logs show

    958104932.675775 new msg 227912
    958104932.675970 info msg 227912: bytes 831 from
        <[EMAIL PROTECTED]> qp 17219 uid 29991
    958104932.688617 starting delivery 18684: msg 227912 to local
        [EMAIL PROTECTED]
    958104932.688719 status: local 1/10 remote 0/20
*   958104932.776873 delivery 18684: success: did_0+0+3/
    958104932.780224 status: local 0/10 remote 0/20
    958104932.780599 end msg 227912

As a workaround, I can change my fastforward entries to exit with 0,
but that doesn't solve the problem.

So, why is this happening?

Regards
Peter
----------
Peter Samuel                                [EMAIL PROTECTED]
Technical Consultant                        or at present:
eServ. Pty Ltd                              [EMAIL PROTECTED]
Phone: +61 2 9206 3410                      Fax: +61 2 9281 1301

"If you kill all your unhappy customers, you'll only have happy ones left"

Reply via email to