From: Benoit Giannangeli (no email)
Date: Wed Jul 02 2008 - 12:27:00 EDT
The point is you do not have understood what i am doing.
There is a Java service which is running and DOES failure collecting
etc. The MimeMessage class of javax.mail DOES recipient adresses
recognition that's why I don't need to pass them to my script.
My script is just a way to interact with the real program and is
simply copying the input into the socket, leaving the real process to
the java program.
Anyway I wasn't asking for design advices. Can someone tell me why
postfix doesn't execute the perl script and act as if there where no
"-o content_filter" ?
2008/7/2 Victor Duchovni <>:
>
> On Wed, Jul 02, 2008 at 04:57:44PM +0200, Benoit Giannangeli wrote:
>
> > filtre unix - n n - - pipe
> > flags=Rq user=filter argv=/etc/postfix/socket_connect.pl 127.0.0.1 10027
>
> This approach is severely broken as makes no use of the envelope
> recipient address. It is a sadly common, but dramatic mistake to
> assume that the headers contain sufficient information to determine
> where mail needs to be sent. If you were processing *this* message,
> how would you know to send it to your mailbox and not loop it back
> to the list!!!
>
> > As you can see, i try to launch the '/etc/postfix/socket_connect.pl' script
> > which open a socket to the java service and write the mail on it:
> >
> > #! /usr/bin/perl -w
> >
> > use strict;
> > use warnings;
> > use IO::Socket;
> >
> > my ($host,$port) = @ARGV;
> >
> > my $socket = IO::Socket::INET->new(Proto => "tcp",
> > PeerAddr => $host,
> > PeerPort => $port)
> > or die "Failed : $@\n";
> >
> > for my $line (<STDIN>) {
> > print $socket $line;
> > }
> >
> > print $socket "<--MAIL-->";
> >
> > close($socket);
>
> This script is broken it speaks no useful protocol, cannot collect failure
> results, ...
>
> You are lucky it "does not work", because the design is completely broken,
> and if it "worked" it would misdeliver and lose email.
>
> I am afraid my best recommendation is that you should not attempt this
> on your own.
>
> --
> Viktor.
>
> Disclaimer: off-list followups get on-list replies or get ignored.
> Please do not ignore the "Reply-To" header.
>
> To unsubscribe from the postfix-users list, visit
> http://www.postfix.org/lists.html or click the link below:
> <mailto:?body=unsubscribe%20postfix-users>
>
> If my response solves your problem, the best way to thank me is to not
> send an "it worked, thanks" follow-up. If you must respond, please put
> "It worked, thanks" in the "Subject" so I can delete these quickly.
-- Benoit Giannangeli http://www.giann.fr/
|
|
|