custom function

No Name lilvalo at MIKIBOY.COM
Sun Jul 11 21:33:00 IST 2004


Hi all,
        This is my setup:
        gentoo linux + postfix + mysql for virt mail hosting = virt users
mail goes /home/vmail/$DOMAIN/$USER/.maildir/

        It works wondefully fine. Now I wanted to send the Junk/Spam mail
to its own folder but that wasn't working that well. I found the procmail
post in the archives, but then I found out that procmail doesn't play well
with virtual users. I wanted to do what Julian suggest, is to have the two
Spam settings forward to $USER-spam@$DOMAIN

        So I tried it manually for one account and it works wonderfully
well, delivering it to the folder Spam :)

        So then I started looking into writing a CustomFunction

        /opt/MailScanner/lib/MailScanner/CustomFunctions/MyExample.pm is
        the files that came with MailScanner and put my code in there.

        This is my code:
        sub InternalForward {
          my($fromac, $fromdomain, $todomain, $return);
          my($message) = @_;
          $fromac = lc($message->{from});
          $fromdomain = $fromac;
          $fromac =~ s/\@.*$//;   # Leave everything before @
          $fromdomain =~ s/^.*\@//; # Leave everything after  @
          $return = "forward ".$fromac."-spam".$fromdomain;
          MailScanner::Log::InfoLog($return);
          return $return;
        }

I copied a bunch of it from some other file I was reading to figure out
how to code it. Mailscanner starts up perfectly fine :) but then when I
send some spam mail to the address (yes I have some saved spam mail for
testing :) , actually a few thousand :) ) it goes to the inbox and not the
spam folder.

Questions:
Is there some way I can see the log output, like where in the world is the
output of my Log line sent to? BTW i use metalog and not syslog.

Has anyone done this yet? If some can you help me out with what I am doing
wrong?

Thanks

Valmiki
PS horde imp, squirrelmail or open webmail -> which one would you'll
suggest best? and yes I've used all 3 and I'm indifferent

--
Got Speed?

www.mikiboy.com
aim: lilvalo

-------------------------- MailScanner list ----------------------
To leave, send    leave mailscanner    to jiscmail at jiscmail.ac.uk
Before posting, please see the Most Asked Questions at
http://www.mailscanner.biz/maq/     and the archives at
http://www.jiscmail.ac.uk/lists/mailscanner.html



More information about the MailScanner mailing list