Re: Simple content filter doesn't work

From: Victor Duchovni (no email)
Date: Wed Jul 02 2008 - 12:04:22 EDT

  • Next message: Benoit Giannangeli: "Re: Simple content filter doesn't work"

    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.
    

  • Next message: Benoit Giannangeli: "Re: Simple content filter doesn't work"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD