This is what I did:

I installed Courier::Filter::Module::MIMEParts with CPAN.
I created /usr/local/courier/etc/filters/pureperlfilter.conf:
use utf8;

use Courier::Filter::Logger::File;
use Courier::Filter::Module::MIMEParts;

    $options = {
        logger      => Courier::Filter::Logger::File->new(
            file_name   => '/var/log/courier-pureperlfilter.log',
            timestamp   => 1
        }
    };

    my $module = Courier::Filter::Module::MIMEParts->new(
        max_size    => $max_size,
        signatures  => [
            {
            file_name   => qr/\.(exe|com|pif|lnk)$/,
            response    => '500 Executable content rejected'
                },
        ],

        logger      => $logger,
        inverse     => 0,
        trusting    => 0,
        testing     => 0,
        debugging   => 0
    );

    my $filter = Courier::Filter->new(
        modules     => [ $module ],
    );

ln -s /usr/local/courier/etc/filters/pureperlfilter.conf /usr/local/courier/etc/filters/active/

/usr/local/courier/sbin/courierfilter start

/var/log/maillog:
Aug 12 11:56:15 mail courierfilter: exec: Exec format error
Aug 12 11:56:15 mail courierfilter: Starting pureperlfilter.conf

And of course its not working. Can you point me in the right direction?


Julian Mehnle wrote:
Bernard Robbins <[EMAIL PROTECTED]> wrote:

Is there any way to reject an email if it contains any attachment with
an extension of:
(?i)\.(001|002|386|3GR|ACM|ADT|AP.|ASD|ASP|AX.|BAT|BIN|BO.|CC.|CDR|CHM|
CLA|CMD|CNV|CP.|CSC|D.B|DEV|DIF|DL.|DRV|EE.|EX.|FMT|FO.|GMS|HDI|HLP|HT.|
IM.|IN.|JS.|LIB|MB.|MD.|MHT|MOD|MPD|MPP|MPT|MRC|MS.|OB.|OC.|OL.|OLE|OTM|
OV.|PCI|PHP|PIF|PLG|POT|PP.|PRC|QLB|QPW|QTC|REG|RTF|SCR|SH.|SIS|SMM|SYS|
TD0|TLB|TSP|VB.|VS.|VWP|VXD|WBK|WIZ|WP.|WRI|WS.|X32|XML|XSL|XTP|XX.|
ZL.)$


Try using Courier::Filter[1]'s MIMEParts filter module.  You can use your
regex with the "file_name" signature aspect to reject unwanted mails
during the SMTP dialog.  You may want to use a //x style regex for
extended legibility, though (see `perldoc perlre` for the //x modifier).

References:
 1. http://search.cpan.org/dist/Courier-Filter/



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to