Re: Filter
MAU <[email protected]> Mon, 26 Feb 2024 23:36:13 +0100
| Newsgroups | gmane.mail.the-bat.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Gunivortus,
> If it is possible, how? (Im not familiar with the filter language)
>
Yes, it is possible. There is something you must do before creating the filter:
1.- Create an Address Book Group with the addresses you want to reject and return to Sender. Let's call it GROUP.
Now, to the filter:
Create a new Incoming filter, let's call it Reject
In the Condition box of the filter, add the following condition. Click on the Add condition button. And you will get this line:
Sender> contains> and a small blank box
Click on Sender and from the list of conditions that pops up, select Address groups and your condition line will change to:
Address groups> Small blank box with three dots on the right contain> sender>
Click on the three dots of the blank box and select the GROUP created in the Address Book
Now, on the Actions part (lower half) of the filter, click on the Add button on the lower lower left,
and from the list of actions that pops up, select Send automatic reply
A Create automatic reply window will open and you should type (or copy&paste from this message) the following:
%Cursor
Message REJECTED
--------- Original Message ---------
From: %OFromName <%OFromAddr>
Date: %ODateEn %OTimeLongEn %IF:'%OTOLIST'<>'':'
To: %_RL_Text="%OTOLIST; "%QINCLUDE="print_recipient"'%IF:'%OCCLIST'<>'':'
Cc: %_RL_Text="%OCCLIST; "%QINCLUDE="print_recipient"'
Subject: %OFULLSUBJ
%QuoteEmptyLines%Quotes
And click OK.
Now, for all of these to work, you must have two Quick Templates, one called print_recipient, which is as follows:
%_RL_Num_Space("9")%-
%SetPattRegexp="^(?s)\s{%_RL_Num_Space}(.*)\Z"%-
%RegExpMatch="%-
%___%QInclude='Recipient List'"%-
and one called Recipient List as follows:
%REM='
Recipient List reformatting routine using features from TB 1.63b11
Written July 2003 by Januk Aggarwal
Notes:
1. This template can be used alone to reformat clipboard
contents or can be used as a reformatting engine by
assigning text to the variable, %_RL_Text, in the driver
template.
2. Indenting can be specified by defining number of leading
spaces in %_RL_Num_Space variable.
'%-
%-
%IF:'%_RL_FirstTime'='':'%-
%___%IF:"%_RL_Text"="":"%_RL_Text(""%Clipboard; "")"%-
%___%IF:"%_RL_Num_Space"!="":"%-
%______%SetPattRegexp=""(\s{%_RL_Num_Space})""%-
%______%RegExpBlindMatch=""
""%-
%______%_RL_Leading_Space(%SubPatt(1))":"%-
%______%_RL_Leading_Space()"%-
%___%_RL_FirstTime="No"'%-
%-
%IF:'%_RL_Text'!='':'%-
%-
%___%SetPattRegexp=!(?x)
^\s* # Strip Leading Spaces
( # SubPatt 1 - First Item + Delimiter
( # SubPatt 2 - First Item
(\"?) # Opening Quotation marks
(.*?) # SubPatt 4 - Name
\3 # Closing Quotation marks if opening ones exist
\s*
(\<.*?\>)? # SubPatt 5 - Address
) # Close First Item
\s*[;,]\s* # Delimiter and white space
) # Close First Item + Delimiter
(.*) # SubPatt 6 - Remainder of list
\Z!%-
%___%RegexpBlindMatch(%_RL_Text)%-
%-
%___%_RL_Name_Addr(%SubPatt(2))%-
%___%_RL_Name(%SubPatt(4))%-
%___%_RL_Addr(%SubPatt(5))%-
%___%_RL_Text(%SubPatt(6))%-
%-
%___%_RL_Leading_Space%-
%___%_RL_Name %_RL_Addr
%-
%QInclude("Recipient List")'%-
Don't be afraid, try it. It should work. If it doesn't, let me know.
--
Best regards,
Miguel A. Urech (El Escorial (Madrid)- Spain)
Using The Bat! Version 11.0.4.5 (64-bit)
________________________________________________
Current version is 9.1.18 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html