Search  Users  Rules 
Forgot your password?
Pages: 1
How to filter no entries in the "To" field
I got a hint that I can filter spam mails from people who leave the "TO" field blank. But how?
The To: field contains the recipient's email address so I do not think an email with an empty or missing To: will reach you at all.
Maybe you mean Subject: ?
Anyway you may try a filter like
Message source|does not match|\bTo: .{5,}\b

which should filter messages where there are less than 5 chars after the 'To: ' (note that there is a space after it)
Haven't tested the regex, please check. It can surely be written in a better way.
Even with TB you can send messages without a valid address in the To: header, just enter something in the CC: or BCC: header.

The only way to for empty To: headers is filtering the headers for this string:
This looks for a line that starts with To: followed by any number of spaces and ends with a line break, because that's what an empty To: header is, rember to use the 'matches' condition and not 'contains', becayse regular expressions don't work with the latter.
I'm just a user of The Bat! I don't work for Ritlabs.
Shall I put Header field > TO > matches all as RegExp


> match
I'd go for 'match', but you've got to try for yourself what works best. I'm not sure about the difference between those two.

Don't use
Header field > To > match >
but use
Header > match > ^To:\s*\n
Due to a bug (that's being worked on) searching on the To: header will search in the CC: header too.
I'm just a user of The Bat! I don't work for Ritlabs.
Pages: 1
Users browsing this topic (1 guests)