From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <4253C8E7.4060301@elan.com.ua> Date: Wed, 06 Apr 2005 14:32:55 +0300 From: Slava Dubrovskiy User-Agent: Mozilla Thunderbird 1.0 (X11/20050202) X-Accept-Language: ru-ru, ru MIME-Version: 1.0 To: community@altlinux.ru Subject: Re: [Comm] sa-learn and spam References: <42523E23.7070903@ricom.ru> <42524782.2050600@elan.com.ua> <42525480.4010008@ricom.ru> <425269DE.7070300@elan.com.ua> <42526F04.6070002@ricom.ru> <425271DA.6080206@elan.com.ua> <425272FA.1090906@ricom.ru> <42529D97.6020302@sakhalin.ru> <4253BCA6.4070003@elan.com.ua> In-Reply-To: <4253BCA6.4070003@elan.com.ua> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070107030905050807020408" X-Virus-Scanned: by amavisd-new at localhost X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: community@altlinux.ru List-Id: Mailing list for ALT Linux users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2005 11:32:59 -0000 Archived-At: List-Archive: List-Post: This is a multi-part message in MIME format. --------------070107030905050807020408 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit Slava Dubrovskiy пишет: >>Автору треда: http://jousset.org/pub/sa-postfix.en.html -- для твоего >>случая >>должно подойти ... >> >> >2. Теперь письмо отдается sa-wrapper.pl но он вываливается вот с таким >сообщением: >Apr 6 13:22:04 server postfix/pipe[6650]: D6F4D5F1E4: >to=, orig_to=, relay=sa-spam, delay=3, >status=bounced (Command died with status 255: >"/usr/local/bin/sa-wrapper.pl") > > > Знатоки перла, объясните пожалуйста, что означает последняя строчка в скрипте и почему она не работает? -- С уважением, Дубровский Вячеслав. --------------070107030905050807020408 Content-Type: text/plain; name="sa-wrapper.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sa-wrapper.pl" #!/usr/bin/perl -w # Time-stamp: <05 April 2004, 13:37 home> # # sa-wrapper.pl # # SpamAssassin sa-learn wrapper # (c) Alexandre Jousset, 2004 # This script is GPL'd # # Thanks to: Chung-Kie Tung for the removal of the dir # Adam Gent for bug report # # v1.2 use strict; use MIME::Tools; use MIME::Parser; my $DEBUG = 0; my $UNPACK_DIR = '/var/spool/amavis/mime'; my $SA_LEARN = '/usr/bin/sa-learn'; my @DOMAINS = qw/gtmp.org winnink.org/; my ($spamham, $sender) = @ARGV; sub recurs { my $ent = shift; if ($ent->head->mime_type eq 'message/rfc822') { if ($DEBUG) { unlink "/tmp/spam.log.$$" if -e "/tmp/spam.log.$$"; open(OUT, "|$SA_LEARN -D --$spamham --single >>/tmp/spam.log.$$ 2>&1") or die "Cannot pipe $SA_LEARN: $!"; } else { open(OUT, "|$SA_LEARN --$spamham --single") or die "Cannot pipe $SA_LEARN: $!"; } $ent->bodyhandle->print(\*OUT); close(OUT); return; } my @parts = $ent->parts; if (@parts) { map { recurs($_) } @parts; } } my ($domain) = $sender =~ /\@(.*)$/; unless (grep { $_ eq $domain } @DOMAINS) { die "I don't recognize your domain !"; } if ($DEBUG) { MIME::Tools->debugging(1); open(STDERR, ">/tmp/spam_err.log"); } my $parser = new MIME::Parser; $parser->extract_nested_messages(0); $parser->output_under($UNPACK_DIR); my $entity; eval { $entity = $parser->parse(\*STDIN); }; if ($@) { die $@; } else { recurs($entity); } $parser->filer->purge; rmdir $parser->output_dir; --------------070107030905050807020408--