 |
The Bat! Macro and Solutions Library |
 |
Back to
The Bat! FAQ /
How-Do-I
De-Base64 [
Filter] |
Unravel Base64 messages without Content Encoding headers
|
Copy the filter to the clipboard.
Open the sorting office.
Open "Incoming message" filters and move the cursor into the list.
Paste.
'DeBase64' will now exist as a filter.
You may need to modify the execution path for thebat.exe if yours doesn't
match the default. You may also wish to modify the location of the temporary
export file, which I have specified here as 'C:\Temp\export.msg'.
You will certainly have to modify the default account name, which I have
specified as (your account).
===================== Filter starts here
BeginFilter
Name: DeBase64
Active: 1
Source: \Inbox
Target: \Inbox
MainSet: 00@
Actions: faExport,faExternal,faoExportOver,faoManualOnly,faoHotKey
ExtCmd: C:\Program Files\The Bat!\thebat.exe /IMPORTU=(your account);
F=Inbox;I="C:\Temp\export.msg"
ExtFile: C:\Temp\export.msg
SaveTemplate: Content-Transfer-Encoding:\20base64\0D\0A%Headers\0D\0A
%Text\0D\0A\0D\0A
EndFilter
Edit a Received Message [
Filter] |
Editing received messages without changing the headers.
|
Two manual filters, and a batch command are required here.
One filter is for exporting the message and opening it in your favourite
text editor.
The other involves importing the message back to TB! in a folder of your
choice.
Exporting your message filter:
BeginFilter
Name: Export for editing
Active: 1
Source: \Inbox
Target: \Inbox
CopyFolder: \\\\none
MainSet: 40'e'
Actions: faExport,faExternal,faoExportOver,faoHotKey,faoSaveUnix
ExtCmd: "C:\Program Files\TextPad\textpad.exe" C:\temp\edit.txt
ExtFile: C:\temp\edit.txt
ColourGroup: <default>
AddAddrItems: afiFrom,
DelAddrItems: afiFrom,
HotKey: 0
IsOfColour: <default>
EndFilter
Import your message filter
BeginFilter
Name: Import after editing
Active: 1
Source: \Inbox
Target: \Inbox
CopyFolder: \\\\none
MainSet: 40'e'
Actions: faExternal,faoRunDetached,faoManualOnly,faoWaitCompletion,faoHotKey
ExtCmd: c:\batch-cmds\import.bat
ColourGroup: <default>
AddAddrItems: afiFrom,
DelAddrItems: afiFrom,
HotKey: 49225
IsOfColour: <default>
EndFilter
Batch file import.bat:
"C:\Program Files\The Bat!\thebat.exe" /IMPORTF="Imports";X;IN=C:\temp\edit.txt;R
Filter Chinese Spam [
Filter] |
Filter spam mails with unknown languages
|
Create a new filter for incoming mails and enable regular expressions. Now
insert the following as filter string:
(?ims)\A.{0,150}[\s\W\t\f\r\n]{20,}
(?ims) = ignore case / multiline / a dot scans newlines too
\A = search from the beginning
.{0,150} = scan only the first 150 chars from the mail (sometimes there is
crap at the end of normal mails e.g. signatures)
[\s\W\t\f\r\n]{20,} = min. 20 special chars (chinese)
I hope i do not forgot something...
Achim
Filter Collection [
Filter] |
Kill 95% of your spam messages
|
Firstly you should activate the Known filter so that you do not move or
delete messages from your friends... If you use services like ebay or
receive newsletters create a filter to keep such messages into your Inbox
folder, because most of them appear to be spam to the spam filters.
The following example filters ebay messages (sorry - I have used the german
ebay...):
BeginFilter
Name: Spam: EBay Mails
Active: 1
Source: \Inbox
Target: \Inbox
CopyFolder: \\\\none
MainSet: 00@ebay.(de|com)
AltSet:1: 20Kaufabwicklung
AltSet:2: 20Fragen.*Verkaeufer
Actions: faoRegExp,faSetColor
ColourGroup: EBay
EndFilter
Be sure that you replace YOURMAILACCOUNT with your account name and that
you created a folder called Spam within the Inbox Folder.
Now a filter for medical problems:
BeginFilter
Name: Spam: Medical
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 50(?ims)Lose.{0,25}Weight
AltSet:1: 50Reverse.{0,25}Aging
AltSet:2: 50Change Your Life
AltSet:3: 50(?ims)Younger
AltSet:4: 50Pills?
AltSet:5: 50Diet
AltSet:6: 50Weight Loss
AltSet:7: 50Pharmacy
AltSet:8: 50Feel Young
AltSet:9: 50Medication
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for porno mails:
BeginFilter
Name: Spam: Porn
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 50(Penis|Penís)
AltSet:1: 50Hardcore
AltSet:2: 50Sex
AltSet:3: 50Chat
AltSet:4: 50Video.{0,25}Botschaft
AltSet:5: 50Denke?.{0,5}An.{0,5}Dich
AltSet:6: 50Girl.?Friend
AltSet:7: 50Little Johnson
AltSet:8: 50Flirt
AltSet:9: 50Pussie
AltSet:10: 50Naked
AltSet:11: 50Cock
AltSet:12: 50Fetish
AltSet:13: 50Teen
AltSet:14: 50Live.?Cam
AltSet:15: 50Love (You|Me)
AltSet:16: 50V ?i ?a ?g ?r ?a
AltSet:17: 50Remember Me
AltSet:18: 50Webcam
AltSet:19: 50Porn
AltSet:20: 50Beautiful Women
AltSet:21: 50Enlargement
AltSet:22: 30Hot Action
AltSet:23: 50Video.?Tape
AltSet:24: 30Adult
AltSet:25: 50V(i|1){1,1}agra
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for money problems:
BeginFilter
Name: Spam: Money problems
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 50Paying.{0,25}Much
AltSet:1: 50Mortgage
AltSet:2: 30(?ims)Million.*Dollars?
AltSet:3: 50Mortage Rate
AltSet:4: 50Business Proposal
AltSet:5: 50Lower Payment
AltSet:6: 50(Big|Much|More|Grant) Money
AltSet:7: 50Jackpot
AltSet:8: 30Financial
AltSet:9: 30Monthly Payment
AltSet:10: 30Low.?Rates
AltSet:11: 30Wasting Money
AltSet:12: 30Compete.*Your Business
AltSet:13: 50Investment
AltSet:14: 50Income
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for mailing lists (this kills a lot of spam):
BeginFilter
Name: Spam: Mailing lists
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 30Stop Receiving
AltSet:1: 30Receiving Messages
AltSet:2: 30Remove Yourself
AltSet:3: 30Subscriber
AltSet:4: 30Mailing List
AltSet:5: 30Emails? From Us
AltSet:6: 30Remove Your Email
AltSet:7: 30Remove.{0,25}Subject List
AltSet:8: 30Unsubscribe
AltSet:9: 30Extracted Mailing
AltSet:10: 30No Mail
AltSet:11: 30(Off|From) (The|This) List
AltSet:12: 30To Be Removed
AltSet:13: 30Abzumelden
AltSet:14: 30(Erase|Delete) Your Email
AltSet:15: 30Eliminated From
AltSet:16: 30Future Mail(ing)?s
AltSet:17: 40List-Unsubscribe:
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for registrations and orders:
BeginFilter
Name: Spam:Registrations and orders
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 30Online Registration
AltSet:1: 30Credit Card
AltSet:2: 30Order Online
AltSet:3: 30To Order
AltSet:4: 50Get.{0,25}Free
AltSet:5: 50Free.{0,25}(Account|Shipping|Supply|Consultation|Software)
AltSet:6: 50Offers From Us
AltSet:7: 30Pricelist
AltSet:8: 30For Free
AltSet:9: 40Rapid Deals
AltSet:10: 30Sign Up
AltSet:11: 30Dienstleistung
AltSet:12: 30Limited.{0,25}Offer
AltSet:13: 30Money Back
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for unwanted contacts:
BeginFilter
Name: Spam: Contacts
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 30Please (Visit|Call)
AltSet:1: 30Enjoy It
AltSet:2: 30(Visit|Call|Send|Contact|Email) (Our|Us)
AltSet:3: 30(?ims)(Click(ing)?|Enter|Push|Continue).{0,8}(Here|Now|4)
AltSet:4: 30Klicken Sie
AltSet:5: 30For (More )?Information
AltSet:6: 30(Select|Activate|Click) (This|The) Link
AltSet:7: 30Click for More
AltSet:8: 30Check.{0,10}Out
AltSet:9: 30Visit This
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
A filter for virus tools:
BeginFilter
Name: Spam: Virus tools
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 50Blocking Spam
AltSet:1: 50(worm.*virus|virus.*worm)
AltSet:2: 50Virus Update
AltSet:3: 30Virus Protection
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
And now a filter for some other type of crap:
BeginFilter
Name: Spam: General
Active: 1
Source: \Inbox
Target: \Inbox\Spam
CopyFolder: \\\\none
MainSet: 50Cell ?Phone
AltSet:1: 50Casino
AltSet:2: 50Mobile Phones?
AltSet:3: 50Free (Auction|Tools?)
AltSet:4: 50Auction (Class|Tools)
AltSet:5: 50Cable Filters
AltSet:6: 30www\.lo7o\.com
AltSet:7: 50Descrambler?
AltSet:8: 30(?ims)\A.{0,150}[\s\W\t\f\r\n]{20,}
AltSet:9: 30(?ims)Private.*Confidential
AltSet:10: 00^.*(/d){4,}.*@
AltSet:11: 30(?ims)\A.{0,5}\z
AltSet:12: 30(?ims)(God | Jesus).*(Jesus | God)
AltSet:13: 20^.+(\s){5,}.+
Actions: faMarkRead,faoRegExp,faSetColor
ColourGroup: Spam
IsOfColour: Spam
EndFilter
The last filter has some special filters:
^.+(\s){5,}.+ = move messages with at least 5 spaces in the subject.
(?ims)\A.{0,5}\z = move messages with less than 5 chars as message text
(removes html only mails, because most of them are spam)
^.*(/d){4,}.*@ = move messages from senders with more than 4 digits in the
email address.
(?ims)\A.{0,150}[\s\W\t\f\r\n]{20,} = move chinese spam messages.
Mssg & header editor [
Filter] |
Edit received emails (including header info)
|
This filter/batch file combo will export the high-lighted email to a text
file for editing then reimported the edited email message to the inbox.
The filter exports the file and starts the batch file which calls your text
editor and then calls The Bat! to do an import.
Alter the parameters below in [brackets] to suit your configuration. The
filter, as is, looks for the batch file to be:
c:\progra~1\thebat~1\editmsg.bat.
The batch file:
===============
start /max /wait c:\temp\edit.txt
REM The filter exports the mssg as c:\temp\edit.txt
REM /wait tells the batch file to not do anything
REM else until this process is ended.
REM /max says run in a maximized window.
REM There is no text editor called here because my file
REM associations already will invove my editor by just
REM opening the file itself.
REM If you wanted to call a particular editor your line
REM could read
REM start /max /wait "c:\windows\notepad.exe" c:\temp\edit.txt
"c:\progra~1\thebat~1\thebat.exe" /importu=[ACCOUNTNAME];f="[FOLDER]";X;R;IN=c:\temp\edit.txt
REM Substitute [ACCOUNTNAME] & [FOLDER] to tell TB! where you want to import to.
Copy the filter below (everything from, to and including the BeginFilter &
EndFilter lines) and paste it (CTRL-V) into your open sorting office.
Substitue REAL folder names where specified below.
The filter:
===============
BeginFilter
Name: Revise Message
Active: 1
Source: \Inbox
Target: \Inbox
MainSet: 00
Actions: faExport,faExternal,faoExportOver,faoRunDetached,faoManualOnly,
faoHotKey,faoHKCheckMsg,faoSaveUnix,faoHotKeyOnly
ExtCmd: c:\progra~1\thebat~1\editmsg.bat
ExtFile: c:\temp\edit.txt
HotKey: 57413
EndFilter
And, for version 3 of The Bat!, use this filter:
====================8<=====================================================
$$$$ TB! Message Filter $$$$
beginFilter
UID: [4A5D8A64.01C4A341.7AB167DC.09F13D53]
Name: ManEdit
Filter: {\0D\0A\20`21\0D\0A}
ExportMessage Kludges OverwriteExist FmtRFC822 filename C:\5Ctemp\5CMessage2Edit.txt
RunExternal Wait CmdLine C:\5CProgram\20File\5CThe\20Bat!\5CMessage2Edit.bat
IsActive
IsHotkey
IsHotkeyOnly
endFilter
====================8<=====================================================
SpamCop submission [
Filter] |
Automatically submit a spam message to SpamCop
|
ToDo: First copy these filters to Notepad or SmartBat and tidy them up. You
will have to specify your own SpamCop spam submission address in the "forward
message" action option. You must also make sure that the "Actions:" are
pasted as a single line of text and not wrapped as they appear here. Copy
the tidied up filter to the clipboard and then paste it into your sorting
office using Ctrl-V.
===================== Filter starts here
BeginFilter
Name: Submit spam to SpamCop
Active: 0
Source: \Inbox
Target: \Trash
CopyFolder: \\\\none
MainSet: 40.
Actions: faMarkRead,faNewMsg,faExport,faoExportOver,faoExportKludges,
faoManualOnly,faoHotKey,faoSaveUnix
NewAddr: submit.ShusJmC3eoSbRk41@spam.spamcop.net
NewTemplate: %put\3D\27C:\5Ctemp\5Cexport.txt\27\0D\0A
ExtFile: C:\temp\export.txt
HotKey: 49235
SaveTemplate: \0D\0A
EndFilter
Then - there is what happens when the notification comes back from SpamCop
that the reports are ready to process. You can automate the procedure with
the following filter. You may need to change the launcher (which refers to
IE) if IE is not your preferred browser.
***NEW***: This version of the procedure now logs into your SpamCop account
too. You will have to change the "name%%%%40domain.com:password" text to be
your account name and password. Oh yes, the %%%%40 is an "@" sign in
macro+batch file encoding.
Once again, copy these filters to Notepad or SmartBat and tidy them up
before pasting them into the sorting office. The one to pay special
attention to here is the SaveTemplate command, which should not have
any line breaks.
===================== Filter starts here
BeginFilter
Name: SpamCop AutoResponder
Active: 1
Source: \Inbox
Target: \Trash
MainSet: 00spamcop.net
MainSet: 20SpamCop has accepted
Actions: faMarkRead,faExport,faExternal,faoExportOver,faoWaitCompletion
ExtCmd: C:\temp\spamcop.bat
ExtFile: C:\temp\spamcop.bat
SaveTemplate: \22c:\5CProgram\20Files\5CInternet\20Explorer\5CIEXPLORE.EXE\22\20%-
\0D\0Ahttp://name%%%%40domain.com:password@members.%-
\0D\0A%REGEXPTEXT\3D\22spamcop.net/sc\5CS*\22\0D\0Acls\0D\0A
EndFilter
If you are a user of the free service, you don't need to log in. Here's a
version of that filter for you folks.
Once again, copy these filters to Notepad or SmartBat and tidy them up
#before pasting them into the sorting office. The one to watch again is
the SaveTemplate command.
===================== Filter starts here
BeginFilter
Name: SpamCop AutoResponder
Active: 1
Source: \Inbox
Target: \Trash
MainSet: 00spamcop.net
MainSet: 20SpamCop has accepted
Actions: faMarkRead,faExport,faExternal,faoExportOver,faoWaitCompletion
ExtCmd: C:\temp\spamcop.bat
ExtFile: C:\temp\spamcop.bat
SaveTemplate: \22c:\5CProgram\20Files\5CInternet\20Explorer\5CIEXPLORE.EXE\22\20%-
\0D\0Ahttp://%REGEXPTEXT\3D\22spamcop.net/sc\5CS*\22\0D\0Acls\0D\0A
EndFilter
Copyright © 1996 - 2004 Marck D. Pearlstone
Last Updated 15th-October-2009