Summary: | ASTERISK-19876: app_voicemail: make_email_file() sends emails with localized Date header | ||
Reporter: | Michael Kuron (mkuron) | Labels: | |
Date Opened: | 2012-05-15 13:03:09 | Date Closed: | 2012-06-05 10:25:20 |
Priority: | Minor | Regression? | |
Status: | Closed/Complete | Components: | Applications/app_voicemail |
Versions: | Frequency of Occurrence | Constant | |
Related Issues: | |||
Environment: | Attachments: | ||
Description: | When app_voicemail is configured to send email notifications about new voicemails and locale in voicemail.conf is set to something other than en_US, the Date header in the email gets localized (example for locale de_DE.UTF-8: "Date: Mi, 02 Mai 2012 10:36:52 +0200"). The Date header in emails should always contain en_US dates according to RFC5322, section 3.3. Many email clients are unable to parse such a localized date and display it as 1970-01-01 or similar instead. The bug appears to have been introduced in SVN revision 266828, which introduced date locale support into app_voicemail. It is still present in the current 1.8 release and in SVN trunk. Below are the code lines from commit 266828 that I believe cause the issue. {code} snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60); - ast_strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm)); + ast_strftime_locale(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", vmu_tm(vmu, &tm), S_OR(vmu->locale, NULL)); fprintf(p, "Date: %s" ENDL, date); {code} | ||
Comments: | By: Matt Jordan (mjordan) 2012-05-15 13:30:26.901-0500 Regardless of RFC 5322 (which appears to be a draft standard), there was an explicit issue, patch, and commit to enable the behavior that you're looking to reverse. Hence, this is not a bug, so much as the current intended behavior of Asterisk, which may not be compliant with this particular draft RFC. I'd prefer this to be taken to the #asterisk-dev mailing list, to see what impact changing this behavior would have. By: Michael Kuron (mkuron) 2012-05-15 13:59:21.037-0500 Ok, then look at RFC822, Section 5.1. That's the original 1982 spec for email and it's a standard, not a draft. Also, I'm not looking to reverse the entire patch, but just that one line. It looks like the locale-awareness was implemented in one too many places. It's correct that the date in the email body is locale aware (which is implemented a couple lines below the ones I referenced above), but the email header should not be. In fact, the email spec (RFC822 or RFC5322) seems to be the reason why the lines I referenced above have a statically set date format string, while the lines that format the date for the email body allow the format to be customized using the setting emaildateformat in voicemail.conf. |