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 Chris Hane <ch...@itsolut.com> on 2005/04/13 21:57:39 UTC

Re: Serious bandwidth begin consumed by James

I have a little more information on an issue that crops up every once in 
a while.  Basically, james gets in a loop with another email server and 
consumes all of the bandwidth we have (3Mbps) until I shut james down 
and remove the outgoing emails.

The loop happened again today and this time I was able to isolate the 
email message that was causing the issue.  The email has a large 
attachment and is about 40GB large (yes I have to allow for large 
attachments as one of my clients is a graphics firm...).  I actually 
saved it for some further testing....

What I think is happening though is the other server that james is 
trying to send to is not allowing for such a large message and is just 
terminating the connection.

It appears that james takes the termination as a network error and 
retries immediately (and gets itself into a loop).  Has anyone else seen 
this type of issue?  Any solutions?  I'm even willing to work through 
some of the james code if I could get a pointer or two with which 
classes to start with in my debugging attempts.

Should I ask on the dev list instead.....

Thanks in advance,
Chris....



Chris Hane wrote:

>
> I have been running james for a couple of months now without incident. 
> We send/receive around 50MB / day of email through james.  All of a 
> sudden we spiked to around 1.2 GB / hour (that is correct 1.2 GB / 
> hour) and it was steady traffic over days.
>
> We measured this using ntop and the ISP confirmed with measurements at 
> their switch.  I finally tracked it down to James.  When I stopped 
> James, the traffic stopped.  When I started James, the traffic started 
> again.
>
> I set all of the logging to DEBUG.  When I started the James server 
> and the traffic picked back up (instantly), none of the logs were 
> growing.     The entries being added were in the 1-2 message / minute 
> and not enough to account for 1.2GB/hour.
>
> After a some experimenting, I found there were about 20-30 messages in 
> the /var/mail/outgoing directory.  The oldest one had a date of 3 days 
> ago and most were from today.  Also, the largest outgoing email was 
> less than 100Kb.
>
> When I deleted these messages and restarted James, the traffic did not 
> pick back up and remained at normal levels (at least for the last two 
> hours).
>
> I know I'm probably not providing enough information to troubleshoot 
> this effectively.  I have a couple of questions though to try and help 
> me track this down if it occurs again:
>
> 0. Actually, does anyone have any suggestions?
> 1. Is there logging I can turn on for the outgoing retries?
> 2. Rather than delete the outgoing emails again, is there some other 
> action I should take to try and isolate this?
> 3. I installed James because we are a java shop.  If someone can point 
> me to a section of code that deals with the outgoing email directory I 
> can try to look through the code the next time it happens and even 
> install a debug version of james to try to catch the error.
>
> Thanks for your help/suggestions in advance.
> Chris....
>
> P.S.  Here is my configuration info:
> James 2.2.0
> Using the file system store
> Usage Mysql 4.1 for JDBCVirtualUsers
> JDK 1.5.0-b64
> Linux 2.4.28
> Dual PIII
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.300 / Virus Database: 265.8.1 - Release Date: 1/27/2005
>  
>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005


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


RE: Serious bandwidth begin consumed by James

Posted by "Noel J. Bergman" <no...@devtech.com>.
The other server SHOULD return an error code, as JAMES does, if it is
rejecting the message based on size.  If it is simply hanging up, we might
try the next target server, if there is one.

	--- Noel


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


Re: Serious bandwidth begin consumed by James

Posted by Serge Knystautas <se...@lokitech.com>.
Chris Hane wrote:
> What I think is happening though is the other server that james is 
> trying to send to is not allowing for such a large message and is just 
> terminating the connection.
> 
> It appears that james takes the termination as a network error and 
> retries immediately (and gets itself into a loop).  Has anyone else seen 
> this type of issue?  Any solutions?  I'm even willing to work through 
> some of the james code if I could get a pointer or two with which 
> classes to start with in my debugging attempts.

What version are you running?  I can't think of how our error handling 
would try to immediately resend without incrementing the attempt 
counter.  Maybe it's an old version with a bug that's since been fixed.

-- 
Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com

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


Re: Serious bandwidth begin consumed by James

Posted by ap...@bago.org.
> If I figure anything else by looking at the code Stefano 
> pointed me to, I'll report back.

Have you configured a <bounceProcessor> tag in the RemoteDelivery?
How does it looks like?

Look at the first lines of the message in the outgoing: what is the address
in the "Return-path: " line?
Try sending an email to this address: does it work?

Stefano


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


Re: Serious bandwidth begin consumed by James

Posted by Chris Hane <ch...@itsolut.com>.
I'm running 2.2.0 (I'm assuming that's the latest stable version).

I'm just guessing at the reason for the loop based on my observations.  
I actually did not have time to try and research the issue today as my 
ISP wanted me to resolve it quickly (3Mbps is a bit of bandwidth to 
consume for about 4 hours continuously).  I have the var/mail/outgoing 
files that relate to the message if there could be anything in them that 
would help.

If I figure anything else by looking at the code Stefano pointed me to, 
I'll report back.

Thanks,
Chris....


Serge Knystautas wrote:

> Chris Hane wrote:
>
>> What I think is happening though is the other server that james is 
>> trying to send to is not allowing for such a large message and is 
>> just terminating the connection.
>>
>> It appears that james takes the termination as a network error and 
>> retries immediately (and gets itself into a loop).  Has anyone else 
>> seen this type of issue?  Any solutions?  I'm even willing to work 
>> through some of the james code if I could get a pointer or two with 
>> which classes to start with in my debugging attempts.
>
>
> What version are you running?  I can't think of how our error handling 
> would try to immediately resend without incrementing the attempt 
> counter.  Maybe it's an old version with a bug that's since been fixed.
>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005


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


RE: Serious bandwidth begin consumed by James

Posted by "Noel J. Bergman" <no...@devtech.com>.
Check your configuration for any unintentional loop.  RemoteDelivery says
that it is failing this message permanently.

	--- Noel


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


Re: Serious bandwidth begin consumed by James

Posted by ap...@bago.org.
> I did a little digging in the logs and I was able to find 
> these repeated log entries in the mailet-* logs (I removed 
> the actual email address/dns info to protect the innocent):

It seems the same message that once failed bounces and resend again. This is
really strange.
RemoteDelivery, after it says "Sending failure...":

log("Sending failure message " + mail.getName());
        try {
            getMailetContext().bounce(mail, sout.toString()); 

Will call MailetContext.bounce. James.java, bounce():

        if (mail.getSender() == null) {
            if (getLogger().isInfoEnabled())
                getLogger().info("Mail to be bounced contains a null (<>)
reverse path.  No bounce will be sent.");
            return;
        } else {
            // Bounce message goes to the reverse path, not to the Reply-To
address
            if (getLogger().isInfoEnabled())
                getLogger().info("Processing a bounce request for a message
with a reverse path of " + mail.getSender().toString());
            reply.setRecipient(MimeMessage.RecipientType.TO,
mail.getSender().toInternetAddress());
        }
 
You should find a log containing one of these 2 logs "Mail to be bounce
contains" or "Processing a bounce request"... Please find that log and tell
us what you find.

But I think I found the problem: the bounce created has the full message as
attachment and so it is bigger than the original. The domain.here.com refuse
big messages as like the graphicsbyheather.com server so the message keeps
bouncing.
This is a problem in the current 2.2.0. I rememeber something fixed about
return-path handling in the current 2_1_fcs branch. You should try upgrading
to "2.2.1dev" (branch 2_1_fcs in current subversion). This should be fixed.

Alternatively you probably can fix this by adding a <bounceProcessor> tag
like described in this JIRA issue:
http://issues.apache.org/jira/browse/JAMES-357

The bug will be still there but the bounce will be created by DSNBounce
instead of the MailetContext and I think that DSNBounce will correctly set
the return-path of the bounce to "<>". You can even configure the DSNBounce
with the option <attachment>none</attachment> so that the bounce will not
contain the original message!


> mailet-2005-04-13-00-01.log:13/04/05 14:10:28 INFO  James.Mailet: 
> RemoteDelivery: Attempting delivery of Mail1113353072629-556 
> 45-to-graphicsbyheather.com to host mx.domain.here.com. at 
> 217.160.230.10 to addresses [someuser@domain.here.com]
> mailet-2005-04-13-00-01.log:13/04/05 14:13:38 INFO  James.Mailet: 
> RemoteDelivery: Exception delivering message (Mail1113353072
> 629-55645-to-domain.here.com) - 552 message too large
> mailet-2005-04-13-00-01.log:13/04/05 14:13:38 INFO  James.Mailet: 
> RemoteDelivery: Permanent exception delivering mail (Mail111
> 3353072629-55645-to-domain.here.com: 
> javax.mail.MessagingException: 552 message too large
> mailet-2005-04-13-00-01.log:13/04/05 14:13:44 INFO  James.Mailet: 
> RemoteDelivery: Sending failure message Mail1113353072629-55 
> 645-to-domain.here.com
> 
> mailet-2005-04-13-00-01.log:13/04/05 14:13:45 INFO  James.Mailet: 
> RemoteDelivery: Attempting delivery of Mail1113353072629-556 
> 45-to-graphicsbyheather.com to host mx.domain.here.com. at
> 217.160.230.12 to addresses [someuser@domain.here.com]
> mailet-2005-04-13-00-01.log:13/04/05 14:18:27 INFO  James.Mailet: 
> RemoteDelivery: Exception delivering message (Mail1113353072
> 629-55645-to-domain.here.com) - 552 message too large
> mailet-2005-04-13-00-01.log:13/04/05 14:18:27 INFO  James.Mailet: 
> RemoteDelivery: Permanent exception delivering mail (Mail111
> 3353072629-55645-to-domain.here.com: 
> javax.mail.MessagingException: 552 message too large
> mailet-2005-04-13-00-01.log:13/04/05 14:18:42 INFO  James.Mailet: 
> RemoteDelivery: Sending failure message Mail1113353072629-55 
> 645-to-domain.here.com
> 
> This group of messages repeated from 8pm 4/12 when the 
> message was sent by one of my users until 2:30 4/13 when I 
> killed the server and removed all of the outgoing mail 
> messages.  It looks like they repeat in 3 minute increments.
> 
> 
> Chris....
> 
> 
> Serge Knystautas wrote:
> 
> > Chris Hane wrote:
> >
> >> What I think is happening though is the other server that james is 
> >> trying to send to is not allowing for such a large message and is 
> >> just terminating the connection.
> >>
> >> It appears that james takes the termination as a network error and 
> >> retries immediately (and gets itself into a loop).  Has 
> anyone else 
> >> seen this type of issue?  Any solutions?  I'm even willing to work 
> >> through some of the james code if I could get a pointer or 
> two with 
> >> which classes to start with in my debugging attempts.
> >
> >
> > What version are you running?  I can't think of how our 
> error handling 
> > would try to immediately resend without incrementing the attempt 
> > counter.  Maybe it's an old version with a bug that's since 
> been fixed.
> >
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005
> 
> 
> ---------------------------------------------------------------------
> 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: Serious bandwidth begin consumed by James

Posted by Chris Hane <ch...@itsolut.com>.
I did a little digging in the logs and I was able to find these repeated 
log entries in the mailet-* logs (I removed the actual email address/dns 
info to protect the innocent):

mailet-2005-04-13-00-01.log:13/04/05 14:10:28 INFO  James.Mailet: 
RemoteDelivery: Attempting delivery of Mail1113353072629-556
45-to-graphicsbyheather.com to host mx.domain.here.com. at 
217.160.230.10 to addresses [someuser@domain.here.com]
mailet-2005-04-13-00-01.log:13/04/05 14:13:38 INFO  James.Mailet: 
RemoteDelivery: Exception delivering message (Mail1113353072
629-55645-to-domain.here.com) - 552 message too large
mailet-2005-04-13-00-01.log:13/04/05 14:13:38 INFO  James.Mailet: 
RemoteDelivery: Permanent exception delivering mail (Mail111
3353072629-55645-to-domain.here.com: javax.mail.MessagingException: 552 
message too large
mailet-2005-04-13-00-01.log:13/04/05 14:13:44 INFO  James.Mailet: 
RemoteDelivery: Sending failure message Mail1113353072629-55
645-to-domain.here.com

mailet-2005-04-13-00-01.log:13/04/05 14:13:45 INFO  James.Mailet: 
RemoteDelivery: Attempting delivery of Mail1113353072629-556
45-to-graphicsbyheather.com to host mx.domain.here.com. at 
217.160.230.12 to addresses [someuser@domain.here.com]
mailet-2005-04-13-00-01.log:13/04/05 14:18:27 INFO  James.Mailet: 
RemoteDelivery: Exception delivering message (Mail1113353072
629-55645-to-domain.here.com) - 552 message too large
mailet-2005-04-13-00-01.log:13/04/05 14:18:27 INFO  James.Mailet: 
RemoteDelivery: Permanent exception delivering mail (Mail111
3353072629-55645-to-domain.here.com: javax.mail.MessagingException: 552 
message too large
mailet-2005-04-13-00-01.log:13/04/05 14:18:42 INFO  James.Mailet: 
RemoteDelivery: Sending failure message Mail1113353072629-55
645-to-domain.here.com

This group of messages repeated from 8pm 4/12 when the message was sent 
by one of my users until 2:30 4/13 when I killed the server and removed 
all of the outgoing mail messages.  It looks like they repeat in 3 
minute increments.


Chris....


Serge Knystautas wrote:

> Chris Hane wrote:
>
>> What I think is happening though is the other server that james is 
>> trying to send to is not allowing for such a large message and is 
>> just terminating the connection.
>>
>> It appears that james takes the termination as a network error and 
>> retries immediately (and gets itself into a loop).  Has anyone else 
>> seen this type of issue?  Any solutions?  I'm even willing to work 
>> through some of the james code if I could get a pointer or two with 
>> which classes to start with in my debugging attempts.
>
>
> What version are you running?  I can't think of how our error handling 
> would try to immediately resend without incrementing the attempt 
> counter.  Maybe it's an old version with a bug that's since been fixed.
>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 4/12/2005


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


Re: Serious bandwidth begin consumed by James

Posted by ap...@bago.org.
> What I think is happening though is the other server that 
> james is trying to send to is not allowing for such a large 
> message and is just terminating the connection.
> 
> It appears that james takes the termination as a network 
> error and retries immediately (and gets itself into a loop).  
> Has anyone else seen this type of issue?  Any solutions?  I'm 
> even willing to work through some of the james code if I 
> could get a pointer or two with which classes to start with 
> in my debugging attempts.

Start here:

\src\java\org\apache\james\transport\mailets\RemoteDelivery.java 

private boolean deliver(MailImpl mail, Session session) {}

Stefano


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