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 1...@mydomain.com 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=<20090811004031.3734748...@mydomain.com> > postfix/nqmgr[7520]: 37347481CE: from=<r...@mydomain.com>, size=187, nrcpt=1 > (queue active) > postfix/local[7527]: 37347481CE: to=<ta...@mydomain.com>, > orig_to=<1...@mydomain.com>, relay=local, delay=1, status=sent (mailbox) > > postfix]# echo test | mail ta...@mydomain.com > postfix/pickup[7519]: 86E27481CE: uid=0 from=<root> > postfix/cleanup[7532]: 86E27481CE: warning: header To: ta...@mydomain.com > from local; from=<r...@mydomain.com> to=<ta...@mydomain.com>: some errors > postfix/cleanup[7532]: 86E27481CE: > message-id=<20090811004225.86e2748...@mydomain.com> > postfix/nqmgr[7520]: 86E27481CE: from=<r...@mydomain.com>, size=189, nrcpt=1 > (queue active) > postfix/local[7533]: 86E27481CE: to=<ta...@mydomain.com>, 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: t...@do.test > 250 Ok > rcpt to: ta...@mydomain.com > 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: <f...@bar.org> 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 <sa...@tandon.net>