procmail
[Top] [All Lists]

Re: mimepart.txt can handle image file

2007-05-15 01:13:04
A word of caution:  You really, REALLY, *REALLY* do NOT want to have
an automated process running as root and writing to a file that is
named in the subject line of an email message.


On 5/14/07, DR. Lee - NS1 <kflee(_at_)itnc(_dot_)com> wrote:

Is there an updated version to include decoding these?

The problem isn't with mimepart.txt, it's with your recipe to write to
mimencode.


        :0 c
        | echo $BODY_PART | mimencode -u -b > "$TARGET"

When you use "|" as the first character of a recipe, you're
instructing procmail to send the entire message to the program that is
being run.  "echo" does not read its input, so the message cannot be
written to it.  (Part of the message, or all of a small message, can
be written to the I/O buffer internal to the operating system.
Consequently small messages don't produce an error, but large messages
cause an error when the I/O buffer fills up.)

One workaround for this is to tell procmail to ignore the error:

  :0 ci
  | echo "$BODY_PART" | mimencode -u -b > "$TARGET"

However, that will also ignore failure of mimencode.  So another way
to do it is:

  :0
  * ? echo "$BODY_PART" | mimencode -u -b > "$TARGET"
  { LOG="Write to $TARGET was successful $NL" }

(That assumes $NL has been set to be a newline, so the log entry has a
line break.)

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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