Moderators: ScalixSupport, admin
Code: Select all
#!/usr/bin/perl
#
# Creates a "spam" folder in the user's inbox and sets a
# filterset redirecting all messages marked "[SPAM]" there.
#
# make sure to copy the 'sxaa' file from the scalix
# admin_resource_kit to /usr/bin
#
# usage: create_spam_filter.pl [user_name | all]
#
use strict;
use warnings;
use Mail::IMAPClient;
my $host="hostname";
my $username="mboxadmin";
my $password="password";
my $createFolder="/Inbox/spam";
my $checkUser=$ARGV[0];
my @all_users=`/opt/scalix/bin/omshowu -m all -i`;
foreach my $punter (@all_users){
if ($punter eq $checkUser || $checkUser eq "all"){
chomp $punter;
my $user="mboxadmin:$username:$punter";
my $imap = new Mail::IMAPClient( 'Server' => $host , 'User' => $user , 'Password' => $password ) or next;
print "Found user: ".$punter."\n";
$imap->create($createFolder) or die "Could not create spam folder\n";
system('/usr/bin/sxaa --user '.$punter.' --file "$createFolder" --subject "[SPAM]" --title "spam filter"');
}
}
kool_kid wrote:Yep that helped me thanks, now i want to create a "junk folder" and then automatically send all spam mails to this folder, how can i achieve this?
kool_kid wrote:Whenever I'm trying to backup the scalix folder in compressed format using tar tool it throws me "ignoring socket file", is it a risk if i don't copy this files. the command I'm issuing is
tar -cjf <source> </var/opt/scalix
can someone help me with the command.
Users browsing this forum: No registered users and 1 guest