Summary:ASTERISK-01583: [patch] MIME boundary text can trigger delays in email from voicemail
Reporter:stevegaarder (stevegaarder)Labels:
Date Opened:2004-05-10 11:38:23Date Closed:2008-01-15 14:54:27.000-0600
Versions:Frequency of
Environment:Attachments:( 0) app_voicemail.diff.txt
Description:Voicemail messages sent by email from Asterisk were getting delayed by our provider for no apparent reason.  When I changed the word "boundary" in the MIME boundary text the
problem went away.


app_voicemail.c, line 758 reads:

snprintf(bound, sizeof(bound), "Boundary=%d%s%d", msgnum, mailbox, getpid());

Thus, it sets the MIME boundary to a piece of text that starts with the word "Boundary="  This produces a header line in the message that looks like this:

Content-Type: MULTIPART/MIXED; BOUNDARY="Boundary=1010123421336"

I believe that the two strings "boundary=" must confuse something at the provider's, possibly their virus scanner.

This change solved the problem:

snprintf(bound, sizeof(bound), "Mxyzptlk=%d%s%d", msgnum, mailbox, getpid());
Comments:By: Brian West (bkw918) 2004-05-10 14:03:19

Find me the RFC that says we are doing it wrong and we will fix it.


By: Brian West (bkw918) 2004-05-10 14:05:11

I see exactly what you are talking about but what is correct is all i'm after.

By: Brian West (bkw918) 2004-05-10 14:10:50

accually it just needs to loose the = but I think voicemail_ is a better replacement... :)

By: stevegaarder (stevegaarder) 2004-05-10 14:17:28

All RFC 1341 says is that the boundary string must not appear anywhere except the boundary; the string itself can be any arbitrary text. It does not need to contain the word "boundary," like Asterisk's does, but there's nothing that says it can't. I think that Asterisk's boundary is perfectly legal, but it just happens to tickle a bug in whatever software the email provider is using.  It's easier for me to fix
Asterisk than to browbeat the provider into doing something.



By: Brian West (bkw918) 2004-05-10 14:38:33

ya I think this change will fix it.

By: Olle Johansson (oej) 2004-05-10 16:09:57

Maybe the equal sign is the problem.

By: Olle Johansson (oej) 2004-05-10 16:18:24

RFC 2046 is the current RFC.

Here's the problem:
Content-Type: MULTIPART/MIXED; BOUNDARY="Boundary=19300012359"

and later:

We're not using the boundary we set, which should be

Removing the first "Boundary=" is correct.

By: Brian West (bkw918) 2004-05-10 17:05:45

yep so I just changed it to voicemail_
makes more sense anyway.

By: Mark Spencer (markster) 2004-05-11 10:53:42

Fixed in CVS head ONLY!

By: Digium Subversion (svnbot) 2008-01-15 14:54:27.000-0600

Repository: asterisk
Revision: 2946

U   trunk/apps/app_voicemail.c

r2946 | markster | 2008-01-15 14:54:27 -0600 (Tue, 15 Jan 2008) | 2 lines

Change "boundary" to be less likely to cause e-mail conflicts (bug ASTERISK-1583)