diff --git a/src/testsuite/testsuite-message.c b/src/testsuite/testsuite-message.c index c04ab34455a00fe85fed021882ebeae0bc6a8aa4..c0105a2d69c2d7bb293f66d55d01ef329aca8bc4 100644 --- a/src/testsuite/testsuite-message.c +++ b/src/testsuite/testsuite-message.c @@ -48,6 +48,7 @@ static const struct smtp_address * testsuite_message_get_address(struct mail *mail, const char *header) { struct message_address *addr; + struct smtp_address *smtp_addr; const char *str; if (mail_get_first_header(mail, header, &str) <= 0) @@ -57,7 +58,9 @@ testsuite_message_get_address(struct mail *mail, const char *header) strlen(str), 1, 0); if (addr == NULL || addr->mailbox == NULL || *addr->mailbox == '\0') return NULL; - return smtp_address_create_temp(addr->mailbox, addr->domain); + if (smtp_address_create_from_msg_temp(addr, &smtp_addr) < 0) + return NULL; + return smtp_addr; } static void testsuite_message_set_data(struct mail *mail) diff --git a/tests/extensions/vacation/smtp.svtest b/tests/extensions/vacation/smtp.svtest index 745192a10d545e8dddb108082e715538714bd044..40dbd89aadee78cfe8f4e4dc846fbe7df9469175 100644 --- a/tests/extensions/vacation/smtp.svtest +++ b/tests/extensions/vacation/smtp.svtest @@ -155,3 +155,45 @@ test "Cc" { test_fail "envelope sender not null"; } } + +test_result_reset; + +test_set "message" text: +From: stephan@example.org +Subject: No subject of discussion +To: nicëøôçêè—öxample.org + +Frop +. +; + +test "Bad recipient address (from message)" { + vacation :subject "Tulips" "I am not in today!"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + +} + +test_result_reset; + +test_set "message" text: +From: stephan@example.org +Subject: No subject of discussion +To: tss@example.net + +Frop +. +; + +test_set "envelope.to" "nicëøôçêè—öxample.org"; + +test "Bad recipient address (from envelope)" { + vacation :subject "Tulips" "I am not in today!"; + + if not test_result_execute { + test_fail "execution of result failed"; + } + +}