Thanks to visit codestin.com
Credit goes to github.com

Skip to content

app_voicemail: Fix ill-formatted pager emails with custom subject.#903

Merged
asterisk-org-access-app[bot] merged 1 commit into
asterisk:masterfrom
InterLinked1:master-issue-902
Sep 25, 2024
Merged

app_voicemail: Fix ill-formatted pager emails with custom subject.#903
asterisk-org-access-app[bot] merged 1 commit into
asterisk:masterfrom
InterLinked1:master-issue-902

Conversation

@InterLinked1

Copy link
Copy Markdown
Contributor

Add missing end-of-headers newline to pager emails with custom subjects, since this was missing from this code path.

Resolves: #902

@InterLinked1

Copy link
Copy Markdown
Contributor Author

cherry-pick-to: 18
cherry-pick-to: 20
cherry-pick-to: 21
cherry-pick-to: 22

@seanbright

Copy link
Copy Markdown
Contributor

I propose a slightly different approach that also normalizes the EOL characters when a custom subject is not present. It's easier to include the whole patch than to explain it:

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a15470e0f2..f54007c5fd 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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())) {

Add missing end-of-headers newline to pager emails with custom
subjects, since this was missing from this code path.

Resolves: asterisk#902
@gtjoseph gtjoseph added the cherry-pick-test Trigger dry run of cherry-picks label Sep 25, 2024
@github-actions github-actions Bot added cherry-pick-testing-in-progress Cherry-Pick tests in progress cherry-pick-checks-failed Cherry-Pick checks failed and removed cherry-pick-test Trigger dry run of cherry-picks cherry-pick-testing-in-progress Cherry-Pick tests in progress labels Sep 25, 2024
@asterisk-org-access-app asterisk-org-access-app Bot merged commit 6f16d13 into asterisk:master Sep 25, 2024
@github-actions

Copy link
Copy Markdown

Successfully merged to branch master and cherry-picked to ["18","20","21","22"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: app_voicemail: Pager emails are ill-formatted when custom subject is used

4 participants