[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    Re: Resending email from a DB repository.
From:       Max Levinson <max.levinson () gmail ! com>
Date:       2010-08-31 16:25:56
Message-ID: AANLkTikOF-ffqEPjpHpHogcY2Q2mED1mkbRrn5zvhTu6 () mail ! gmail ! com
[Download RAW message or body]


Hi Eric,

I've tested it, and it is not exactly what I wanted from this mailet.

And I also found a couple of weird problems:

1. When you type this in spoolmanager.xml

 <processor name="spam">
  <mailet match="All" class="ToRepository">
   <repositoryPath>db://maildb/messages/spam/</repositoryPath>
   <passThrough>true</passThrough>
  </mailet>
  <mailet match="RecipientIs=sales@domain.com" class="FromRepository">
  <repositoryPath>db://maildb/messages/spam</repositoryPath>
  <processor> transport</processor>
  <delete>true</delete>
 </mailet>
 </processor>


It seems it's not only pushes emails matched by this matcher (RecipientIs=
sales@domain.com) but the rest of emails as well.

Second problem is when spam is caught and it suppose to go to spam
repository and it not matches the matcher is not hold in spam repository
anymore but instead passed through to transport :(

So what I am trying to achieve here, let's imagine I have a portal where
user can see his spam repository, user decided to release a message,he is
choosing a message and clicks release on a portal.

Then I need to give James and idea in real time that this message should be
pushed to transport processor for further delivery(I can generate a config
entry which will have a matcher SubjectIs with a subject which should be
released). I don't think that the matcher RecipientIs will work for me here,
because there still can be other messages which user don't want to release
from spam repository which has the same recipient, will matcher like
SubjectIs will work in this case?

Can I achieve what I need in current James trunk?

Please help, I am got stuck for more then a month on this :( And this is
what my users and boss want desperately.



2010/8/27 Eric Charles <eric@apache.org>

>  Oops,
>
> It's not
>
>   <passTrough>true</passTrough>
>
> but
>
>   <passThrough>true</passThrough>
>
> (with a h between T and r...)
>
> Sorry, my fault,
>
> Eric
>
>
>
> On 25/08/2010 14:40, Max Levinson wrote:
>
>> Yes, I am absolutely sure that message is getting caught by SpamAssassin,
>> I
>> am adding a special subject to the message which is getting caught by
>> spamassassin. I am not sure why it's not shown in this log but message is
>>
>> getting caught by spamassassin.
>>
>> ClamAV puts messages in other repository (called virus).
>>
>> 2010/8/25 Eric Charles<eric@apache.org>
>>
>>
>>   Hi Max,
>>>
>>>  From the log, it seems that CLAMD mailet is executed, but not
>>> SpamAssassin.
>>> Are you sure mail is passing via
>>>
>>>
>>>  <mailet
>>> match="HasMailAttributeWithValue=org.apache.james.spamassassin.flag, YES"
>>> class="ToProcessor">
>>>   <processor>spam</processor>
>>>  </mailet>
>>>
>>> and is redirected to the spam processor ?
>>>
>>> Log shows that mail is stored in db://maildb/messages/spam/, but is it
>>> the
>>> one of "spam" processor ?
>>>
>>> I also don't see the "...
>>>
>>> ...reached the end of this processor, and is automatically deleted.  This
>>> may
>>> indicate a configuration error."
>>>
>>>
>>> So I wonder if it really goes there?
>>>
>>> I will also retest, but it was working at my side (it was reprocessing
>>> from
>>> spam)
>>>
>>> Tks,
>>>
>>> Eric
>>>
>>> PS: I also use James 3 from trunk
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 25/08/2010 13:51, Max Levinson wrote:
>>>
>>>  Hi Eric,
>>>>
>>>> Unfortunately configuration which you've suggested is not working for
>>>> me(just a reminder I am on James 3 from trunk):
>>>>
>>>>
>>>>  <processor name="spam">
>>>>   <mailet match="All" class="ToRepository">
>>>>    <repositoryPath>db://maildb/messages/spam/</repositoryPath>
>>>>    <passTrough>true</passTrough>
>>>>   </mailet>
>>>>   <mailet match="RecipientIs=sales@domain.com" class="FromRepository">
>>>>    <repositoryPath>db://maildb/messages/spam</repositoryPath>
>>>>    <processor>transport</processor>
>>>>    <delete>true</delete>
>>>>   </mailet>
>>>>  </processor>
>>>>
>>>>
>>>> This is what I am getting in the logs (message is getting caught by
>>>> spamassassin and it put it into spam repository but FromRepository is
>>>> not
>>>> working after that)
>>>>
>>>> DEBUG 11:31:20,897 | james.smtpserver | Lookup command handler for
>>>> command:
>>>> DATA
>>>> DEBUG 11:31:21,089 | james.smtpserver | executing james message handler
>>>> org.apache.james.protocols.smtp.core.esmtp.MailSizeEsmtpExtension@a9f827
>>>> DEBUG 11:31:21,092 | james.smtpserver | executing james message handler
>>>> org.apache.james.smtpserver.AddDefaultAttributesMessageHook@8ce0ea
>>>> DEBUG 11:31:21,104 | james.smtpserver | executing james message handler
>>>> org.apache.james.smtpserver.SendMailHandler@1023565
>>>> DEBUG 11:31:21,106 | james.smtpserver | sending mail
>>>> INFO  11:31:22,217 | james.smtpserver | Successfully spooled mail
>>>> Mail1282735881052-1 from max.levinson@gmail.com on 209.85.214.182 for [
>>>> sales@domain.com]
>>>> INFO  11:31:22,538 | james.mailetcontext | OK (by CLAMD on localhost/
>>>> 127.0.0.1)
>>>> INFO  11:31:31,062 | james.mailetcontext | Storing mail
>>>> Mail1282735881052-1
>>>> in db://maildb/messages/spam/
>>>> DEBUG 11:31:52,383 | james.smtpserver | Lookup command handler for
>>>> command:
>>>> QUIT
>>>>
>>>>
>>>> 2010/8/24 Eric Charles<eric@apache.org>
>>>>
>>>>   Hi Max,
>>>>
>>>>> If you define the FromRepository before the ToRepository(spam), the
>>>>> mail
>>>>> will not reside in the spam repo, so it will be not retrieved during
>>>>> the
>>>>> processing of itself (probably well retrieved during the processing of
>>>>> the
>>>>> following one).
>>>>>
>>>>> Moreover, you have to define<passThrough>true</passThrough>   in the
>>>>> mailet
>>>>> in your spam processor. This is used to say James to not "Ghost" the
>>>>> mail
>>>>> and to continue its processing.
>>>>>
>>>>> This gives use:
>>>>>
>>>>>
>>>>> <processor name="root">
>>>>>  <mailet nomatch="SenderHostIsLocal" class="SpamAssassin">
>>>>>   <spamdHost>localhost</spamdHost>
>>>>>   <spamdPort>783</spamdPort>
>>>>>  </mailet>
>>>>>  <mailet
>>>>> match="HasMailAttributeWithValue=org.apache.james.spamassassin.flag,
>>>>> YES"
>>>>> class="ToProcessor">
>>>>>   <processor>spam</processor>
>>>>>  </mailet>
>>>>> </processor>
>>>>>
>>>>>
>>>>>  <processor name="spam">
>>>>>  <mailet match="All" class="ToRepository">
>>>>>   <repositoryPath>db://maildb/messages/spam/</repositoryPath>
>>>>>   <passTrough>true</passTrough>
>>>>>  </mailet>
>>>>>  <mailet match="RecipientIs=sales@domain.com" class="FromRepository">
>>>>>
>>>>>  <repositoryPath>db://maildb/messages/spam</repositoryPath>
>>>>>  <processor>    transport</processor>
>>>>>  <delete>true</delete>
>>>>>  </mailet>
>>>>>  </processor>
>>>>>
>>>>> I didn't test that exact configuration, but an equivalent one.
>>>>>
>>>>> If you leave like that, the sales@domain.com should be reprocessed by
>>>>> the
>>>>> transport processor.
>>>>> You will have for the other spams a message such as:
>>>>> WARN  19:55:14,752 | james.spoolmanager | Message Mail1282672514625-3
>>>>> reached the end of this processor, and is automatically deleted.  This
>>>>> may
>>>>> indicate a configuration error.
>>>>>
>>>>> If you don't like it, you may add
>>>>>
>>>>> <mailet match="All" class="Null"/>
>>>>>
>>>>> after the FromRepository mailet.
>>>>>
>>>>> Tks,
>>>>>
>>>>> Eric
>>>>>
>>>>>
>>>>>
>>>>> On 24/08/2010 12:54, Max Levinson wrote:
>>>>>
>>>>>  It is currently in a root processor.
>>>>>
>>>>>>  <processor name="root">
>>>>>>   <mailet nomatch="SenderHostIsLocal" class="SpamAssassin">
>>>>>>    <spamdHost>localhost</spamdHost>
>>>>>>    <spamdPort>783</spamdPort>
>>>>>>   </mailet>
>>>>>>   <mailet
>>>>>> match="HasMailAttributeWithValue=org.apache.james.spamassassin.flag,
>>>>>> YES"
>>>>>> class="ToProcessor">
>>>>>>    <processor>spam</processor>
>>>>>>   </mailet>
>>>>>>   <mailet match="RecipientIs=sales@domain.com"
>>>>>> class="FromRepository">
>>>>>>
>>>>>>   <repositoryPath>db://maildb/messages/spam</repositoryPath>
>>>>>>   <processor>    transport</processor>
>>>>>>   <delete>true</delete>
>>>>>>   </mailet>
>>>>>> </processor>
>>>>>>
>>>>>>
>>>>>>  <processor name="spam">
>>>>>>   <mailet match="All" class="ToRepository">
>>>>>>    <repositoryPath>db://maildb/messages/spam/</repositoryPath>
>>>>>>   </mailet>
>>>>>>  </processor>
>>>>>>
>>>>>> They way I see it is if message is already in spam repository and
>>>>>> recipient
>>>>>> is sales@domain.com or any other matcher triggering it,
>>>>>> FromRepository
>>>>>> mailet moves this email to transport processor, sort of release.
>>>>>>
>>>>>> Does it make sense, but unfortunately it is not working :(
>>>>>>
>>>>>> Maybe I do something wrong, and you need to use FromRepository mailet
>>>>>> in
>>>>>> different way?
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>>> 2010/8/24 Eric Charles<eric@apache.org>
>>>>>>
>>>>>>
>>>>>>   Hi Max,
>>>>>>
>>>>>>  In which processor (root, transport, spam ?) did you put the
>>>>>>> FromRepository
>>>>>>> mailet.
>>>>>>> I never used it, but I would put it just after the ToRepository in
>>>>>>> spam.
>>>>>>>
>>>>>>> If it still doesn't work at your side, I will give it a try.
>>>>>>> Tell me...
>>>>>>>
>>>>>>> Tks,
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 23/08/2010 10:59, Max Levinson wrote:
>>>>>>>
>>>>>>>  Hi guys, can anyone help on this?
>>>>>>>
>>>>>>>  2010/8/19 Max Levinson<max.levinson@gmail.com>
>>>>>>>>
>>>>>>>>
>>>>>>>>  Hi Norman,
>>>>>>>>
>>>>>>>>  I just got achance to test it, as you know I am on James 3 from
>>>>>>>>
>>>>>>>>> trunk.
>>>>>>>>>
>>>>>>>>> Have anyone actually tried this mailet with James 3.
>>>>>>>>>
>>>>>>>>> It's not working for me, unfortunately.
>>>>>>>>>
>>>>>>>>>   <mailet match="RecipientIs=max@max.com" class="FromRepository">
>>>>>>>>>   <repositoryPath>db://maildb/messages/spam</repositoryPath>
>>>>>>>>>   <processor>     transport</processor>
>>>>>>>>>   <delete>true</delete>
>>>>>>>>>   </mailet>
>>>>>>>>>
>>>>>>>>> It says in the logs that mailet was initialised, but it's not
>>>>>>>>> resending
>>>>>>>>> email.
>>>>>>>>>
>>>>>>>>> What can be the problem?
>>>>>>>>>
>>>>>>>>> 2010/8/16 Norman Maurer<norman@apache.org>
>>>>>>>>>
>>>>>>>>> Hi Max,
>>>>>>>>>
>>>>>>>>>  check the FromRepository Mailet...
>>>>>>>>>
>>>>>>>>>  http://james.apache.org/server/2.3.2/provided_mailets.html
>>>>>>>>>>
>>>>>>>>>> Bye,
>>>>>>>>>> Norman
>>>>>>>>>>
>>>>>>>>>> 2010/8/16 Max Levinson<max.levinson@gmail.com>:
>>>>>>>>>>
>>>>>>>>>>  Hi guys,
>>>>>>>>>>
>>>>>>>>>>  I have a situation which requires your help, I have this DB
>>>>>>>>>>> repository:
>>>>>>>>>>>
>>>>>>>>>>>  <processor name="spam">
>>>>>>>>>>>  <mailet match="All" class="ToRepository">
>>>>>>>>>>>   <repositoryPath>db://maildb/messages/spam/</repositoryPath>
>>>>>>>>>>>  </mailet>
>>>>>>>>>>>  </processor>
>>>>>>>>>>>
>>>>>>>>>>> All spam goes here, what if a user will decide to release a
>>>>>>>>>>> message
>>>>>>>>>>> from
>>>>>>>>>>> this repository(let's say release), how this can be achieved.
>>>>>>>>>>>
>>>>>>>>>>> Maybe there is a mailet which can resend a message from
>>>>>>>>>>> repository?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>>  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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  ---------------------------------------------------------------------
>>>>>>>
>>>>>> 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
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic