Re: HAM and SPAM mailboxes

2007-03-05 Thread Johann Spies
On Mon, Mar 05, 2007 at 10:58:00AM -0300, Luis Hernán Otegui wrote:
> OK, Chris, I think I'll go on with you suggestion. I seems simpler, and a 
> lower
> load for my busted servers. However, I'm not a Perl Guru myself, so, mind if
> you could clarify what did you ment with "In that case, Perl's
> Mail::Box::Manager is your friend."
> 
> How do I extract the original mail from the forwarded one?

I have written a small program in Ocaml which I use for that purpose.
It extracts emails that was forwarded as attachments and put them in to
a separate diretory from where it can be processed.

At the moment the directories are hardcoded but I can adapt it for more
generic situations there is a need for.

If someone is interested, let me know and I will try and make it
available.

Regards
Johann
-- 
Johann Spies  Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

 "The LORD is my light and my salvation; whom shall I 
  fear? the LORD is the strength of my life; of whom 
  shall I be afraid?"   Psalms 27:1 


Re: HAM and SPAM mailboxes

2007-03-05 Thread Chris St. Pierre

On Mon, 5 Mar 2007, Luis Hernán Otegui wrote:


OK, Chris, I think I'll go on with you suggestion. I seems simpler, and a
lower load for my busted servers. However, I'm not a Perl Guru myself, so,
mind if you could clarify what did you ment with "In that case, Perl's
Mail::Box::Manager is your friend."

How do I extract the original mail from the forwarded one?


No idea -- I'm not doing things that way myself.  My suggestion was
actually to bounce or resend the FPs and FNs, since it's a lot
simpler.  You can just call sa-learn on the bounced messages
themselves rather than extracting the forwarded messages from the
attachments.

If you decide to have your users forward as an attachment, though,
Mail::Box[::Manager] is a Perl module for doing magic with mailboxes.
You'll probably want to do something like this, assuming you're using
Maildir:

my $mgr = Mail::Box::Manager->new();
my $folder = $mgr->open(folder  => "/path/to/spam/mailbox",
   fix_headers => 1);

foreach my $msg ($folder->messages()) {
  magic with $msg->parts()
}

If you're not using Maildir, you'll have to figure out what to do from
there.  I know Mail::Box supports MH, Mbox, and who knows what else,
but haven't used those myself.

http://search.cpan.org/~markov/Mail-Box-2.069/lib/Mail/Box-Overview.pod
should get you started.

Chris St. Pierre
Unix Systems Administrator
Nebraska Wesleyan University

Never send mail to [EMAIL PROTECTED]


Re: HAM and SPAM mailboxes

2007-03-05 Thread Luis Hernán Otegui

OK, Chris, I think I'll go on with you suggestion. I seems simpler, and a
lower load for my busted servers. However, I'm not a Perl Guru myself, so,
mind if you could clarify what did you ment with "In that case, Perl's
Mail::Box::Manager is your friend."

How do I extract the original mail from the forwarded one?


Thanks,



Luis

2007/3/2, Chris St. Pierre <[EMAIL PROTECTED]>:


On Fri, 2 Mar 2007, Luis Hernán Otegui wrote:

> Hi, people, I am currently researching, trying to implement a way for my
> POP3 users to train SA via message forwarding. I've read in the list
that
> the messages should be forwarded as attachments. My question is how do
you
> make SA process them. I was thinking of creating two accounts (
> [EMAIL PROTECTED], and [EMAIL PROTECTED]), but frankly, I don't
understand
> the way to hand the forwarded messages to SA...

Instead of forwarding as an attachment, I have my users
bounce/redirect/resend their mail, which maintains the message in its
original state and is a lot easier to process than messages in
attachments.  That way, I can just have a cron job go through the
[EMAIL PROTECTED] and [EMAIL PROTECTED] mailboxes and have sa-learn learn each 
message.
Otherwise, you'll have to strip the attachments and pipe them into
sa-learn, which is a lot less trivial.  In that case, Perl's
Mail::Box::Manager is your friend.

Chris St. Pierre
Unix Systems Administrator
Nebraska Wesleyan University

Never send mail to [EMAIL PROTECTED]





--
-
GNU-GPL: "May The Source Be With You...
-


Re: HAM and SPAM mailboxes

2007-03-02 Thread Chris St. Pierre

On Fri, 2 Mar 2007, Luis Hernán Otegui wrote:


Hi, people, I am currently researching, trying to implement a way for my
POP3 users to train SA via message forwarding. I've read in the list that
the messages should be forwarded as attachments. My question is how do you
make SA process them. I was thinking of creating two accounts (
[EMAIL PROTECTED], and [EMAIL PROTECTED]), but frankly, I don't understand
the way to hand the forwarded messages to SA...


Instead of forwarding as an attachment, I have my users
bounce/redirect/resend their mail, which maintains the message in its
original state and is a lot easier to process than messages in
attachments.  That way, I can just have a cron job go through the
[EMAIL PROTECTED] and [EMAIL PROTECTED] mailboxes and have sa-learn learn each 
message.
Otherwise, you'll have to strip the attachments and pipe them into
sa-learn, which is a lot less trivial.  In that case, Perl's
Mail::Box::Manager is your friend.

Chris St. Pierre
Unix Systems Administrator
Nebraska Wesleyan University

Never send mail to [EMAIL PROTECTED]


Re: HAM and SPAM mailboxes

2007-03-02 Thread Sandeep Agarwal

On 3/2/07, Luis Hernán Otegui <[EMAIL PROTECTED]> wrote:

Hi, people, I am currently researching, trying to implement a way for my
POP3 users to train SA via message forwarding. I've read in the list that
the messages should be forwarded as attachments. My question is how do you
make SA process them. I was thinking of creating two accounts (
[EMAIL PROTECTED], and [EMAIL PROTECTED]), but frankly, I don't understand
the way to hand the forwarded messages to SA...
Currently, I run two production servers, with virtual users, and they have
separate HAM and SPAM IMAP folders for each user. Via a cron job, I teach
the system the spam messages (I've instructed my users to move the spam
messages there via our webmail). But now I'm looking forward to expand the
service to my POP3 users. Any suggests will be welcomed.

BTW, I run SA (v 3.1.7) trough AMaViS over Postfix, Debian Sarge based
install.


Thanks in advance,


Luis


check this out http://www.goodcleanemail.com/kb.php?ToDo=view&questId=15&catId=2

Sandeep


HAM and SPAM mailboxes

2007-03-02 Thread Luis Hernán Otegui

Hi, people, I am currently researching, trying to implement a way for my
POP3 users to train SA via message forwarding. I've read in the list that
the messages should be forwarded as attachments. My question is how do you
make SA process them. I was thinking of creating two accounts (
[EMAIL PROTECTED], and [EMAIL PROTECTED]), but frankly, I don't understand
the way to hand the forwarded messages to SA...
Currently, I run two production servers, with virtual users, and they have
separate HAM and SPAM IMAP folders for each user. Via a cron job, I teach
the system the spam messages (I've instructed my users to move the spam
messages there via our webmail). But now I'm looking forward to expand the
service to my POP3 users. Any suggests will be welcomed.

BTW, I run SA (v 3.1.7) trough AMaViS over Postfix, Debian Sarge based
install.


Thanks in advance,


Luis
--
-
GNU-GPL: "May The Source Be With You...
-