]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_voicemail: Fix ill-formatted pager emails with custom subject.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 24 Sep 2024 11:44:25 +0000 (07:44 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 14 Nov 2024 20:01:34 +0000 (20:01 +0000)
Add missing end-of-headers newline to pager emails with custom
subjects, since this was missing from this code path.

Resolves: #902
(cherry picked from commit 9423710a5e28ba0c77f9eb189e39876834847337)

apps/app_voicemail.c

index a15470e0f2fcd2663321d98bb4ad9cc077c284a7..f54007c5fdf5e97224ac103235af0ada5ff8a35f 100644 (file)
@@ -6033,12 +6033,15 @@ static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char
                }
        } else {
                if (ast_strlen_zero(flag)) {
-                       fprintf(p, "Subject: New VM\n\n");
+                       fprintf(p, "Subject: New VM" ENDL);
                } else {
-                       fprintf(p, "Subject: New %s VM\n\n", flag);
+                       fprintf(p, "Subject: New %s VM" ENDL, flag);
                }
        }
 
+       /* End of headers */
+       fputs(ENDL, p);
+
        if (pagerbody) {
                struct ast_channel *ast;
                if ((ast = ast_dummy_channel_alloc())) {