Here you go. You will need to configure a data source in your config.xml. I have included the relevant info from my config.xml below.

Also.. one note.. this is NOT production ready.. have to amend the code to handle emails with no "To" address (emails that only have a CC or BCC) and a few other issues. <please no comments on my Java code.. i did this in a hurry and it was more of a proof of concept/prototype>

:)

but this should get you started on logging rejections to a DB with pertinent info.

Hope this helps you!!!


from config.xml:
---------------------------------------------------
1) in the "root" processor you should have mailets doing your spam filtering.. one or many of similar items like so:

<mailet match="InSpammerBlacklist=list.dsbl.org" class="ToProcessor">
<processor> spam </processor>
<notice>550 Requested action not taken: open spam relay - see http://dsbl.org/listingquery </notice>
</mailet>

the text in the "notice" block above is what will be logged in the rejection DB table.

2) in your "spam" processor add the JDBCLogRejection mailet:

<mailet match="All" class="JDBCLogRejection">
       <logdburl> db://datasourcename/rejected </logdburl>
       <reject-type> spam </reject-type>
</mailet>

I use the mailet for both spam and virus rejection logging.. hence the "reject-type."

3) add a data source to your database connections

<data-source name="datasourcename" class="org.apache.james.util.mordred.JdbcDataSource">
<driver>org.gjt.mm.mysql.Driver</driver>
<dburl>jdbc:mysql://localhost/database?autoReconnect=true</dburl>
<user>user</user>
<password>password</password>
<max>20</max>
</data-source>





J Malcolm wrote:

That would be tremendous. Please send it along.

Thanks.

Jerry

-----Original Message-----
From: Corey A. Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:25 PM
To: James Users List
Subject: Re: FW: Tracking each piece of mail through the system

I created a Mailet that logs info about any rejection to a MySQL DB. Was

pretty straight forward. I can send you the source if you like.

Cj

J Malcolm wrote:



Never got a response on this one. Justing bumping it back to the top of stack. Anybody got any suggestions on how to track end to end?

Thanks.

Jerry

-----Original Message-----
*From:* J Malcolm [mailto:[EMAIL PROTECTED]
*Sent:* Friday, March 19, 2004 3:20 PM
*To:* James Users List
*Subject:* Tracking each piece of mail through the system

I've got a situation where some legit mail is being categorized as spam. I run a few of the default spam blockers that come with James. But I can't figure out which one is causing a spam hit. I'm familiar with all the various logs. But there doesn't appear to be a single routing log that tracks a note through all the processors/matchers/mailets.

Am I missing something? Is there an easy way to enable some sort of tracking log?

Thanks.

Jerry







-- Corey A. Johnson Creative Network Innovations http://www.cniweb.net/ 1-800-CNi-5547 ** 1-321-259-1984


Attachment: JDBCLogRejection.java
Description: java/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to