Phil Daws:
> Actually all I wanted to do was to put an incoming email in the
> hold queue.  I was using, in the header check, /^Received:/ HOLD
> which works fine when an email comes in from an external source.
> If I try and inject a complete email from the Postfix server itself
> using sendmail -t < filename.eml it was bypassing all checks.  On

Like this?

% postconf header_checks
header_checks = pcre:/etc/postfix/header_checks
% grep -v '^#' /etc/postfix/header_checks
/^Received:/ HOLD
% echo To: wietse | sendmail -t
% tail -3 /var/log/maillog
Sep  5 07:57:14 hostname postfix/pickup[2766]: 70E2E1533939: uid=1001 
from=<wietse>
Sep  5 07:57:14 hostname postfix/cleanup[2771]: 70E2E1533939: hold: header 
Received: by hostname.example.com (Postfix, from userid 1001)??id 70E2E1533939; 
Thu,  5 Sep 2013 07:57:14 -0400 (EDT) from local; from=<wie...@example.com> 
to=<wie...@example.com>
Sep  5 07:57:14 hostname postfix/cleanup[2771]: 70E2E1533939: 
message-id=<20130905115714.70e2e1533...@hostname.example.com>

It hold the message as promised. I anonymized the host/domain name.

        Wietse

Reply via email to