All,

It was suggested off list that I remove the '<>' brackets from this section:

my $server = Mail::IMAPClient->new(
        Server => "<msexsrv1.knust.com>",
        User => "<spamlearn>",
        Password => "<houston>",
        Uid => 1,
        Debug => 0 );

So I tried that and it helped as the script now runs, but it does't pull any
messages off Exchange.  It reports that it pulled 1 message, and does create
an empty file named "1" in /var/amavisd/spam.  It produces these results
regardless of how many are in the public folder.  I'm now digging through
perldoc.org but if someone has an idea I would much appriciate it.


System info:
OpenBSD 3.3 with Postfix 2.0.13
Amavisd-new with SA 2.55
Perl modules, including SA, installed via CPAN.


My updated version of his script (thanks much Mark):

---- start of file ---

#!/usr/bin/perl

use Mail::IMAPClient;
use Sys::Syslog;

my $FOLDER_NAME = 'Public Folders/All Public Folders/SpamLearn';
my $SEQ = 1; openlog('pullspam','cons,pid', 'user');

my $server = Mail::IMAPClient->new(
        Server => "msexsrv1.knust.com",
        User => "spamlearn",
        Password => "houston",
        Uid => 1,
        Debug => 0 );

$server->select($FOLDER_NAME);
my @msgs = $server->search("ALL");
foreach my $msg (@msgs) {
        $server->message_to_file("/var/amavisd/spamlearn/" . $SEQ,$msg);
        $server->delete_message($msg);
        $SEQ++;
};
$server->expunge($FOLDER_NAME);
print "Pulled ". ($SEQ-1) . " messages from spam folder.\n";
syslog('mail|info', 'Pulled '.($SEQ-1) . ' messages from spam folder.');

--- end of file ---


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to