]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: Expand SMTP_ADDRESS_LITERAL() macro
authorMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Mon, 17 Jun 2019 17:26:47 +0000 (20:26 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 19 Jun 2019 09:38:34 +0000 (09:38 +0000)
This makes the use of compound literal explicit.

src/lib-smtp/test-smtp-client-errors.c
src/lib-smtp/test-smtp-payload.c
src/lib-smtp/test-smtp-submit.c

index 16d7249e6455691b0fdb8390e793280792629445..c40622324a30f0166dea16cb2e9866c608bbbae0 100644 (file)
@@ -742,12 +742,12 @@ test_client_broken_payload(
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[0],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        strans = smtp_client_transaction_create(sconn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_broken_payload_finished, NULL);
        smtp_client_connection_unref(&sconn);
 
        smtp_client_transaction_add_rcpt(strans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_broken_payload_rcpt_to_cb,
                test_client_broken_payload_rcpt_data_cb, NULL);
        smtp_client_transaction_send(strans, input,
@@ -801,12 +801,12 @@ test_client_broken_payload_later(
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[0],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        strans = smtp_client_transaction_create(sconn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_broken_payload_finished, NULL);
        smtp_client_connection_unref(&sconn);
 
        smtp_client_transaction_add_rcpt(strans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_broken_payload_rcpt_to_cb,
                test_client_broken_payload_rcpt_data_cb, NULL);
        smtp_client_transaction_send
@@ -1025,12 +1025,12 @@ test_client_connection_lost_submit(struct _connection_lost *ctx,
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[index],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        strans = smtp_client_transaction_create(sconn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_connection_lost_finished, pctx);
        smtp_client_connection_unref(&sconn);
 
        smtp_client_transaction_add_rcpt(strans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_connection_lost_rcpt_to_cb,
                test_client_connection_lost_rcpt_data_cb, pctx);
        smtp_client_transaction_send
@@ -1338,7 +1338,7 @@ test_client_unexpected_reply_submit1(struct _unexpected_reply_peer *pctx)
        timeout_remove(&pctx->to);
 
        smtp_client_transaction_add_rcpt(pctx->trans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_unexpected_reply_rcpt_to_cb,
                test_client_unexpected_reply_rcpt_data_cb, pctx);
 
@@ -1360,7 +1360,7 @@ test_client_unexpected_reply_submit(struct _unexpected_reply *ctx,
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[index],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        pctx->trans = smtp_client_transaction_create(pctx->conn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_unexpected_reply_finished, pctx);
        smtp_client_connection_connect(pctx->conn,
                test_client_unexpected_reply_login_cb, (void *)pctx);
@@ -1799,7 +1799,7 @@ test_client_premature_reply_submit2(struct _premature_reply_peer *pctx)
                i_debug("SUBMIT2[%u]", pctx->index);
 
        smtp_client_transaction_add_rcpt(pctx->trans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_premature_reply_rcpt_to_cb,
                test_client_premature_reply_rcpt_data_cb, pctx);
 
@@ -1838,7 +1838,7 @@ test_client_premature_reply_submit(struct _premature_reply *ctx,
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[index],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        pctx->trans = smtp_client_transaction_create(conn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_premature_reply_finished, pctx);
        smtp_client_connection_connect(conn,
                test_client_premature_reply_login_cb, (void *)pctx);
@@ -2123,10 +2123,10 @@ test_client_early_data_reply_submit(struct _early_data_reply *ctx,
                test_client_early_data_reply_login_cb, (void *)pctx);
 
        pctx->trans = smtp_client_transaction_create(conn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_early_data_reply_finished, pctx);
        smtp_client_transaction_add_rcpt(pctx->trans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_early_data_reply_rcpt_to_cb,
                test_client_early_data_reply_rcpt_data_cb, pctx);
        smtp_client_transaction_start(pctx->trans,
@@ -3151,7 +3151,7 @@ test_client_authentication_failed_submit(struct _authentication_failed *ctx,
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[index],
                SMTP_CLIENT_SSL_MODE_NONE, &smtp_set);
        pctx->trans = smtp_client_transaction_create(pctx->conn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_authentication_failed_finished, pctx);
        smtp_client_connection_connect(pctx->conn,
                test_client_authentication_failed_login_cb, (void *)pctx);
@@ -3160,7 +3160,7 @@ test_client_authentication_failed_submit(struct _authentication_failed *ctx,
        smtp_client_connection_unref(&pctx->conn);
 
        smtp_client_transaction_add_rcpt(pctx->trans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_authentication_failed_rcpt_to_cb,
                test_client_authentication_failed_rcpt_data_cb, pctx);
 
@@ -3402,7 +3402,7 @@ test_client_transaction_timeout_submit1(struct _transaction_timeout_peer *pctx)
        timeout_remove(&pctx->to);
 
        smtp_client_transaction_add_rcpt(pctx->trans,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"), NULL,
+               &((struct smtp_address){"rcpt", "example.com"}), NULL,
                test_client_transaction_timeout_rcpt_to_cb,
                test_client_transaction_timeout_rcpt_data_cb, pctx);
 
@@ -3424,7 +3424,7 @@ test_client_transaction_timeout_submit(struct _transaction_timeout *ctx,
                SMTP_PROTOCOL_SMTP, net_ip2addr(&bind_ip), bind_ports[index],
                SMTP_CLIENT_SSL_MODE_NONE, NULL);
        pctx->trans = smtp_client_transaction_create(pctx->conn,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"), NULL, 0,
+               &((struct smtp_address){"sender", "example.com"}), NULL, 0,
                test_client_transaction_timeout_finished, pctx);
        smtp_client_transaction_set_timeout(pctx->trans, 1000);
        smtp_client_transaction_start(pctx->trans,
index 303a50c4ad94c41df41d283619392a0ebeaae3bf..53a15174c4b5fb69afc6f5c35eb330a0cede64ae 100644 (file)
@@ -754,7 +754,7 @@ static void test_client_continue(void *dummy ATTR_UNUSED)
 
                tctrans->conn->trans = smtp_client_transaction_create(
                        tctrans->conn->conn,
-                       SMTP_ADDRESS_LITERAL("user", "example.com"),
+                       &((struct smtp_address){"user", "example.com"}),
                        &mail_params, 0,
                        test_client_transaction_finish, tctrans);
 
index eae38bbd3fad8c65181a7e26df66727f7345b7e1..db2dc10819d961f3d6ab195c46d8a414e81996f6 100644 (file)
@@ -760,12 +760,12 @@ test_client_denied_second_rcpt(const struct smtp_submit_settings *submit_set)
 
        i_zero(&smtp_input);
        smtp_submit = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        smtp_submit_add_rcpt(smtp_submit,
-               SMTP_ADDRESS_LITERAL("rcpt2", "example.com"));
+               &((struct smtp_address){"rcpt2", "example.com"}));
        output = smtp_submit_send(smtp_submit);
        o_stream_nsend_str(output, test_message1);
 
@@ -1475,10 +1475,10 @@ test_client_parallel_delivery(const struct smtp_submit_settings *submit_set)
        smtp_submit_set.submission_host =
                t_strdup_printf("127.0.0.1:%u",  bind_ports[0]);
        smtp_submit1 = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit1,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit1);
        o_stream_nsend_str(output, test_message1);
 
@@ -1490,10 +1490,10 @@ test_client_parallel_delivery(const struct smtp_submit_settings *submit_set)
        smtp_submit_set.submission_host =
                t_strdup_printf("127.0.0.1:%u",  bind_ports[1]);
        smtp_submit2 = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit2,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit2);
        o_stream_nsend_str(output, test_message2);
 
@@ -1566,10 +1566,10 @@ test_client_failed_sendmail(const struct smtp_submit_settings *submit_set)
 
        i_zero(&smtp_input);
        smtp_submit = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit);
        o_stream_nsend_str(output, test_message1);
 
@@ -1623,10 +1623,10 @@ test_client_successful_sendmail(const struct smtp_submit_settings *submit_set)
 
        i_zero(&smtp_input);
        smtp_submit = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit);
        o_stream_nsend_str(output, test_message1);
 
@@ -1709,10 +1709,10 @@ test_client_parallel_sendmail(const struct smtp_submit_settings *submit_set)
        i_zero(&smtp_input);
        smtp_submit_set.sendmail_path = sendmail_path1;
        smtp_submit1 = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit1,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit1);
        o_stream_nsend_str(output, test_message1);
 
@@ -1723,10 +1723,10 @@ test_client_parallel_sendmail(const struct smtp_submit_settings *submit_set)
        i_zero(&smtp_input);
        smtp_submit_set.sendmail_path = sendmail_path2;
        smtp_submit2 = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit2,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit2);
        o_stream_nsend_str(output, test_message2);
 
@@ -1823,10 +1823,10 @@ test_client_smtp_send_simple(const struct smtp_submit_settings *smtp_set,
 
        i_zero(&smtp_input);
        smtp_submit = smtp_submit_init_simple(&smtp_input, &smtp_submit_set,
-               SMTP_ADDRESS_LITERAL("sender", "example.com"));
+               &((struct smtp_address){"sender", "example.com"}));
 
        smtp_submit_add_rcpt(smtp_submit,
-               SMTP_ADDRESS_LITERAL("rcpt", "example.com"));
+               &((struct smtp_address){"rcpt", "example.com"}));
        output = smtp_submit_send(smtp_submit);
        o_stream_nsend_str(output, message);