You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Soeren Hilmer <so...@tietoenator.com> on 2003/06/20 21:24:20 UTC

Mails expanding (like crazy)

Hi all,

I hope you can help me with the following, we are processing mails with james 
and what we have experienced is that some (not all) mails expand wildly, by 
that I mean:
  A mail (a small one a few kbytes and text only) is sent and it is then 
repeatedly written into the same file in spool, making this file explode to 
several gigabytes in no time.

Now, we have traced this to happen at a ToProcessor shift (which makes sense 
as mails are only written at that time).

Now, we are using several custom made mailets and some of these are using 
constructs like:

service (Mail mail) {
        
    MimeMessage msg = new MimeMessage(...);
    ...
    mail.setMessage (msg);
}

That is a new MimeMessage instance is created and set on the existing Mail 
instance, could this lead to the observed behaviour?. I have noticed that 
none of the official mailets use this construct. 

BTW this is on James 2.1.3.

regards
   Søren

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+ A/S	Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer@tietoenator.com


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


RE: Mails expanding (like crazy)

Posted by "Noel J. Bergman" <no...@devtech.com>.
Glad to hear that you have it sorted out.

> Now back to testing attributes on mail.

Please look for a message sent yesterday from Vincenzo.  He'd like to work
with you on finishing up the mail attributes.  :-)

	--- Noel


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


Re: Mails expanding (like crazy)

Posted by Soeren Hilmer <so...@tietoenator.com>.
Sorted it out. The problem was that the original mimemessage was "attached" to  
the new mimemessage, this behaviour in some circumstances (here I am a little 
on thin ice, cause it did not always happen) led to a self-referencing 
MimeMessage, and storing those leads to the observed behaviour.

I any case James was blameless (JavaMail might not be though ;-))

Regards
  Søren

Now back to testing attributes on mail.



On Monday 23 June 2003 08:04, Søren Hilmer wrote:
> On Saturday 21 June 2003 18:47, Noel J. Bergman wrote:
> > Søren,
> >
> > > A mail (a small one a few kbytes and text only) is sent and it is
> > > then repeatedly written into the same file in spool, making this
> > > file explode to several gigabytes in no time.
> >
> > You are saying that it is not many copies being spooled, but a single
> > spool entry having the same data concatenated over and over and over
> > again in a single message?  What is causing the loop?
>
> That is exacly what I am saying. I do not yet know what is causing the
> loop, I have to build a James version with some more debug information and
> ship it to the customer, who needs to install it ....
>
> > > some of [our custom mailets ] are using:
> > >   MimeMessage msg = new MimeMessage(...);
> > >   ...
> > >   mail.setMessage (msg);
> >
> > AbstractRedirect does the same thing, except on a new, duplicated,
> > instance.
>
> Yes, an the original is ghosted and AbstractRedirect is not in James 2.1.3
>
> > Looking over the code for the file-based message store, the code path for
> > actually storing a message is shared regardless of whether it is a new or
> > old message.
> >
> > Have you made sure that your mailets aren't accidentally concatenating
> > the content?  In the AddFooter mailet, you'll find a section of commented
> > out code that you can use to dump the raw message contents to the log for
> > testing.
>
> I am pretty sure about that, cause my mailets logs on entry and exit, and
> both these apear in the log (and not multiple times), then comes a
> ToProcessor call which never makes it to the destination (last entry in the
> log is a: Servicing Mailxxxxx by ToProcessor Mailet), which would make
> sense as the storing is happening in LinearProcessor when changing
> processor.
>
> I am about to put some extra logs in LinearProcessor, and
> AvalonSpoolRepository/AvalalinMailRepository. I hope this will shed some
> light over things.
>
> > 	--- Noel
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+ A/S	Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer@tietoenator.com


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


Re: Mails expanding (like crazy)

Posted by Søren Hilmer <sh...@itplus.dk>.
On Saturday 21 June 2003 18:47, Noel J. Bergman wrote:
> Søren,
>
> > A mail (a small one a few kbytes and text only) is sent and it is
> > then repeatedly written into the same file in spool, making this
> > file explode to several gigabytes in no time.
>
> You are saying that it is not many copies being spooled, but a single spool
> entry having the same data concatenated over and over and over again in a
> single message?  What is causing the loop?

That is exacly what I am saying. I do not yet know what is causing the loop, I 
have to build a James version with some more debug information and ship it to 
the customer, who needs to install it ....

>
> > some of [our custom mailets ] are using:
> >   MimeMessage msg = new MimeMessage(...);
> >   ...
> >   mail.setMessage (msg);
>
> AbstractRedirect does the same thing, except on a new, duplicated,
> instance.

Yes, an the original is ghosted and AbstractRedirect is not in James 2.1.3


>
> Looking over the code for the file-based message store, the code path for
> actually storing a message is shared regardless of whether it is a new or
> old message.
>
> Have you made sure that your mailets aren't accidentally concatenating the
> content?  In the AddFooter mailet, you'll find a section of commented out
> code that you can use to dump the raw message contents to the log for
> testing.

I am pretty sure about that, cause my mailets logs on entry and exit, and both 
these apear in the log (and not multiple times), then comes a ToProcessor 
call which never makes it to the destination (last entry in the log is a: 
Servicing Mailxxxxx by ToProcessor Mailet), which would make sense as the 
storing is happening in LinearProcessor when changing processor.

I am about to put some extra logs in LinearProcessor, and 
AvalonSpoolRepository/AvalalinMailRepository. I hope this will shed some 
light over things.
 
>
> 	--- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+		Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer@tietoenator.com



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


RE: Mails expanding (like crazy)

Posted by "Noel J. Bergman" <no...@devtech.com>.
Søren,

> A mail (a small one a few kbytes and text only) is sent and it is
> then repeatedly written into the same file in spool, making this
> file explode to several gigabytes in no time.

You are saying that it is not many copies being spooled, but a single spool
entry having the same data concatenated over and over and over again in a
single message?  What is causing the loop?

> some of [our custom mailets ] are using:
>   MimeMessage msg = new MimeMessage(...);
>   ...
>   mail.setMessage (msg);

AbstractRedirect does the same thing, except on a new, duplicated, instance.

Looking over the code for the file-based message store, the code path for
actually storing a message is shared regardless of whether it is a new or
old message.

Have you made sure that your mailets aren't accidentally concatenating the
content?  In the AddFooter mailet, you'll find a section of commented out
code that you can use to dump the raw message contents to the log for
testing.

	--- Noel


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