On Saturday, July 2, 2005, at 19:25:26 [UTC+0200] (Saturday, July 2, 2005
19:25 my local time) Roelof Otten wrote:

RO>> According to RFC2822 (and that's the law concerning e-mails) a message
RO>> should contain the sender's address in the From header and when that's
RO>> not the case the Resent-From or the Sender header should be present.
RO>> When this causes filtering problems, you've got to adapt your filters.

> When you really want to drop the Resent-from, then you could use this
> filter:

> $$$$ TB! Message Filter $$$$

<snip>

> I'm afraid the filter won't solve any problems for messages with
> attachments.

Export message to the text file can corrupt original structure, and as you
note, does not work with MIME attachments or HTML messages. Proposed filter
should be more complex and use a little different operations:

 1. Export message to the file in Unix mailbox format
 2. Modify the header in exported Unix message and use this modified file as
    the source in exporting message again, but to another text file
 3. Import the message from text file, delete this file and the Unix message
    file
 4. Send modified message and delete original one (optional)

Assuming the Unix message will be exported to "C:\Unix_Msg.txt", and the
second export file will be named "C:\export.msg", the filter template for
this export used in second operation will be following:

--------------- [ Export template ] ------------------
%_OldMsg(%Put="C:\Unix_Msg.txt")%-
%SetPattRegExp="(?ismU)(.*)(^Resent-From:.*\s*.*\n)(\w.*?)"%RegexpBlindMatch(%_OldMsg)%-
%Subpatt(1)%Subpatt(3)

%SetPattRegExp="(?ism)\n\n(.*)"%RegexpMatch(%_OldMsg)%-
--------------- [ End of template ] ------------------

Empty line in the template is mandatory, because it must separate message
header and message body.

You can make many things using such trick, e.g., repair threads, use HTML
templates, modify different parts of message or even substitute or delete
attachments.

-- 
Best regards,
Zygmunt Wereszczynski
(Using The Bat! v3.5.36 on Windows 2000 5.0 Build 2195 Service Pack 4
with BayesIt! 0.8.1)


________________________________________________________
 Current beta is 3.5.36 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html
IMPORTANT: To register as a Beta tester, use this link first -
http://www.ritlabs.com/en/partners/testers/

Reply via email to