bug? Decorator munging attachments?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
gmorehoudh
Forum Commoner
Posts: 50
Joined: Tue Mar 04, 2008 1:49 pm

bug? Decorator munging attachments?

Post by gmorehoudh »

This is related to the problems described in this thread: viewtopic.php?f=52&t=87046

I have discovered, in trying to get around the problems mentioned in that thread by attaching the info that I was previously prepending as a Swift_MessagePart, that Decorator will happily replace values in attachments that are in its allowed MIME type. I don't know if that's a bug or what, but there should definitely be a way to switch it off if not.

To reproduce, attach a file as text/plain that contains a replacement pattern for Decorator, and the resulting message will have the pattern replaced.

Presumably Decorator should not be touching anything with Content-Disposition: attachment.

This is Swift 3.3.2 on PHP 5.2.6.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: bug? Decorator munging attachments?

Post by Chris Corbyn »

Hmm, this is correct and it was the intended behaviour, though I can see how that would have a negative side-effect. I'll have a think on a way to avoid that.
gmorehoudh
Forum Commoner
Posts: 50
Joined: Tue Mar 04, 2008 1:49 pm

Re: bug? Decorator munging attachments?

Post by gmorehoudh »

Seems like maybe a flag for 'don't touch attachments' that turns off Decorator touching anything with Content-disposition: attachment might do the trick.

Except maybe in the case of attaching other messages for forwarding or something, though that'd be a weird case in which to be using Decorator.
Post Reply