procmail
[Top] [All Lists]

How to check for environment variable?

1999-03-28 14:01:23
I deliver to a cyrus mailbox.  If I have a "extension"
(user+extension(_at_)domain) I want to use a different call to deliver than 
if there is no extension.  The extension (and user) is passed to
procmail in an environment variable.  If there is no extension, then
extension is either undefined or set to nothing (defined, but not
value).

I don't see any way to do a conditional based on the value of an
environment variable.  For now, I first try delivery to the folder
with extension and if that fails deliver to the main mailbox for the
user.  I trap the failure with w and then use an "e" in the next
recipe.

How should I be doing this?

===== sample stuff =======

:0W
| $DELIVERMAIL -a $LOGNAME -m user.$LOGNAME.$EXTENSION

:0we
| $DELIVERMAIL -a $LOGNAME -m user.$LOGNAME

:0 e
{
        EXITCODE=$?
        HOST
}

==== end of stuff =====

-- 
Rupa (rupa(_at_)rupa(_dot_)com for normal email)
Please don't email duplicate replies.

<Prev in Thread] Current Thread [Next in Thread>