[Mimedefang] (more) external filter issues

Ashley M. Kirchner ashley at pcraft.com
Tue Feb 12 21:26:12 EST 2002


"David F. Skoll" wrote:

> 1) Copy the part to be filtered to FILTERINPUT
> 2) Run the command (whatever command you supply)
> 3) If the file FILTEROUTPUT exists, then replace the part with the
>    contents of FILTEROUTPUT.  If FILTEROUTPUT does not exist, do nothing.
>
> Now, action_external_filter() cannot possibly know to change the MIME type.
> You have to do it yourself with the $entity->head->replace() method.
> You can supply any file name you like for the replaced entity, as long
> as it "matches" (in the Windows sense) the MIME type.  For text/plain,
> you'd use .txt, etc.

    Ah, thank you, thank you, thank you.  That makes sense now.  And I finally
figured out how to make it work...and it does, at least, I think it does.
Here's what's happening now.  The received email says there is an attachment of
name $fname (original attachment name) with type being Plain Text - which is
what it should be after conversion.

    I'm just not sure whether this is how it's supposed to work.  To the
recipient, they're still receiving an attachment with a .doc extension, even if
it's just plain text.  And not till they actually click on it will they see
that it's in plain text, not Word format.  Looking at the source of the
message, I see this:


Content-Type: multipart/mixed; boundary="-862944080-5916262-1013570077=:26832"
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)

This is a multi-part message in MIME format...

---862944080-5916262-1013570077=:26832
Content-Type: multipart/mixed; boundary="----------=_1013570079-26844-0"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)

This is a multi-part message in MIME format...

------------=_1013570079-26844-0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Content-Disposition: inline

        Will it work this time?

------------=_1013570079-26844-0
Content-type: text/plain
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SGI.4.43.0202121914370.26832 at badboy.yeehaw.net>
Content-Description: test doc
Content-Disposition: attachment; filename="Amy.doc"
Content-Disposition.filename: foo.txt
Content-Type.name: foo.txt

CiAgIEhleSBBbXkgYW5kIFN1ZSwKCiAgIFRoYW5rcyBmb3IgdGFraW5nIGNh
cmUgb2YgbXkgbGl0dGxlIGJhYmllcy4gRG9uJ3Qgc3BvaWwgdGhlbSBmb3Ig
....etc.


    Am I correct in assuming that this is the proper way MD works, and that the
actual text (once converted) will maintain the original file name (with a .doc
extension)?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:ashley at pcraft.com>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.






More information about the MIMEDefang mailing list