Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I get a lot of system alerts related blank mails. The custom scripts send empty mails when there is no issue found on the server.

How do I filter such mail? I know how to filter using "From" and "to" fields. I need to know if there is anything in the contents tag.

share|improve this question
    
Can you have them custom script add some phrase such as Nothing significant to report. –  mhoran_psprep Jun 25 '12 at 13:08
add comment

1 Answer 1

All of the available search operators are listed in GMail advanced search help. There's no standard wildcard selector to put into Doesn't have but according to a question about wildcards you can use Perl RegEx for query. This way, you need to construct a query that searches for the absence of any character in the body.

enter image description here

enter image description here

share|improve this answer
    
And how do you check if the body of the mail is empty? –  Alex Jun 25 '12 at 13:00
    
You check with the parameters that aren't empty, such as From and Subject. –  dnbrv Jun 25 '12 at 13:07
    
The OP stated that the script sends empty emails, so how do you check for this situation—if an email’s body is empty or not? That is the OP’s question. –  Alex Jun 25 '12 at 13:11
    
@Alex: See the edits. –  dnbrv Jun 25 '12 at 13:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.