Mailing List Archive

Mime recursion-depth is limited to 64
Hello Paul.

I am probably missing something vital. So according to e0a92b2d commit message:
recursion-depth is limited to 64. Indeed in _mime_retreive() blist array is now
statically allocated for 64 elements but according to
http://www.dbmail.org/mantis/view.php?id=979 its possible to select more than 64
mimeparts records for a single message (its pretty a corner-case).

I guess its either a mimeparts depth restriction somewhere in message delivery
or the dbmail can potentially overwrite a stack while processing the mimeparts
chain.

--
Best regards,
Pavlo Lavrenenko,
PortaOne, Inc., Junior Software Developer
Tel: +1-866-SIP VOIP (+1 866 747 8647) ext. 7624

PortaOne - VoIP Solutions Company
Visit our Website: http://www.portaone.com
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev
Re: Mime recursion-depth is limited to 64 [ In reply to ]
On 09/25/2013 04:19 PM, Pavlo Lavrenenko wrote:
> Hello Paul.
>
> I am probably missing something vital. So according to e0a92b2d commit
> message: recursion-depth is limited to 64. Indeed in _mime_retreive()
> blist array is now statically allocated for 64 elements but according to
> http://www.dbmail.org/mantis/view.php?id=979 its possible to select more
> than 64 mimeparts records for a single message (its pretty a corner-case).

There is a very big difference between the number of attachments and the
recursions depth of attachments.

The number of attachments is and always has been unlimited.

Are you telling me that you see recursion depth > 64 in the wild? It's
theoretically possible of course, but do such messages actually occur?

Keep in mind that many virus/spam scanners don't like very deep
mime-structures.

If anyone is stuffing attachments inside attachments, inside
attachments, etc to a depth of over 64, I'd like to see it. And no, I
don't give a f*ck about mail-loops that include the original message as
an attachment.

Of course my ideas don't rule here.

Feel free to compile with with another recursion depth limit

-DMAX_MIME_DEPTH=1024


--
________________________________________________________________
Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin

* Premium Hosting Services and Web Application Consultancy *

www.nfg.nl/info@nfg.nl/+31.85.877.99.97
________________________________________________________________
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev
Re: Mime recursion-depth is limited to 64 [ In reply to ]
On 09/25/2013 05:38 PM, Paul J Stevens wrote:
> There is a very big difference between the number of attachments and the
> recursions depth of attachments.
>
> The number of attachments is and always has been unlimited.

Got that, thanks for clarification.

> Are you telling me that you see recursion depth > 64 in the wild? It's
> theoretically possible of course, but do such messages actually occur?
>
> Keep in mind that many virus/spam scanners don't like very deep
> mime-structures.
>
> If anyone is stuffing attachments inside attachments, inside
> attachments, etc to a depth of over 64, I'd like to see it. And no, I
> don't give a f*ck about mail-loops that include the original message as
> an attachment.

I've got a db dump from one of our customers:

mysql> select max(part_depth) from dbmail_partlists;
+-----------------+
| max(part_depth) |
+-----------------+
| 242 |
+-----------------+
1 row in set (0.69 sec)

mysql> select * from dbmail_partlists where part_depth = 242;
+----------------+-----------+----------+------------+------------+----------+
| physmessage_id | is_header | part_key | part_depth | part_order | part_id |
+----------------+-----------+----------+------------+------------+----------+
| 3617138 | 1 | 966 | 242 | 0 | 16509340 |
| 3617138 | 0 | 966 | 242 | 1 | 16509341 |
| 3617138 | 1 | 967 | 242 | 0 | 16509342 |
| 3617138 | 0 | 967 | 242 | 1 | 16509805 |
+----------------+-----------+----------+------------+------------+----------+
4 rows in set (0.96 sec)

I'll try to figure out what kind of message is that.

--
Best regards,
Pavlo Lavrenenko,
PortaOne, Inc., Junior Software Developer
Tel: +1-866-SIP VOIP (+1 866 747 8647) ext. 7624

PortaOne - VoIP Solutions Company
Visit our Website: http://www.portaone.com
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev
Re: Mime recursion-depth is limited to 64 [ In reply to ]
On 09/25/2013 05:38 PM, Paul J Stevens wrote:
> If anyone is stuffing attachments inside attachments, inside
> attachments, etc to a depth of over 64, I'd like to see it. And no, I
> don't give a f*ck about mail-loops that include the original message as
> an attachment.

Yeah, thats a failed delivery report `Your Message Could Not Be Delivered' with
the same message attached again and again more than 200 times. I guess this is
the loop you were talking about.

Thanks for clarification.

--
Best regards,
Pavlo Lavrenenko,
PortaOne, Inc., Junior Software Developer
Tel: +1-866-SIP VOIP (+1 866 747 8647) ext. 7624

PortaOne - VoIP Solutions Company
Visit our Website: http://www.portaone.com
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev