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 JWM <te...@malcolms.com> on 2006/03/20 17:06:18 UTC

Mail List Mailet Infinite Loop on db failure

I've got a major problem with a mailet.  I have my own custom maillist
mailet that sends to a list located in a database.  It works 98% of the
time.  But twice now, it has gone into an infinite loop.  I get a bunch of
exceptions in the log saying that for some reason it can't get to MySQL.  So
it's apparently failing.  Interesting that it still has no problem pulling
the 800 email addresses from MySQL each time it restarts and resending the
note to most of them before failing.

 

I know I have a MySQL problem and need to figure out what is going on there.
But the more urgent problem is how to guarantee that no matter what kind of
failure occurs, the maillist must terminate and not continually restart and
send the note to each recipient a hundred times.

 

What do I need to do either in the mailet code or in the configuration file
to ensure any failure (with the db or anything else) on this mailet forces a
complete termination of this mail message and guaranteed no restart?

 

Thanks


Re: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
>>> The problem is with mysql connection: fix that
> 
> I agree. But I don't know why it randomly exceeds the limit in the first
> place, and I have no clue how to guarantee 100% that no matter what.. there
> will NEVER be an overrun of the connection pool.  (Don't think it's possible
> to guarantee 100%).
> 
> (Is there an easy way to log/track/plot connection usage in mySQL?)

Do you use the dbcp pooled datasources?

You can tune dbcp parameters (e.g: increase the <max> connections)

       <data-source name="maildb" 
class="org.apache.james.util.dbcp.JdbcDataSource">
          <driver>com.mysql.jdbc.Driver</driver>
          <dburl>jdbc:mysql://127.0.0.1/mail?autoReconnect=true</dburl>
          <user>username</user>
          <password>password</password>
          <max>20</max>
       </data-source>


Stefano


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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
Thanks for the info, Stefano,

I'll verify the mailet code to ensure no connection leaks.  But I'm pretty
sure it's clean.  Also, it is using a different datasource for all of its db
accesses.  And my datasource is having no problem getting connections at the
same time the container is failing.

This mailet runs the same distribution list 100 times correctly and fails
once, then runs another 100 times and fails.  So whatever is causing the
connection pool exhaustion is most likely other activities on the mail
server that accidentally coincide with running this mailet.

>> The problem is with mysql connection: fix that

I agree. But I don't know why it randomly exceeds the limit in the first
place, and I have no clue how to guarantee 100% that no matter what.. there
will NEVER be an overrun of the connection pool.  (Don't think it's possible
to guarantee 100%).

(Is there an easy way to log/track/plot connection usage in mySQL?)

Thanks.

Jerry

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Thursday, March 23, 2006 10:05 AM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

JWM wrote:
> Here is a small segment from my mailet log.  This is the first occurance
of
> the error.  There are hundreds of others below these lines.  This is in
the
> middle of my loop sending the mail to the addresses in the list.

The exception is clear:

> java.io.IOException: java.sql.SQLException: Cannot connect to MySQL
> server on 127.0.0.1:3306. Is there a MySQL server running on the
> machine/port you are trying to connect to? (java.net.BindException)

James cannot connect to MySQL. If it cannot write to DB it cannot 
persist any state to remember not to try again.

The problem is with mysql connection: fix that, you can't fix the loop 
issue in james otherwise.

Furthermore: check JWMMailList sourcecode for db connection leaks 
connections.

Stefano


---------------------------------------------------------------------
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: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
> Here is a small segment from my mailet log.  This is the first occurance of
> the error.  There are hundreds of others below these lines.  This is in the
> middle of my loop sending the mail to the addresses in the list.

The exception is clear:

> java.io.IOException: java.sql.SQLException: Cannot connect to MySQL
> server on 127.0.0.1:3306. Is there a MySQL server running on the
> machine/port you are trying to connect to? (java.net.BindException)

James cannot connect to MySQL. If it cannot write to DB it cannot 
persist any state to remember not to try again.

The problem is with mysql connection: fix that, you can't fix the loop 
issue in james otherwise.

Furthermore: check JWMMailList sourcecode for db connection leaks 
connections.

Stefano


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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
Here is a small segment from my mailet log.  This is the first occurance of
the error.  There are hundreds of others below these lines.  This is in the
middle of my loop sending the mail to the addresses in the list.

Looking closer at this, I notice that James has lost contact with mySQL.
However in between the container exceptions, my queries to the same mySQL
are working just fine.  So where I originally thought this might be mySQL
running out of resources, I now don't think that's the case.


20/03/06 08:50:44 INFO  James.Mailet: JWMMailList:
javax.mail.MessagingException: Exception spooling message: Exception caught
while storing mail Container: java.sql.SQLException: Cannot connect to MySQL
server on 127.0.0.1:3306. Is there a MySQL server running on the
machine/port you are trying to connect to? (java.net.BindException);
  nested exception is:
        class javax.mail.MessagingException: Exception caught while storing
mail Container: java.sql.SQLException: Cannot connect to MySQL server on
127.0.0.1:3306. Is there a MySQL server running on the machine/port you are
trying to connect to? (java.net.BindException)
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: .......Sending to:
xxxx@jeffsautobodyrepair.com -- Sessler, Fran
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (DBQuery)
SELECT * FROM MESSAGETEXT WHERE 1  AND ( LABEL = 'footerhtml' )
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Info)
DBTableObject.executeQuery() - SELECT * FROM MESSAGETEXT WHERE 1  AND (
LABEL = 'footerhtml' )
20/03/06 08:50:44 INFO  James.Mailet: IsInfected: Part:
C:\james_virus_scan\scan\virus2783111342068123183\part43619.tt
20/03/06 08:50:44 INFO  James.Mailet: IsInfected: Part:
C:\james_virus_scan\scan\virus2783111342068123183\part43620.tt
20/03/06 08:50:44 INFO  James.Mailet: IsInfected: exec: "C:\Program
Files\CA\SharedComponents\ScanEngine\Inocmd32.exe" -VER
-LIS:\james_virus_scan\scan\virus2783111342068123183\scanReport.txt
\james_virus_scan\scan\virus2783111342068123183
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Info)
DBTableObject.executeQuery() done <############### my query succeeded ##
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Trace)
recordFound=true
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (DBQuery)
SELECT * FROM MESSAGETEXT WHERE 1  AND ( LABEL = 'footerhtml' )
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Info)
DBTableObject.executeQuery() - SELECT * FROM MESSAGETEXT WHERE 1  AND (
LABEL = 'footerhtml' )
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Info)
DBTableObject.executeQuery() done
20/03/06 08:50:44 INFO  James.Mailet: Mar 20, 2006 8:50:44 AM  (Trace)
recordFound=true
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: New mail - sender:
xxxxxx@journeybf.com, recipients:
[xxxxxxxxxxxxxxxxxxxxall_members-journey@journeybf.com], name:
Mail1142866106148-9536-!912038, remoteHost: JWMHosting, remoteAddr:
64.34.176.28, state: root, lastUpdated: Mon Mar 20 08:48:26 CST 2006,
errorMessage: null
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: Message resent unaltered.
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: recipients set to:
[xxxxxjeffsautobodyrepair.com]
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: apparentlyTo set to:
[xxxx@jeffsautobodyrepair.com]
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: MESSAGE_ID restored to:
<18...@JWMHosting>
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList:
javax.mail.MessagingException: Exception spooling message: Exception caught
while storing mail Container: java.sql.SQLException: Cannot connect to MySQL
server on 127.0.0.1:3306. Is there a MySQL server running on the
machine/port you are trying to connect to? (java.net.BindException);
  nested exception is:
        class javax.mail.MessagingException: Exception caught while storing
mail Container: java.sql.SQLException: Cannot connect to MySQL server on
127.0.0.1:3306. Is there a MySQL server running on the machine/port you are
trying to connect to? (java.net.BindException)
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: Close Connection
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: java.sql.SQLException:
Cannot connect to MySQL server on 127.0.0.1:3306. Is there a MySQL server
running on the machine/port you are trying to connect to?
(java.net.BindException)
20/03/06 08:50:44 INFO  James.Mailet: JWMMailList: JDBCMailLog: Unexpected
exception while closing database connection.
20/03/06 08:50:47 INFO  James.Mailet: RemoteDelivery: Exception delivering
message (Mail1142866106148-9536-!442689-to-austin.rr.com) - IOException
while sending message;
  nested exception is:
        java.io.IOException: java.sql.SQLException: Cannot connect to MySQL
server on 127.0.0.1:3306. Is there a MySQL server running on the
machine/port you are trying to connect to? (java.net.BindException)


-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Wednesday, March 22, 2006 2:02 PM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

JWM wrote:
> I don't have any stack traces.  In the mailet log, it is happily
processing
> through the mail list, then there is an exception saying it can't get
> connection to mySQL.  Then the maillist starts over just like it was a
brand
> new note.  It starts sending to the list again and the same exception
> occurs, etc. etc. until I delete the message from the spool.  The
connection
> problem with mySQL is an issue.  But the biggest concern is to tame this
> infinite loop that results from it or any other possible error.  Once
that's
> done, I'll figure out the mySQL connection problem.

Please post the exact text you get in the logs (about the exception). If 
you don't have the stacktrace at least we can find which line print that 
text!

Stefano


---------------------------------------------------------------------
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: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
> I don't have any stack traces.  In the mailet log, it is happily processing
> through the mail list, then there is an exception saying it can't get
> connection to mySQL.  Then the maillist starts over just like it was a brand
> new note.  It starts sending to the list again and the same exception
> occurs, etc. etc. until I delete the message from the spool.  The connection
> problem with mySQL is an issue.  But the biggest concern is to tame this
> infinite loop that results from it or any other possible error.  Once that's
> done, I'll figure out the mySQL connection problem.

Please post the exact text you get in the logs (about the exception). If 
you don't have the stacktrace at least we can find which line print that 
text!

Stefano


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


Re: Spam Filters

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
Stefano, 

I'm trying to use the mail-abuse.org filters.

It seems this may have changed, it looks like Trend have purchased them.
Can it still be used?

On Wed, 2006-03-22 at 21:05 +0100, Stefano Bagnara wrote:
> > My "spam" processor is configured like so...
> >       <processor name="spam">
> >          <mailet match="All" class="Null"/>
> >          <mailet match="All" class="Bounce"/>
> >          <mailet match="All" class="NotifyPostmaster"/>
> >       </processor>
> > 
> > These don't seem to be blocking anything, nor are they notifying me. Can
> > anyone suggest why?
> 
> The match="All" class="Null" does delete the message.
> The following matches will never be hit.
> 
> Please note that a mailet could set (and most does it) the state of the 
> mail to GHOST and block any further processing.
> Some mailet are configurable to avoid this (via the passThrough attribute).
> 
> Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


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


Re: Spam Filters

Posted by Stefano Bagnara <ap...@bago.org>.
> My "spam" processor is configured like so...
>       <processor name="spam">
>          <mailet match="All" class="Null"/>
>          <mailet match="All" class="Bounce"/>
>          <mailet match="All" class="NotifyPostmaster"/>
>       </processor>
> 
> These don't seem to be blocking anything, nor are they notifying me. Can
> anyone suggest why?

The match="All" class="Null" does delete the message.
The following matches will never be hit.

Please note that a mailet could set (and most does it) the state of the 
mail to GHOST and block any further processing.
Some mailet are configurable to avoid this (via the passThrough attribute).

Stefano


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


Spam Filters

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
Hi,

I'm trying to get the "InSpammerBlacklist" filters to work on the last
release of James.

e.g.
         <mailet match="InSpammerBlacklist=dnsbl.njabl.org"
                 class="ToProcessor">
           <processor> spam </processor>
           <notice>550 Requested action not taken: rejected - see
http://njabl.org/ </notice>
         </mailet>

         <mailet match="InSpammerBlacklist=relays.ordb.org"
                 class="ToProcessor">
           <processor> spam </processor>
           <notice>550 Requested action not taken: rejected - see
http://www.ordb.org/ </notice>
         </mailet>
etc...

My "spam" processor is configured like so...
      <processor name="spam">
         <mailet match="All" class="Null"/>
         <mailet match="All" class="Bounce"/>
         <mailet match="All" class="NotifyPostmaster"/>
      </processor>

These don't seem to be blocking anything, nor are they notifying me. Can
anyone suggest why?
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


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


Re: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
I don't understand how the spoolthreads are able to read new messages 
from the spool but not to write new ones!
They should get connection problems while reading too!?

BTW, I currently solved this scenario by implementing my own mailing 
list mailet (it's not a mailing list but a newsletter with mailmerging 
features) that prepare all the generated mails in a temporary spool and 
then a second mailet takes all the mails from the temporary spool and 
send them.

I did this because I want to be sure that the newsletter start only when 
the full merging has been possible.

My code is not generic enough or generally ready to be committed and 
currently contains too much "private" code to bu published but I have 
plans to publish it in future (read as months/year!?).

The "Store" component let you to lookup for custom repositories (create 
new repositories on the fly).
- The "template message" enter the spool
- A first mailet assign a new Attribute to the message to say what 
repository should be used
- ToProcessor move the message to another processor (the message is 
updated on db only on processor change)
- A mailet start merging the results in the given processor and add a 
mail attribute to say it finished
- ToProcessor move the message to a third processor
- A mailet start moving the messages from the temporary repository to 
the transport repository.

PS: I never used the list managers included in James because I need 
mailmerging.

Hope this help.

Stefano

JWM wrote:
> I really appreciate all the time you've spent explaining/assisting me in
> this.
> 
> What is happening in my scenario is that it the maillist gets part way into
> sending emails to the list members, then the failure occurs and it aborts.
> But it immediately restarts and starts sending from the top of the list
> again.  It fails again part way through the list, and restarts.  If the mail
> went out at night or when I can't be contacted, this just keeps repeating
> forever until somebody realizes it's gone crazy and notifies me, and can get
> to a place to log in to the server and stop it.  Once it starts, it will not
> recover on its own.  It appears that some random situation first puts it
> over the edge, but continually restarting the maillist ends up stressing the
> connection pool enough to make it feed on itself and never recover.  When I
> stopped the server, I had about 1500 emails in the spool table (the original
> source email + all the individual ones I had sent).  I just wiped these out
> of the db to recover.
> 
> The recipient at the top of the list gets flooded.  The last recipient in
> the list likely never got the email at all.



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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
I really appreciate all the time you've spent explaining/assisting me in
this.

What is happening in my scenario is that it the maillist gets part way into
sending emails to the list members, then the failure occurs and it aborts.
But it immediately restarts and starts sending from the top of the list
again.  It fails again part way through the list, and restarts.  If the mail
went out at night or when I can't be contacted, this just keeps repeating
forever until somebody realizes it's gone crazy and notifies me, and can get
to a place to log in to the server and stop it.  Once it starts, it will not
recover on its own.  It appears that some random situation first puts it
over the edge, but continually restarting the maillist ends up stressing the
connection pool enough to make it feed on itself and never recover.  When I
stopped the server, I had about 1500 emails in the spool table (the original
source email + all the individual ones I had sent).  I just wiped these out
of the db to recover.

The recipient at the top of the list gets flooded.  The last recipient in
the list likely never got the email at all.

Thanks again for all the help.

Jerry

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Thursday, March 23, 2006 11:15 AM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

JWM wrote:
> If my proposal above for my own code sounds reasonable, then so be it.  I
> have no problem writing it.  I just want to know if that is my only/best
> solution for guaranteeing 100% that never more than 1 copy of the email is
> sent.  (I'll accept 0 or 1 copy being sent.  The sender can resend if
> necessary).

This is not how SMTP works: SMTP grant the messages will be sent at 
least once.

There's no way to be sure you send a message a single time in SMTP: the 
most common "hole" is in the time between the receiving server say it 
has accepted the message and the client acknowledge this fact. If 
anything happens in that moment the message is resent (by specification).

Apart RFC consideratons you should write your own code to protect from 
this behaviour. Your solution seems acceptable given your specifications.

BTW I didn't understand your exact scenario: I've had sql problems in 
past but I never had James looping with thousands of duplicated messages 
sent.

Stefano


---------------------------------------------------------------------
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: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
> If my proposal above for my own code sounds reasonable, then so be it.  I
> have no problem writing it.  I just want to know if that is my only/best
> solution for guaranteeing 100% that never more than 1 copy of the email is
> sent.  (I'll accept 0 or 1 copy being sent.  The sender can resend if
> necessary).

This is not how SMTP works: SMTP grant the messages will be sent at 
least once.

There's no way to be sure you send a message a single time in SMTP: the 
most common "hole" is in the time between the receiving server say it 
has accepted the message and the client acknowledge this fact. If 
anything happens in that moment the message is resent (by specification).

Apart RFC consideratons you should write your own code to protect from 
this behaviour. Your solution seems acceptable given your specifications.

BTW I didn't understand your exact scenario: I've had sql problems in 
past but I never had James looping with thousands of duplicated messages 
sent.

Stefano


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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
The way you've explained it, it also makes perfect sense to me.  But even
thought it makes sense, that's little consolation when every member of the
distribution list gets 1000 copies of the same email before I can be
contacted, log on, and kill the server.

The error (see log dump in my post from yesterday) appears to be the maildb
datasource has run out of connections.  Ok, I can increase the number of
connections in the datasource def.  That may reduce the chance of this
problem.  But it's not going to eliminate it.  No matter how high I set the
connection pool, there will always be the possibility that in some
situation, it will be exceeded.

I would almost prefer the server completely die in this case.  I'd have to
log on and restart the server.  But at least 1000 copies of the email
wouldn't go out in the meantime.

>From what I think you are saying, it's working as designed.  Granted, I have
written my own custom maillist mailet.  But I'm curious if the shipped
maillist mailet wouldn't have the same potential catastrophic problem.

Is the only hope for me going to be to write defensive code in my mailet?
i.e. 

	1) create some unique signature for the message
	2) store the fact that I've started processing this message in my
own db table
	3) ONLY process the list if:
		a) I can successfully query the table and determine this
signature isn't already there
		b) I can successfully write this signature to the db
	4) Otherwise, abort this list

This isn't going to solve the problem that the message is still going to be
in the infinite loop on the spool.  But at least it's a dormant loop.

If my proposal above for my own code sounds reasonable, then so be it.  I
have no problem writing it.  I just want to know if that is my only/best
solution for guaranteeing 100% that never more than 1 copy of the email is
sent.  (I'll accept 0 or 1 copy being sent.  The sender can resend if
necessary).

Thanks.

Jerry

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Wednesday, March 22, 2006 2:09 PM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

JWM wrote:
> Maybe I'm at the wrong level of discussion.  When the exception occurs, my
> mailet exits.  The mailet is the last thing in the processor.  So 'ending'
> the processor and 'continuing' the processor when this is the last step
> would basically be the same thing, right?  It still comes back to whether
or
> not the message gets left on the spool and starts over.
> 
> Can you clarify this for me?

If it throws the exception while updating the mail in the repository 
then it will never update the state of the message to say it must be 
moved to another processor and the next thread will take the same 
message to be processed.

Basically if you have problems while persisting the fact that the 
message should not be retried it will retry it again and again: It makes 
perfect sense to me.

Stefano


---------------------------------------------------------------------
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: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
> Maybe I'm at the wrong level of discussion.  When the exception occurs, my
> mailet exits.  The mailet is the last thing in the processor.  So 'ending'
> the processor and 'continuing' the processor when this is the last step
> would basically be the same thing, right?  It still comes back to whether or
> not the message gets left on the spool and starts over.
> 
> Can you clarify this for me?

If it throws the exception while updating the mail in the repository 
then it will never update the state of the message to say it must be 
moved to another processor and the next thread will take the same 
message to be processed.

Basically if you have problems while persisting the fact that the 
message should not be retried it will retry it again and again: It makes 
perfect sense to me.

Stefano


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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
That's where I get very confused.  It says the default action is "error".
>From the text you quoted, that would imply that the default reaction to an
exception in the mailet would mean it would not requeue it.  But that WAS my
configuration, and it continually requeued it.  So I'm confused.  

Just for completeness of my understanding of this, what would the
configuration be if I DID want to requeue and start over. 

I don't know the details of the all the flows.  All I know is when I throw
an exception, I'm in an infinite loop by default.  Coding it to the default
of "error" doesn't seem like it's going to make any difference.  

It appears to me that either the default is not "error" or the documentation
of "error" that says it won't re-queue is in error.

Maybe I'm at the wrong level of discussion.  When the exception occurs, my
mailet exits.  The mailet is the last thing in the processor.  So 'ending'
the processor and 'continuing' the processor when this is the last step
would basically be the same thing, right?  It still comes back to whether or
not the message gets left on the spool and starts over.

Can you clarify this for me?

Thanks.

Jerry

-----Original Message-----
From: Vincenzo Gianferrari Pini [mailto:vincenzo.gianferraripini@praxis.it] 
Sent: Wednesday, March 22, 2006 3:01 AM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

onMailetException="error" sends the message to the error processor, which
(in the default config.xml) stores the message in <repositoryPath>
file://var/mail/error/</repositoryPath> and ghosts it (will stop). This is
what you may want.

If you code onMailetException="ignore" the message will ignore the exception
and continue in the current processor.

Vincenzo



JWM wrote:

>Thanks for the wiki info.  I read over it.  It doesn't completely explain
>what the default [onMailetException="error"] does.  But I can assume that
>the philosophy of "error" is to just re-queue the message and start over.
>Is that correct?  At least that is what it appears to be doing for me now.
>If so, I assume that if I say "ignore", the email message will simply
>terminate and NOT be re-queued, which is what I want. Have I got it
correct?
>
>I don't have any stack traces.  In the mailet log, it is happily processing
>through the mail list, then there is an exception saying it can't get
>connection to mySQL.  Then the maillist starts over just like it was a
brand
>new note.  It starts sending to the list again and the same exception
>occurs, etc. etc. until I delete the message from the spool.  The
connection
>problem with mySQL is an issue.  But the biggest concern is to tame this
>infinite loop that results from it or any other possible error.  Once
that's
>done, I'll figure out the mySQL connection problem.
>
>Thanks.
>
>Jerry
>
>-----Original Message-----
>From: Stefano Bagnara [mailto:apache@bago.org] 
>Sent: Tuesday, March 21, 2006 4:33 AM
>To: James Users List
>Subject: Re: Mail List Mailet Infinite Loop on db failure
>
>JWM wrote:
>  
>
>>What do I need to do either in the mailet code or in the configuration
>>    
>>
>file
>  
>
>>to ensure any failure (with the db or anything else) on this mailet forces
>>    
>>
>a
>  
>
>>complete termination of this mail message and guaranteed no restart?
>>    
>>
>
>Have you any stacktrace of the problem?
>
>Depending on the problem this could help:
>http://wiki.apache.org/james/HandlingExceptions
>
>Stefano
>
>
>---------------------------------------------------------------------
>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


Re: Mail List Mailet Infinite Loop on db failure

Posted by Vincenzo Gianferrari Pini <vi...@praxis.it>.
onMailetException="error" sends the message to the error processor, which (in the default config.xml) stores the message in <repositoryPath> file://var/mail/error/</repositoryPath> and ghosts it (will stop). This is what you may want.

If you code onMailetException="ignore" the message will ignore the exception and continue in the current processor.

Vincenzo



JWM wrote:

>Thanks for the wiki info.  I read over it.  It doesn't completely explain
>what the default [onMailetException="error"] does.  But I can assume that
>the philosophy of "error" is to just re-queue the message and start over.
>Is that correct?  At least that is what it appears to be doing for me now.
>If so, I assume that if I say "ignore", the email message will simply
>terminate and NOT be re-queued, which is what I want. Have I got it correct?
>
>I don't have any stack traces.  In the mailet log, it is happily processing
>through the mail list, then there is an exception saying it can't get
>connection to mySQL.  Then the maillist starts over just like it was a brand
>new note.  It starts sending to the list again and the same exception
>occurs, etc. etc. until I delete the message from the spool.  The connection
>problem with mySQL is an issue.  But the biggest concern is to tame this
>infinite loop that results from it or any other possible error.  Once that's
>done, I'll figure out the mySQL connection problem.
>
>Thanks.
>
>Jerry
>
>-----Original Message-----
>From: Stefano Bagnara [mailto:apache@bago.org] 
>Sent: Tuesday, March 21, 2006 4:33 AM
>To: James Users List
>Subject: Re: Mail List Mailet Infinite Loop on db failure
>
>JWM wrote:
>  
>
>>What do I need to do either in the mailet code or in the configuration
>>    
>>
>file
>  
>
>>to ensure any failure (with the db or anything else) on this mailet forces
>>    
>>
>a
>  
>
>>complete termination of this mail message and guaranteed no restart?
>>    
>>
>
>Have you any stacktrace of the problem?
>
>Depending on the problem this could help:
>http://wiki.apache.org/james/HandlingExceptions
>
>Stefano
>
>
>---------------------------------------------------------------------
>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


Re: Using Gmail as Filter

Posted by Stefano Bagnara <ap...@bago.org>.
No, I only use GMail as a backup, not filter.
BTW, it should be feasible.

Alice K wrote:
> Hi,
> 
> Anyone has tried or know how to configure James server to use Gmail as 
> filter as described in the blog
> 
> http://mboffin.com/post.aspx?id=1636
> 
> Thanks,
> 
> Alice


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


Using Gmail as Filter

Posted by Alice K <al...@hotmail.com>.
Hi,

Anyone has tried or know how to configure James server to use Gmail as 
filter as described in the blog

http://mboffin.com/post.aspx?id=1636

Thanks,

Alice



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


RE: Mail List Mailet Infinite Loop on db failure

Posted by JWM <te...@malcolms.com>.
Thanks for the wiki info.  I read over it.  It doesn't completely explain
what the default [onMailetException="error"] does.  But I can assume that
the philosophy of "error" is to just re-queue the message and start over.
Is that correct?  At least that is what it appears to be doing for me now.
If so, I assume that if I say "ignore", the email message will simply
terminate and NOT be re-queued, which is what I want. Have I got it correct?

I don't have any stack traces.  In the mailet log, it is happily processing
through the mail list, then there is an exception saying it can't get
connection to mySQL.  Then the maillist starts over just like it was a brand
new note.  It starts sending to the list again and the same exception
occurs, etc. etc. until I delete the message from the spool.  The connection
problem with mySQL is an issue.  But the biggest concern is to tame this
infinite loop that results from it or any other possible error.  Once that's
done, I'll figure out the mySQL connection problem.

Thanks.

Jerry

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Tuesday, March 21, 2006 4:33 AM
To: James Users List
Subject: Re: Mail List Mailet Infinite Loop on db failure

JWM wrote:
> What do I need to do either in the mailet code or in the configuration
file
> to ensure any failure (with the db or anything else) on this mailet forces
a
> complete termination of this mail message and guaranteed no restart?

Have you any stacktrace of the problem?

Depending on the problem this could help:
http://wiki.apache.org/james/HandlingExceptions

Stefano


---------------------------------------------------------------------
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: Mail List Mailet Infinite Loop on db failure

Posted by Stefano Bagnara <ap...@bago.org>.
JWM wrote:
> What do I need to do either in the mailet code or in the configuration file
> to ensure any failure (with the db or anything else) on this mailet forces a
> complete termination of this mail message and guaranteed no restart?

Have you any stacktrace of the problem?

Depending on the problem this could help:
http://wiki.apache.org/james/HandlingExceptions

Stefano


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