Re: attachment size limitation

Actions

From Jon Stevens Jun 30, 2009 8:22 AM

It is odd that you are hitting this limit with a 4 meg attachment, but I can
easily see it with a larger (14/35meg) attachment.

The issue is buffering. Imagine if 100 messages come in at the same exact
time and each has a 10 meg attachment. That is a minimum of 1gig of memory
that the JVM needs to deal with. If you overflow the JVM heap size, then you
are shit out of luck. (Make sure you increase the amount of memory allocated
to the JVM... edit resin.conf and specify a much larger
<jvm-arg>-Xmx512m</jvm-arg>... I'd also specify an equally sized -Xms
variable as well.)
Agreed that this should be a more easily configured option. We can improve
on that in the future. Have you tried increasing the limit? (just recompile
subetha, it is pretty easy). Change the MAX_MESSAGE_BYTES variable in the
InjectorBean to something much larger. Here is the link to how to setup a
development environment. You can skip the eclipse part... just check the
source code out and use ant to compile a war file for you with an 'ant war'
command.
http://code.google.com/p/subetha/wiki/DeveloperGuide

jon


On Mon, Jun 29, 2009 at 11:48 PM, Charles Williams
<c.williams@planet-ic.de>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> well, just finished a google search regarding this and it seems to be the
> same error/bug that was
> first reported back in 2007. which impacts all mail whether imported into
> the archives or newly sent
> messages.
>
> this is also the same problem that I reported a while back. and am
> currently catching hell for here.
> am wondering why a hardlimit was set at all. something like this should
> automatically be configurable.
>
> http://www.subethamail.org/se/archive_msg.jsp?msgId=25608
>
> ok. rant over. ;)
>
> has been a rather crappy morning here.
>
> chuck
>
>
> Charles Williams wrote:
> > almost forgot.
> >
> > am using the new 2.0 version of subetha. ;)
> >
> > why can't we have an attachment size limit setting in the subetha config?
> would make a bit more
> > sense if you asked me.
> >
> > chuck
> >
> > Charles Williams wrote:
> >> Hey guys,
> >
> >> we are still having attachment size problems. we've tried with 4, 14 and
> 35 MB files and all are
> >> dropped with the following error:
> >
> >> Exception in thread "org.subethamail.smtp.server.Session"
> >> javax.ejb.TransactionRolledbackLocalException:
> java.lang.RuntimeException:
> >> javax.mail.MessagingException: IOException;
> >>   nested exception is:
> >>      org.subethamail.common.io.LimitExceededException: Predicted size
> 10002432 exceeds limit 10000000
> >>      at com.caucho.ejb3.xa.XAManager.commit(XAManager.java:247)
> >>      at
> _ejb.Injector.InjectorBean__EJB$Injector__EJBLocal.inject(InjectorBean__EJB.java:268)
> >>      at
> org.subethamail.core.smtp.OurDeliverer.deliver(OurDeliverer.java:34)
> >>      at
> org.subethamail.core.smtp.SMTPHandler$Handler.data(SMTPHandler.java:140)
> >>      at
> org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:55)
> >>      at
> org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:72)
> >>      at org.subethamail.smtp.server.Session.run(Session.java:114)
> >> Caused by: com.caucho.transaction.RollbackExceptionWrapper:
> java.lang.RuntimeException:
> >> javax.mail.MessagingException: IOException;
> >>   nested exception is:
> >>      org.subethamail.common.io.LimitExceededException: Predicted size
> 10002432 exceeds limit 10000000
> >>      at
> com.caucho.transaction.TransactionImpl.commit(TransactionImpl.java:610)
> >>      at
> com.caucho.transaction.TransactionManagerImpl.commit(TransactionManagerImpl.java:270)
> >>      at
> com.caucho.jca.UserTransactionImpl.commit(UserTransactionImpl.java:437)
> >>      at
> com.caucho.jca.UserTransactionProxy.commit(UserTransactionProxy.java:166)
> >>      at com.caucho.ejb3.xa.XAManager.commit(XAManager.java:243)
> >>      ... 6 more
> >> Caused by: java.lang.RuntimeException: javax.mail.MessagingException:
> IOException;
> >>   nested exception is:
> >>      org.subethamail.common.io.LimitExceededException: Predicted size
> 10002432 exceeds limit 10000000
> >>      at
> org.subethamail.core.injector.InjectorBean.inject(InjectorBean.java:213)
> >>      at
> _ejb.Injector.InjectorBean__EJB$Injector__EJBLocal.inject(InjectorBean__EJB.java:260)
> >>      ... 5 more
> >> Caused by: javax.mail.MessagingException: IOException;
> >>   nested exception is:
> >>      org.subethamail.common.io.LimitExceededException: Predicted size
> 10002432 exceeds limit 10000000
> >>      at javax.mail.internet.MimeMessage.parse(MimeMessage.java:340)
> >>      at javax.mail.internet.MimeMessage.<init>(MimeMessage.java:209)
> >>      at com.sun.mail.smtp.SMTPMessage.<init>(SMTPMessage.java:109)
> >>      at
> org.subethamail.common.SubEthaMessage.<init>(SubEthaMessage.java:75)
> >>      at
> org.subethamail.core.injector.InjectorBean.injectImpl(InjectorBean.java:258)
> >>      at
> org.subethamail.core.injector.InjectorBean.inject(InjectorBean.java:190)
> >>      ... 6 more
> >> Caused by: org.subethamail.common.io.LimitExceededException: Predicted
> size 10002432 exceeds limit
> >> 10000000
> >>      at
> org.subethamail.common.io.LimitingInputStream.thresholdReached(LimitingInputStream.java:30)
> >>      at
> org.subethamail.common.io.ThresholdingInputStream.checkThreshold(ThresholdingInputStream.java:146)
> >>      at
> org.subethamail.common.io.ThresholdingInputStream.read(ThresholdingInputStream.java:93)
> >>      at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> >>      at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
> >>      at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
> >>      at com.sun.mail.util.ASCIIUtility.getBytes(ASCIIUtility.java:259)
> >>      at javax.mail.internet.MimeMessage.parse(MimeMessage.java:338)
> >>      ... 11 more
> >
> >
> >
> >> chuck
> >
> > _______________________________________________
> > SubEtha Users mailing list
> > users@subethamail.org
> > http://www.subethamail.org/se/list/users
> > http://www.subethamail.org/se/archive_msg.jsp?msgId=50412
> >
> _______________________________________________
> SubEtha Users mailing list
> users@subethamail.org
> http://www.subethamail.org/se/list/users
> http://www.subethamail.org/se/archive_msg.jsp?msgId=50413
>
> - --
> - - --
> //
> // IT- & Software-Systemhaus, Internet Service und Web Agentur
> //
> // Charles Williams, Sys/Sec Administrator, R&D, Proj. Man.
> // PLANET IC GmbH, Haus 4, Hagenower Strasse 73, 19061 Schwerin
> // Registergericht Schwerin HRB 6762, Geschäftsführer Andreas Scher
> // Telefon 0385 30200 200, Telefax 0385 30200 190, Internet
> www.planet-ic.de
> //
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkpJtT8ACgkQ0RUDxJHrYt46WwCfbwo3gjl9b0rllg6RfMoKCYiD
> mDQAoJO4TLD/ngp9+CT1J0OBZivc9kSR
> =Pp9w
> -----END PGP SIGNATURE-----
> _______________________________________________
> SubEtha Users mailing list
> users@subethamail.org
> http://www.subethamail.org/se/list/users
> http://www.subethamail.org/se/archive_msg.jsp?msgId=50414
>
<div>It is odd that you are hitting this limit with a 4 meg attachment, but I can easily see it with a larger (14/35meg) attachment.</div><div><br></div>The issue is buffering. Imagine if 100 messages come in at the same exact time and each has a 10 meg attachment. That is a minimum of 1gig of memory that the JVM needs to deal with. If you overflow the JVM heap size, then you are shit out of luck. (Make sure you increase the amount of memory allocated to the JVM... edit resin.conf and specify a much larger &lt;jvm-arg&gt;-Xmx512m&lt;/jvm-arg&gt;... I&#39;d also specify an equally sized -Xms variable as well.)<div>

<br></div><div>Agreed that this should be a more easily configured option. We can improve on that in the future. Have you tried increasing the limit? (just recompile subetha, it is pretty easy). Change the MAX_MESSAGE_BYTES variable in the InjectorBean to something much larger. Here is the link to how to setup a development environment. You can skip the eclipse part... just check the source code out and use ant to compile a war file for you with an &#39;ant war&#39; command.</div>

<div><a href="http://code.google.com/p/subetha/wiki/DeveloperGuide">http://code.google.com/p/subetha/wiki/DeveloperGuide</a></div><div><br></div><div>jon</div><div><br><br><div class="gmail_quote">On Mon, Jun 29, 2009 at 11:48 PM, Charles Williams <span dir="ltr">&lt;<a href="mailto:c.williams@planet-ic.de">c.williams@planet-ic.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div>well, just finished a google search regarding this and it seems to be the same error/bug that was<br>
first reported back in 2007. which impacts all mail whether imported into the archives or newly sent<br>
messages.<br>
<br>
this is also the same problem that I reported a while back. and am currently catching hell for here.<br>
am wondering why a hardlimit was set at all. something like this should automatically be configurable.<br>
<br>
<a href="http://www.subethamail.org/se/archive_msg.jsp?msgId=25608" target="_blank">http://www.subethamail.org/se/archive_msg.jsp?msgId=25608</a><br>
<br>
ok. rant over. ;)<br>
<br>
has been a rather crappy morning here.<br>
<br>
chuck<br>
<div><div></div><div class="h5"><br>
<br>
Charles Williams wrote:<br>
&gt; almost forgot.<br>
&gt;<br>
&gt; am using the new 2.0 version of subetha. ;)<br>
&gt;<br>
&gt; why can&#39;t we have an attachment size limit setting in the subetha config? would make a bit more<br>
&gt; sense if you asked me.<br>
&gt;<br>
&gt; chuck<br>
&gt;<br>
&gt; Charles Williams wrote:<br>
&gt;&gt; Hey guys,<br>
&gt;<br>
&gt;&gt; we are still having attachment size problems. we&#39;ve tried with 4, 14 and 35 MB files and all are<br>
&gt;&gt; dropped with the following error:<br>
&gt;<br>
&gt;&gt; Exception in thread &quot;org.subethamail.smtp.server.Session&quot;<br>
&gt;&gt; javax.ejb.TransactionRolledbackLocalException: java.lang.RuntimeException:<br>
&gt;&gt; javax.mail.MessagingException: IOException;<br>
&gt;&gt;   nested exception is:<br>
&gt;&gt;      org.subethamail.common.io.LimitExceededException: Predicted size 10002432 exceeds limit 10000000<br>
&gt;&gt;      at com.caucho.ejb3.xa.XAManager.commit(XAManager.java:247)<br>
&gt;&gt;      at _ejb.Injector.InjectorBean__EJB$Injector__EJBLocal.inject(InjectorBean__EJB.java:268)<br>
&gt;&gt;      at org.subethamail.core.smtp.OurDeliverer.deliver(OurDeliverer.java:34)<br>
&gt;&gt;      at org.subethamail.core.smtp.SMTPHandler$Handler.data(SMTPHandler.java:140)<br>
&gt;&gt;      at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:55)<br>
&gt;&gt;      at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:72)<br>
&gt;&gt;      at org.subethamail.smtp.server.Session.run(Session.java:114)<br>
&gt;&gt; Caused by: com.caucho.transaction.RollbackExceptionWrapper: java.lang.RuntimeException:<br>
&gt;&gt; javax.mail.MessagingException: IOException;<br>
&gt;&gt;   nested exception is:<br>
&gt;&gt;      org.subethamail.common.io.LimitExceededException: Predicted size 10002432 exceeds limit 10000000<br>
&gt;&gt;      at com.caucho.transaction.TransactionImpl.commit(TransactionImpl.java:610)<br>
&gt;&gt;      at com.caucho.transaction.TransactionManagerImpl.commit(TransactionManagerImpl.java:270)<br>
&gt;&gt;      at com.caucho.jca.UserTransactionImpl.commit(UserTransactionImpl.java:437)<br>
&gt;&gt;      at com.caucho.jca.UserTransactionProxy.commit(UserTransactionProxy.java:166)<br>
&gt;&gt;      at com.caucho.ejb3.xa.XAManager.commit(XAManager.java:243)<br>
&gt;&gt;      ... 6 more<br>
&gt;&gt; Caused by: java.lang.RuntimeException: javax.mail.MessagingException: IOException;<br>
&gt;&gt;   nested exception is:<br>
&gt;&gt;      org.subethamail.common.io.LimitExceededException: Predicted size 10002432 exceeds limit 10000000<br>
&gt;&gt;      at org.subethamail.core.injector.InjectorBean.inject(InjectorBean.java:213)<br>
&gt;&gt;      at _ejb.Injector.InjectorBean__EJB$Injector__EJBLocal.inject(InjectorBean__EJB.java:260)<br>
&gt;&gt;      ... 5 more<br>
&gt;&gt; Caused by: javax.mail.MessagingException: IOException;<br>
&gt;&gt;   nested exception is:<br>
&gt;&gt;      org.subethamail.common.io.LimitExceededException: Predicted size 10002432 exceeds limit 10000000<br>
&gt;&gt;      at javax.mail.internet.MimeMessage.parse(MimeMessage.java:340)<br>
&gt;&gt;      at javax.mail.internet.MimeMessage.&lt;init&gt;(MimeMessage.java:209)<br>
&gt;&gt;      at com.sun.mail.smtp.SMTPMessage.&lt;init&gt;(SMTPMessage.java:109)<br>
&gt;&gt;      at org.subethamail.common.SubEthaMessage.&lt;init&gt;(SubEthaMessage.java:75)<br>
&gt;&gt;      at org.subethamail.core.injector.InjectorBean.injectImpl(InjectorBean.java:258)<br>
&gt;&gt;      at org.subethamail.core.injector.InjectorBean.inject(InjectorBean.java:190)<br>
&gt;&gt;      ... 6 more<br>
&gt;&gt; Caused by: org.subethamail.common.io.LimitExceededException: Predicted size 10002432 exceeds limit<br>
&gt;&gt; 10000000<br>
&gt;&gt;      at org.subethamail.common.io.LimitingInputStream.thresholdReached(LimitingInputStream.java:30)<br>
&gt;&gt;      at org.subethamail.common.io.ThresholdingInputStream.checkThreshold(ThresholdingInputStream.java:146)<br>
&gt;&gt;      at org.subethamail.common.io.ThresholdingInputStream.read(ThresholdingInputStream.java:93)<br>
&gt;&gt;      at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)<br>
&gt;&gt;      at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)<br>
&gt;&gt;      at java.io.BufferedInputStream.read(BufferedInputStream.java:317)<br>
&gt;&gt;      at com.sun.mail.util.ASCIIUtility.getBytes(ASCIIUtility.java:259)<br>
&gt;&gt;      at javax.mail.internet.MimeMessage.parse(MimeMessage.java:338)<br>
&gt;&gt;      ... 11 more<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; chuck<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; SubEtha Users mailing list<br>
&gt; <a href="mailto:users@subethamail.org">users@subethamail.org</a><br>
&gt; <a href="http://www.subethamail.org/se/list/users" target="_blank">http://www.subethamail.org/se/list/users</a><br>
&gt; <a href="http://www.subethamail.org/se/archive_msg.jsp?msgId=50412" target="_blank">http://www.subethamail.org/se/archive_msg.jsp?msgId=50412</a><br>
&gt;<br>
</div></div><div class="im">_______________________________________________<br>
SubEtha Users mailing list<br>
<a href="mailto:users@subethamail.org">users@subethamail.org</a><br>
<a href="http://www.subethamail.org/se/list/users" target="_blank">http://www.subethamail.org/se/list/users</a><br>
<a href="http://www.subethamail.org/se/archive_msg.jsp?msgId=50413" target="_blank">http://www.subethamail.org/se/archive_msg.jsp?msgId=50413</a><br>
<br>
</div><div class="im">- --<br>
- - --<br>
//<br>
// IT- &amp; Software-Systemhaus, Internet Service und Web Agentur<br>
//<br>
// Charles Williams, Sys/Sec Administrator, R&amp;D, Proj. Man.<br>
// PLANET IC GmbH, Haus 4, Hagenower Strasse 73, 19061 Schwerin<br>
// Registergericht Schwerin HRB 6762, Geschäftsführer Andreas Scher<br>
// Telefon 0385 30200 200, Telefax 0385 30200 190, Internet <a href="http://www.planet-ic.de" target="_blank">www.planet-ic.de</a><br>
//<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
</div>iEYEARECAAYFAkpJtT8ACgkQ0RUDxJHrYt46WwCfbwo3gjl9b0rllg6RfMoKCYiD<br>
mDQAoJO4TLD/ngp9+CT1J0OBZivc9kSR<br>
=Pp9w<br>
<div class="im">-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
SubEtha Users mailing list<br>
<a href="mailto:users@subethamail.org">users@subethamail.org</a><br>
<a href="http://www.subethamail.org/se/list/users" target="_blank">http://www.subethamail.org/se/list/users</a><br>
</div><a href="http://www.subethamail.org/se/archive_msg.jsp?msgId=50414" target="_blank">http://www.subethamail.org/se/archive_msg.jsp?msgId=50414</a><br>
</blockquote></div><br></div>

Thread History