How to Remove X-headers

Randal, Phil prandal at herefordshire.gov.uk
Thu Mar 12 14:43:12 GMT 2009


It would nice to be able to remove headers based on a Perl RE against
the WHOLE header line, and not just the bit before the colon.

Cheers,

Phil
--
Phil Randal | Networks Engineer
Herefordshire Council | Deputy Chief Executive's Office | I.C.T.
Services Division
Thorn Office Centre, Rotherwas, Hereford, HR2 6JT
Tel: 01432 260160
email: prandal at herefordshire.gov.uk

Any opinion expressed in this e-mail or any attached files are those of
the individual and not necessarily those of Herefordshire Council.

This e-mail and any attached files are confidential and intended solely
for the use of the addressee. This communication may contain material
protected by law from being passed on. If you are not the intended
recipient and have received this e-mail in error, you are advised that
any use, dissemination, forwarding, printing or copying of this e-mail
is strictly prohibited. If you have received this e-mail in error please
contact the sender immediately and destroy all copies of it.

-----Original Message-----
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Julian
Field
Sent: 12 March 2009 14:22
To: MailScanner discussion
Subject: Re: How to Remove X-headers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No, you can't use a regular expression to define which headers you want
to remove, just a list of header names. I'm fairly sure the
documentation does not imply that you *can* use regexps here.

On 12/3/09 14:14, Glenn wrote:
> Oh, sorry, I did not read Joost's post carefully enough to see the 
> difference between his expression and mine.  However, I just tested 
> his expression, /^X- Mime.*\:/ , and it doesn't work either.  I am
wondering if MailScanner can
> use Perl expressions in this ruleset?  Thanks again.   -Glenn.
>
> ---------- Original Message -----------
> From: "Glenn"<glenn at mail.txwes.edu>
> To: MailScanner discussion<mailscanner at lists.mailscanner.info>
> Sent: Thu, 12 Mar 2009 09:02:37 -0500
> Subject: Re: How to Remove X-headers
>
>    
>> Thanks for all the attention, but I'm afraid I still have the same 
>> problem.  Regardless of the propriety of doing so, I would like to be

>> able to filter headers using the "Remove These Headers" ruleset,
>>   and I can't get it to work with Perl regular expressions.  Joost's 
>> post seems to confirm that I am using an expression that should 
>> remove the X-MimeOLE: header, but it doesn't.  Can anyone shed light
>> on this?  Thanks.   -Glenn.
>>
>> ---------- Original Message -----------
>> From: Joost Waversveld<joost at waversveld.nl>
>> To: MailScanner discussion<mailscanner at lists.mailscanner.info>
>> Sent: Thu, 12 Mar 2009 09:38:58 +0100
>> Subject: Re: How to Remove X-headers
>>
>>      
>>> /^XMime.*\:/   would match XMime<something>  (and not X-
>>> Mime<something>)
>>>
>>> The regular expression should be /^X-Mime.*\:/
>>>
>>> Best regards,
>>>
>>> Joost Waversveld
>>>
>>> Alex Broens wrote:
>>>        
>>>> On 3/11/2009 10:50 PM, Glenn wrote:
>>>>          
>>>>> We use MailScanner and Postfix on a mail gateway server and 
>>>>> forward mail to an internal Microsoft Exchange 2003 server.  
>>>>> Evidently, enough X-headers have accumulated in an Exchange 
>>>>> database to cause a problem, so we need to remove X-headers before

>>>>> they are forwarded to the Exchange server.
>>>>>
>>>>> There is a line in MailScanner.conf that allows us to name 
>>>>> whatever headers we want to remove ("Remove These Headers"), but 
>>>>> this raises some questions.  If we just blanket remove all 
>>>>> X-headers, won't this defeat features of MailScanner that depend 
>>>>> on MailScanner adding headers?
>>>>>
>>>>> According to hints in the MailScanner rules directory, we should 
>>>>> be able to use regular Perl expresssions to create a ruleset to 
>>>>> exclude certain headers from the delete list.  My problem is that 
>>>>> I don't have a clue how to write regular Perl expressions.  From 
>>>>> what I've read online, for example, the lines below should be 
>>>>> equivalent, but when I use the Perl expression in the ruleset it
doesn't work.
>>>>>
>>>>> From:  [ipaddress]  X-MimeOLE:    ##this removes the X-MimeOLE
header
>>>>>
>>>>> From:  [ipaddress]  /^XMime.*\:/  ##this doesn't
>>>>>
>>>>> I know this isn't a Perl forum, but I'm hoping that someone who 
>>>>> has tried this can enlighten me.  If I could just get a simple
expression
>>>>> to work, I might be able to build what I need.  Thanks.   -Glenn.
>>>>>            
>>>> Before you start breaking MIME headers, who told you this or what 
>>>> MS KB article covers this?
>>>>
>>>>          
>>> --
>>> Joost Waversveld
>>>
>>> --
>>> MailScanner mailing list
>>> mailscanner at lists.mailscanner.info
>>> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>>>
>>> Before posting, read http://wiki.mailscanner.info/posting
>>>
>>> Support MailScanner development - buy the book off the website!
>>>        
>> ------- End of Original Message -------
>>
>> --
>> MailScanner mailing list
>> mailscanner at lists.mailscanner.info
>> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>>
>> Before posting, read http://wiki.mailscanner.info/posting
>>
>> Support MailScanner development - buy the book off the website!
>>      
> ------- End of Original Message -------
>
>    

Jules

- --
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

Need help customising MailScanner?
Contact me!
Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654


-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.9.1 (Build 287)
Comment: Use Enigmail to decrypt or check this message is legitimate
Charset: ISO-8859-1

wj8DBQFJuRqMEfZZRxQVtlQRAp1TAKCrSEREXCfFVjsC63fLHfdpRGo9tgCfTj5w
ibl3FL6uiJr1P9lK96ALWRI=
=r+cL
-----END PGP SIGNATURE-----

--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website! 


More information about the MailScanner mailing list