From: Gary Smith on
> Just make sure to close stdout and stderr, to avoid writing garbage
> into the pipe between Postfix and the filter, used to collect filter
> error messages.
>
> With this level of complexity, you really should use the advanced (SMTP)
> filter approach not pipe(8) based filters.
>

Victor,

To be honest, I haven't been able to successfully make the SMTP method work.. I tried it last summer for something similar and ran into a bunch of small problems (can't remember what they were off the top of my head).

If you have any simple samples of hitting a perl or python script using the SMTP method, can you send it to me. I tried what's on the web site (for advanced content filtering) but for some reason I just didn't get it (it didn't click for me).

From: Wietse Venema on
Victor Duchovni:
> On Tue, May 11, 2010 at 10:40:05AM -0700, Gary Smith wrote:
>
> > My question is will this fork process cause any problems with postfix
> > itself? I just don't know what the impact of a fork in the content_filter
> > will be.
>
> Just make sure to close stdout and stderr, to avoid writing garbage
> into the pipe between Postfix and the filter, used to collect filter
> error messages.

Also, if the process does not close/redirect stdout and stderr,
Postfix will still wait for program output, and you won't gain any
speedup from forking off into the background.

> With this level of complexity, you really should use the advanced (SMTP)
> filter approach not pipe(8) based filters.

I agree. pipe-to-command+exit-status is a clumsy way to run a filter.

Wietse

From: Gary Smith on
> Also, if the process does not close/redirect stdout and stderr,
> Postfix will still wait for program output, and you won't gain any
> speedup from forking off into the background.
>
> > With this level of complexity, you really should use the advanced (SMTP)
> > filter approach not pipe(8) based filters.
>
> I agree. pipe-to-command+exit-status is a clumsy way to run a filter.
>
> Wietse

Well, you guys are the experts ;). I will look into setting up an SMTP proxy here in the near future. For now I'll stick with the out of process cronjob.

Gary-

From: Gary Smith on
>
> Just make sure to close stdout and stderr, to avoid writing garbage
> into the pipe between Postfix and the filter, used to collect filter
> error messages.
>
> With this level of complexity, you really should use the advanced (SMTP)
> filter approach not pipe(8) based filters.

Looking around there are some pretty simple samples of what I want to accomplish (in both perl and python). I do have one question about the format of the SMTP protocol as to how incoming connections are handled.

When it comes to envelope, specifically "mail from:" and "rcpt to:", my understanding is that these will never have comments in them and be just plain email addresses john(a)example.com, bounce(a)jack@bounce(a)example.com, etc, but never "jack" <jack(a)example.com> (or <jack(a)example.com> (i.e. the <> ). In the sample python server, it passes in mailfrom and rcptto's and I'm just trying to get a feel for the format to expect those addresses in.

Can one of the protocol experts confirm?

From: Wietse Venema on
Gary Smith:
> >
> > Just make sure to close stdout and stderr, to avoid writing garbage
> > into the pipe between Postfix and the filter, used to collect filter
> > error messages.
> >
> > With this level of complexity, you really should use the advanced (SMTP)
> > filter approach not pipe(8) based filters.
>
> Looking around there are some pretty simple samples of what I want
> to accomplish (in both perl and python). I do have one question
> about the format of the SMTP protocol as to how incoming connections
> are handled.
>
> When it comes to envelope, specifically "mail from:" and "rcpt
> to:", my understanding is that these will never have comments in
> them and be just plain email addresses john(a)example.com,
> bounce(a)jack@bounce(a)example.com, etc, but never "jack" <jack(a)example.com>
> (or <jack(a)example.com> (i.e. the <> ). In the sample python
> server, it passes in mailfrom and rcptto's and I'm just trying to
> get a feel for the format to expect those addresses in.

That depends on how Postfix is configured.

Remember, Postfix passes the RCPT TO and MAIL FROM commands to the
filter as received. By default, Postfix allows non-standard forms
(such as your examples). If this is a problem then you will need
to configure "strict_rfc821_envelopes = yes" in main.cf.

Wietse

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: back-scatter
Next: adding header to outgoing mail