If both Subject and Body are empty...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

If both Subject and Body are empty...

Adrian Overbury-2
I'm trying to reject mail (preferably by the end of the DATA command,
before delivery actually happens) which has a blank or non-existent
Subject header, and that contains no text in the body (so there's
nothing after the double \n\n at the end of the headers).  I can detect
both of these conditions with header_checks and body_checks, but I don't
  know if there's a way that I can tell postfix "reject the mail if both
header_checks and body_checks would reject it".  Has anyone ever done
something similar to this?  I'd prefer avoiding using smtp_proxy or
content_filter to do before- or after-queue filtering, if possible, but
I'm not closed-minded about it.

Regards,

Adrian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: If both Subject and Body are empty...

Victor Duchovni
On Wed, Apr 30, 2008 at 12:43:56PM +1000, Adrian Overbury wrote:

> I'm trying to reject mail (preferably by the end of the DATA command,
> before delivery actually happens) which has a blank or non-existent
> Subject header, and that contains no text in the body (so there's
> nothing after the double \n\n at the end of the headers).  I can detect
> both of these conditions with header_checks and body_checks,

Actually, you can't. Header checks can't detect a missing Subject.
Body_checks can't detect an empty body.

> but I don't
>  know if there's a way that I can tell postfix "reject the mail if both
> header_checks and body_checks would reject it".  Has anyone ever done
> something similar to this?  I'd prefer avoiding using smtp_proxy or
> content_filter to do before- or after-queue filtering, if possible, but
> I'm not closed-minded about it.

You need a proxy filter or milter to reject this.

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Loading...