procmail
[Top] [All Lists]

Re: multiple words in procmailrc's variables

1998-08-16 19:33:24
Walter Haidinger wrote,

| How do I have several words in a variable defined in .procmailrc ?
| 
| That is, I wanted sendmail to queue the mail (i.e. not deliver) in
| the directory /var/mqueue.incoming.
| 
| First, I tried:
|    SENDMAILFLAGS="-oQ/var/mqueue.incoming -odq"
| 
| Result: sendmail complained that it could not chdir to
|         `/var/mqueue.incoming -odq'
| 
| Next attempt:
|    SENDMAILFLAGS=-oQ/var/mqueue.incoming -odq
| 
| Result: Only the first argument is passed. Verified using $LOGNAME.
|
| Of course, I could have a variable for each word, doing...
| 
| | $SENDMAIL $SMFLAG1 $SMFLAG2 $SMFLAG3 ... <recipient>
| 
| but this isn't quite what I had in mind. Any idea?

Procmail translates ! into | "$SENDMAIL" "$SENDMAILFLAGS" as the
procmailrc(5) man page warns us.  By the rules of sh quoting, that explains
the results both times.

My suggestion: since you need a soft space inside $SENDMAILFLAGS, use the
quotes when you define $SENDMAILFLAGS but do this instead of using the !
operator for forwarding:

 SENDMAILFLAGS="-oQ/var/mqueue.incoming -odq"

 :0 flags
 * conditions
 | $SENDMAIL $SENDMAILFLAGS addr1 addr2 addr3 ...

That will split the words that make up $SENDMAILFLAGS.

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