You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by J Malcolm <te...@malcolms.com> on 2004/04/01 22:22:56 UTC

FW: Tracking each piece of mail through the system

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:techstuff@malcolms.com] 
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

 


Re: FW: Tracking each piece of mail through the system

Posted by "Corey A. Johnson" <cj...@cniweb.net>.
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:cjohnson@cniweb.net] 
>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:techstuff@malcolms.com]
>>*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


RE: FW: Tracking each piece of mail through the system

Posted by J Malcolm <te...@malcolms.com>.
That would be tremendous.  Please send it along.

Thanks.

Jerry

-----Original Message-----
From: Corey A. Johnson [mailto:cjohnson@cniweb.net] 
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:techstuff@malcolms.com]
> *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


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: FW: Tracking each piece of mail through the system

Posted by "Corey A. Johnson" <cj...@cniweb.net>.
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:techstuff@malcolms.com]
> *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


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Tracking each piece of mail through the system

Posted by "Noel J. Bergman" <no...@devtech.com>.
> What I'd really like is a log with a single line per mail item:
> Date/Time       From               To            Result     Details

Sounds like a log analyzer.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Tracking each piece of mail through the system

Posted by J Malcolm <te...@malcolms.com>.
I've tried looking at the spoolmanager log.  It references everything by
that long email key requiring backtracking through other logs to find
out who it was from and to.  And it intermixes many threads of mail as
would be expected in a realtime log.  But getting the kind of info I
need out of it is difficult.  What I'd really like is a log with a
single line per mail item:

Date/Time       From               To            Result     Details
------------------------------------------------------------------------
---
4/1/04 16:04  123@xyz.com    jwm@mydomain.com    inbox:jwm  
4/1/04 16:05  a@spammer.com  jwm@mydomain.com    spam       fail nabl
mailet
4/1/04 16:05  jwm@mydomain.com aaa@bbb.com       sent external


If something like this doesn't exist, I can write it.  But I'd like a
little info on where/how to install it.  I guess the first question is
whether this is even possible or if there are technical issues with the
flow processing that would prevent it. (I'm a seasoned java programmer,
but haven't dug too deeply into the James inards.)  A few suggestions to
get me started would be great.  (Possibly Corey's code is close to what
I need when I receive it).

Jerry


-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, April 01, 2004 2:41 PM
To: James Users List
Subject: RE: Tracking each piece of mail through the system

> there doesn't appear to be a single routing log that tracks a
> note through ll the processors/matchers/mailets.

The spool manager log.  Turn on DEBUG for it in environment.xml.

	--- Noel

P.S. please don't send HTML e-mails.

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Tracking each piece of mail through the system

Posted by "Noel J. Bergman" <no...@devtech.com>.
> there doesn't appear to be a single routing log that tracks a
> note through ll the processors/matchers/mailets.

The spool manager log.  Turn on DEBUG for it in environment.xml.

	--- Noel

P.S. please don't send HTML e-mails.

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org