procmail
[Top] [All Lists]

Re: Change extensions of Files

2000-11-23 13:49:38
On Tue, 21 Nov 2000, Professional Software Engineering wrote:

If you want to remove .doc from the handling, put a REALLY BIG caution 
comment at the top that this script is hacked, then go down to the 
MANGLE_EXTENSIONS section of the script.  You should familiarize yourself 
with regular expressions sometime (they're an important part of Procmail).

At the end of the first line, you'll see:

         do[ct]|xl[swt]|

Read that as:
         do [c or t]             (doc, dot)
         xl [s or w or t]        (xls, xlw, xlt)

If you ONLY want to eliminate sanitizing of .DOC, then change
         do[ct]
to:
         dot

That should do the trick for you.

Good explanation!

Comment: You should copy the MANGLE_EXTENSIONS line out of the
sanitizer and put it into your /etc/procmailrc before you call the
sanitizer, then modify it there. This will override the default in the
sanitizer and save you from hacking the standard sanitizer code.

Keep in mind that the sanitizer is a lot less effective if you go
rooting around and castrating it.

Agreed. 

If the problem is your users are complaining about the documents they
mail each other are getting mangled, then you can put the custom
MANGLE_EXTENSIONS into an if block:

   :0
   * ^From:(_dot_)*(_at_)pcsolution(_dot_)com(_dot_)br>
   {
      MANGLE_EXTENSIONS="customized RE here"
   }

   INCLUDERC=/etc/procmail/html-trap.procmail

This will suppress filename mangling for internal mail, but still do
it for mail received from offsite.

Also note: mangling and macro scanning are independent. If you
suppress mangling of .DOC filenames, this does not prevent macro
scanning of .DOC attachments. 

--
 John Hardin KA7OHZ   ICQ#15735746   http://www.wolfenet.com/~jhardin/
 jhardin(_at_)wolfenet(_dot_)com      pgpk -a 
finger://gonzo.wolfenet.com/jhardin
  768: 0x41EA94F5 - A3 0C 5B C2 EF 0D 2C E5  E9 BF C8 33 A7 A9 CE 76 
 1024: 0xB8732E79 - 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  "Bother," said Pooh as he struggled with /etc/sendmail.cf, "it never
  does quite what I want. I wish Christopher Robin was here."
                                -- Peter da Silva in a.s.r
-----------------------------------------------------------------------
   Today: Thanksgiving


_______________________________________________
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>