On Sun, Apr 16, 2006 at 04:59:14PM +1000, Pascal Hakim wrote:
> On Sat, Apr 15, 2006 at 09:17:19PM -0800, Ken Irving wrote:
> > On Sat, Jan 21, 2006 at 12:42:56AM +0100, Cord Beermann wrote:
> > > Package: lists.debian.org
> > > Followup-For: Bug #345283
> > > 
> > > this one would mean not only to append the normal unsubscribe-sermon
> > > but fiddeling with MIME, to add a correct mime-container, i also
> > > guess that this could be a general smartlist-problem.
> > 
> > This topic recently came up on debian/users; it looks like smartlist
> > doesn't address it (see last entry in FAQ).  The amount of fiddling
> > necessary is not much; in procmail, grab the multipart boundary string
> > from the headers, seek to the terminating boundary, insert another
> > section with the unsubscribe footer, and leave the terminating line there.
> > 
> > Maybe something like this will work?
> > 
> >     :0 fbw
> >     * ^X-Mailing-List:[EMAIL PROTECTED]
> >     * Content-Type: multipart.*boundary=\"\/[^"]*
> >     | sed -e "s/--$MATCH--/--$MATCH\n\n`cat unsub-footer`\n\n&\n/"
> > 
> >     ## or the same thing in perl:
> >     # | perl -pe "s/$MATCH--/$MATCH\n\n`cat unsub-footer`\n\n$MATCH--\n/"
> 
> I feel that if we're going to start fiddling with MIME messages, we
> should check whether it's a valid MIME message first.
> 
> If we're doing that, we can also get the boundary out properly.

The above recipe is a quick hack, but I don't see much more to look at
(per rfc2045) in the headers.  If the message Content-Type is multipart
then the boundary string is required, and I think the other information in
that header line is superfluous to this task.  A "bare" mulipart section
(no content-type or similar in the body) should default to plain text or
rfc822, so I don't think the inserted "part" needs to be any more complex.

Maybe add a check for MIME version 1 in the headers?

Beyond that, the recipe will only match if there's a terminating boundary
line; is there more to check to see if it's valid MIME?

-- 
Ken Irving


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to