Summary:ASTERISK-16781: [patch] substitute_escapes() not used on per-mailbox 'emailbody' variable
Reporter:Sébastien Couture (sysreq)Labels:
Date Opened:2010-10-07 13:33:30Date Closed:2011-08-26 08:36:48
Versions:Frequency of
Environment:Attachments:( 0) M18108.diff
Description:When per-mailbox 'emailbody' value is found and used, the substitute_escapes() function is not applied, contrary to what happens when 'emailbody' is taken from the [general] section of the configuration file.

The subsequent notification e-mail sent to the user will contain litteral \n, \r and \t characters.


In app_voicemail.c, when the [general] 'emailbody' variable is used (11291-11292):

if ((val = ast_variable_retrieve(cfg, "general", "emailbody"))) {
   emailbody = ast_strdup(substitute_escapes(val));

When the 'emailbody' variable is taken from the per-mailbox settings (line 1206-1207):

} else if (!strcasecmp(var->name, "emailbody")) {
   retval->emailbody = ast_strdup(var->value);
Comments:By: Clod Patry (junky) 2010-10-12 22:15:33

give this patch a try.

By: Sébastien Couture (sysreq) 2010-10-13 01:36:53

It works like a charm as far as 'emailbody' is concerned. I'm not sure that substituting text formatting (\n, \r, \t, etc.) escaped characters from 'emailsubject' is relevant, though.


By: Sébastien Couture (sysreq) 2011-02-08 15:25:02.000-0600

Any way to get this into the latest 1.6.2 branch?

By: Matt Jordan (mjordan) 2011-08-18 15:02:15.803-0500

This is very similar to ASTERISK-16795, which is currently being worked.  

As an aside, this will get added to the 1.8, 10, and trunk branches.