Magnus Bäck wrote:
On Thursday, March 05, 2009 at 00:25 CET,
     "Daniel L. Miller" <dmil...@amfes.com> wrote:

What I have/had now was the following:
master.cf:
192.168.0.11:smtp      inet  n       -       -       -       -       smtpd
 -o relayhost=[192.168.0.10]:225
192.168.0.11:125      inet  n       -       -       -       -       smtpd
 -o relayhost=

The intent was to have local clients connect to 192.168.0.11:25. Postfix should then relay it to 192.168.0.10:225. That relay will then process and return it to 192.168.0.11:125 - which would then send it to the destination.

Right now, the above config "functions" in that it receives a message from a client and delivers it to the destination - but it never hits my filter.

No, because smtpd(8) doesn't pay attention to the relayhost parameter
and doesn't pass it on to the rest of Postfix. Postfix is modular, and
the relayhost is not a per-message property.

You're on the right track, just use content_filter instead. See
FILTER_README.

I'm closing in on it - now for some fine-tuning. Now, a test master.cf contains:
192.168.0.11:smtp      inet  n       -       -       -       -       smtpd
 -o smtpd_proxy_filter=inet:192.168.0.11:325
192.168.0.11:325      inet  n       -       -       -       -       smtpd
 -o smtpd_proxy_filter=

This actually works - I can see in the log the relay between the processes and then the handoff to the remote server. Mar 4 23:22:54 mailserver postfix/smtpd[21006]: connect from unknown[192.168.0.90] Mar 4 23:22:54 mailserver postfix/smtpd[21010]: connect from smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:22:54 mailserver postfix/smtpd[21006]: NOQUEUE: client=unknown[192.168.0.90] Mar 4 23:22:54 mailserver postfix/smtpd[21010]: F20D476031: client=smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:22:55 mailserver postfix/cleanup[21011]: F20D476031: message-id=<49af7dc3.10...@amfes.com> Mar 4 23:22:55 mailserver postfix/qmgr[21005]: F20D476031: from=<dmil...@amfes.com>, size=835, nrcpt=1 (queue active) Mar 4 23:22:55 mailserver postfix/smtpd[21010]: disconnect from smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:22:55 mailserver postfix/smtpd[21006]: disconnect from unknown[192.168.0.90] Mar 4 23:22:55 mailserver postfix/smtp[21012]: F20D476031: to=<fireexp...@hotmail.com>, relay=mx3.hotmail.com[65.55.37.120]:25, delay=0.42, delays=0.1/0.01/0.18/0.13, dsn=2.0.0, status=sent (250 <49af7dc3.10...@amfes.com> Queued mail for delivery)
Mar  4 23:22:55 mailserver postfix/qmgr[21005]: F20D476031: removed

Now - to see what's broken. When the smtpd_proxy_filter line is pointed to the real proxy, and the proxy is pointed to return to the :325 port, my log shows: Mar 4 23:21:33 mailserver postfix/smtpd[20964]: connect from unknown[192.168.0.90] Mar 4 23:21:33 mailserver postfix/smtpd[20970]: connect from smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:21:33 mailserver postfix/smtpd[20964]: NOQUEUE: client=unknown[192.168.0.90] Mar 4 23:21:33 mailserver postfix/smtpd[20970]: A812D76031: client=smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:21:33 mailserver postfix/smtpd[20964]: warning: proxy inet:192.168.0.10:225 rejected "DATA": "250 2.1.5 Ok" Mar 4 23:21:33 mailserver postfix/smtpd[20964]: warning: non-SMTP command from unknown[192.168.0.90]: Message-ID: <49af7d71.70...@amfes.com> Mar 4 23:21:33 mailserver postfix/smtpd[20964]: disconnect from unknown[192.168.0.90] Mar 4 23:21:33 mailserver postfix/smtpd[20970]: lost connection after DATA (0 bytes) from smtp-local.amfeslan.local[192.168.0.11] Mar 4 23:21:33 mailserver postfix/smtpd[20970]: disconnect from smtp-local.amfeslan.local[192.168.0.11]

Does this indicate a Postfix problem? Or is my proxy filter mangling something?
--
Daniel

Reply via email to