On Mon, 10 Aug 2009, taphy wrote:

> I have defined header_checks test. Question why it works if I' testing it
> locally and doesn't work when I do my test via smtp?

Because your tests are misguided and lead you to the wrong conclusion.

> this is simple definition in/etc/postfix/
> /^Received:/            IGNORE
> !/^To: [0-9]+@/   WARN    # any message to non-digital accounts should be
> dropped
> 
> example of good work:
> I did it from  the same host where postfix works:
> postfix]# echo test | mail  [email protected]

In this case, the To: header is set.

> log file entries:
> postfix/pickup[7519]: 37347481CE: uid=0 from=<root>
> postfix/cleanup[7525]: 37347481CE:
> message-id=<[email protected]>
> postfix/nqmgr[7520]: 37347481CE: from=<[email protected]>, size=187, nrcpt=1
> (queue active)
> postfix/local[7527]: 37347481CE: to=<[email protected]>,
> orig_to=<[email protected]>, relay=local, delay=1, status=sent (mailbox)
> 
> postfix]# echo test | mail  [email protected]
> postfix/pickup[7519]: 86E27481CE: uid=0 from=<root>
> postfix/cleanup[7532]: 86E27481CE: warning: header To: [email protected]
> from local; from=<[email protected]> to=<[email protected]>: some errors
> postfix/cleanup[7532]: 86E27481CE:
> message-id=<[email protected]>
> postfix/nqmgr[7520]: 86E27481CE: from=<[email protected]>, size=189, nrcpt=1
> (queue active)
> postfix/local[7533]: 86E27481CE: to=<[email protected]>, relay=local,
> delay=0, status=sent (mailbox)
> 
> not successful example:
> did it from other host
> test]# telnet 192.168.11.129 25
> Trying 192.168.11.129...
> Connected to 192.168.11.129.
> Escape character is '^]'.
> 220 mydomain.com ESMTP Postfix
> helo taphy
> 250 mydomain.com
> mail from: [email protected]
> 250 Ok
> rcpt to: [email protected]
> 250 Ok
> data
> 354 End data with <CR><LF>.<CR><LF>
> test
> .

You never set ANY headers.

> 250 Ok: queued as 54B33481CE
> quit
> 221 Bye
> Connection closed by foreign host.
> 
> logfile entries (nothing was done at all by header_checks..):

This is expected.  In an SMTP conversation, RCPT TO: <[email protected]> sets the
ENVELOPE recipient, and has absolutely no relation to the header.  If you
wish to specify headers, you must do so after DATA.

-- 
Sahil Tandon <[email protected]>

Reply via email to