procmail
[Top] [All Lists]

Re: It should have worked?

2002-08-13 01:21:00

[The procmail-user(_at_)procmail(_dot_)org address simply forwards to the
procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de address.  Don't send to both, as 
that just
gives everyone two copies of your message.]


Erik Christiansen <erik(_at_)dd(_dot_)nec(_dot_)com(_dot_)au> writes:
On Mon, Aug 12, 2002 at 10:00:19AM +0100, Martin McCarthy wrote:

Add the quotes here.  So that you have:

 | mimedecode > "${DELIVERY_DIR}/$FILE"

  Thanks Martin,

     That fixed it, so long as I leave in the "tr" line, since the
filename match includes quotes, and procmail quotes unconditionally,
creating:

procmail: Matched ""Old vege gardenPush up yards.doc""

The extra quotes are in the log entry, not the variable value.


  and so the shell sees a null string, I think (see log below):

/bin/bash: /vp/projects/n2ip_nms/admin/: Is a directory

That's because you're not setting FILE to $MATCH.


  Converting the mess to:

  "'Old vege gardenPush up yards.doc'"

  works (with the help of your suggestion). Eliminating one set of
quotes would probably work equally well.

Note that the shell does _not_ interpret the quotes in a variables value**
so eliminating them from the command line will not help.  If you don't
want them in the filename, you gotta remove them from the variable's
value.

As long as we're at let, let's tighten up your MIME parsing a bit:

        # this is 95% correct: it doesn't handle comments or
        # other parameters occuring before the filename parameter
        :0
        * ^Content-Disposition:[        ]*attachment[   ]*;[    ]*\
                filename[       ]*=[    ]*\
                \/([^][()<>@,;:\"/?=    ]+|"(\\.|[^\"])+")
        { 
                # if the match starts with a quote, strip them and
                # remove backslash escapes
                :0
                * MATCH ?? ^^"\/.*[^"]
                {
                        FILE = `echo $MATCH | sed 's:\\\(.):\1:g'`
                }
                :0 E
                {
                        FILE = $MATCH
                }

                ...etc
        }


Philip Guenther


** unless you use 'eval' to reparse the expansion, but you really don't
want to do that.
_______________________________________________
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>