| 1 | ##---------------------------------------------------------------------------## | ||
| 2 | ## File: | ||
| 3 | ## $Id: mhnull.pl,v 1.8 2003/02/04 23:31:19 ehood Exp $ | ||
| 4 | ## Author: | ||
| 5 | ## Earl Hood mhonarc@mhonarc.org | ||
| 6 | ## Description: | ||
| 7 | ## Library defines the null filter routine for MHonArc. Its use | ||
| 8 | ## is for dropping unwanted data from messages. | ||
| 9 | ## Filter routine can be registered with the following: | ||
| 10 | ## <MIMEFILTERS> | ||
| 11 | ## some-type/some-subtype;m2h_null::filter;mhnull.pl | ||
| 12 | ## </MIMEFILTERS> | ||
| 13 | ##---------------------------------------------------------------------------## | ||
| 14 | ## MHonArc -- Internet mail-to-HTML converter | ||
| 15 | ## Copyright (C) 1998,1999 Earl Hood, mhonarc@mhonarc.org | ||
| 16 | ## | ||
| 17 | ## This program is free software; you can redistribute it and/or modify | ||
| 18 | ## it under the terms of the GNU General Public License as published by | ||
| 19 | ## the Free Software Foundation; either version 2 of the License, or | ||
| 20 | ## (at your option) any later version. | ||
| 21 | ## | ||
| 22 | ## This program is distributed in the hope that it will be useful, | ||
| 23 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 24 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 25 | ## GNU General Public License for more details. | ||
| 26 | ## | ||
| 27 | ## You should have received a copy of the GNU General Public License | ||
| 28 | ## along with this program; if not, write to the Free Software | ||
| 29 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
| 30 | ## 02111-1307, USA | ||
| 31 | ##---------------------------------------------------------------------------## | ||
| 32 | |||
| 33 | package m2h_null; | ||
| 34 | |||
| 35 | sub filter { | ||
| 36 | my ($fields, $data, $isdecode, $args) = @_; | ||
| 37 | my ($ctype) = $fields->{'content-type'}[0] =~ m%^\s*([\w\-\./]+)%; | ||
| 38 | my ($disp, $nameparm, $raw_name, $html_name) = | ||
| 39 | readmail::MAILhead_get_disposition($fields, 1); | ||
| 40 | join("", | ||
| 41 | '<p><tt><<', | ||
| 42 | ($disp ? "$disp: " : ""), | ||
| 43 | ($html_name ? $html_name : $ctype), | ||
| 44 | '>></tt></p>'); | ||
| 45 | } | ||
| 46 | |||
| 47 | ##---------------------------------------------------------------------------## | ||
| 48 | 1; |