procmail
[Top] [All Lists]

variable assignment from pipe, multiple lines

2002-01-13 15:57:51
Hello,

Is there any way of making var=| cmd  span multiple lines?

For example, I have vacation information stored in a LDAP database,
which is searched from /etc/procmailrc :

:0 c:
* !^FROM_DAEMON
* !^X-Loop: $XLOOP
{
        :0 W
        * .
        VACMSG=| /sbin/get_vac ldapdb "ou=pop,dc=acme,dc=com" $LOGNAME

        :0 a   # If vacation was activated, send reply. 
        # Rewrite from->to, to->from, append vacationmessage
        | ( formail -R To: From: -i From: | formail -ri From \
                -R Old-From From -U From \
                -I"Precedence: bulk" \
                -A"X-Loop: $XLOOP" \
                echo $VACMSG \
        ) | $SENDMAIL -oi -t
}


However, $VACMSG seems to only be assigned the first line delivered from
my get_vac program (whose exit code reflects if the vacationmessage
was activiated, and puts the message on stdout in that case.

Ofcourse 'echo $VACMSG' could be replaced by `get_vac ...` a second time,
but I would like to avoid multiple searches when not necessary :)

Any ideas?

Regards,
 Stefan
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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