Markus Stumpf writes:
 > I want to create a bounce message for accounts of ppl that no longer
 > work here, but I also want to drop the mail into a valid users mailbox.
 > 
 > ~alias/.qmail-joe:
 > &[EMAIL PROTECTED]
 > | (cat /var/qmail/alias/NO-WORKER.TXT; exit 100)
 > 
 > (which I thought already worked, doesn't any longer) only a bounce
 > message is delivered.

No, it never worked.

 > However if I use
 > 
 > ~alias/.qmail-joe:
 > |forward [EMAIL PROTECTED]
 > | (cat /var/qmail/alias/NO-WORKER.TXT; exit 100)
 > 
 > it works as expected.

Right.  That's because program deliveries are handled in order, while
forwards ('&' deliveries) are done all at once at the end.  Actually,
what you're doing in the second version is unreliable in the general
case.  What if the second program delivery sometimes succeeded,
sometimes exited 100 and sometimes 111 (depending on the contents of
the email message, say).  Well, every time it exited 111, the |forward 
delivery would be re-executed and you'd get mail duplication.

The reliable way to do two program deliveries is to do one of them in
one .qmail file, and the other in another.  Like this:

cat > ~alias/.qmail-joe <<EOF
|forward [EMAIL PROTECTED]
&joe-bounce
EOF
cat > ~alias/.qmail-joe-bounce <<EOF
|cat NO-WORKER.TXT; exit 100
EOF

BTW, you don't need to put those commands in parens -- those two
commands don't need to be executed by the same shell invocation.
Also, the current directory for a program delivery in a .qmail is the
controlling user's home directory.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | Government schools are so
521 Pleasant Valley Rd. | +1 315 268 1925 voice | bad that any rank amateur
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | can outdo them. Homeschool!

Reply via email to