procmail
[Top] [All Lists]

Re: --> reading multiple TO addresses from a file.

2000-09-15 12:12:07
Widodo Krisman wrote,

| I added $ and it works.  But it won't read from multiple line that I got in
| myaddress.
|  * $ ^TO`cat /etc/myaddress.txt`
| 
| It only works for the first line.

As Sean has already explained, the addresses in the expression, and therefore
in the file, need to be separated with pipe characters, not newlines or
commas.  You can put newlines in if you precede them with backslashes so that
they'll be ignored by the expression parser.

Easiest way, I'd say, is to change the condition to

 * $ ^TO(`cat /etc/myaddress.txt`)

and have the file formatted like this, without indentation:

address1|\
address2|\
address3|\
and|\
so|\
forth

with neither a backslash nor a pipe on the last line.  Procmail's backquote
interpretation should strip the closing newline.

Also, if your version of procmail supports ^TO_, you might want to use that
insted of ^TO.

If the file gets too big and makes the condition's length exceed $LINEBUF,
then you'll need another approach.


_______________________________________________
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>