]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lda: Stop using SMTP_ADDRESS_LITERAL() macro
authorMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Mon, 17 Jun 2019 17:51:36 +0000 (20:51 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 19 Jun 2019 09:38:34 +0000 (09:38 +0000)
Change DEFAULT_ENVELOPE_SENDER to a const struct smtp_address instead.
gcc 9 no longer stores compound literals in function scope, so this is
safer.

src/lda/main.c

index f4b371d7285a3e8e34b9b7b7e559f0d7de870809..3cd6b460050b9e285addb337b042decde6a2efff 100644 (file)
@@ -32,8 +32,9 @@
 #include <stdio.h>
 #include <sysexits.h>
 
-#define DEFAULT_ENVELOPE_SENDER \
-       SMTP_ADDRESS_LITERAL("MAILER-DAEMON", NULL)
+const struct smtp_address default_envelope_sender = {
+       "MAILER-DAEMON", NULL
+};
 
 /* After buffer grows larger than this, create a temporary file to /tmp
    where to read the mail. */
@@ -157,7 +158,7 @@ lda_raw_mail_open(struct mail_deliver_input *dinput, const char *path)
                                                    sets[0]);
 
        mail_from = (dinput->mail_from != NULL ?
-                    dinput->mail_from : DEFAULT_ENVELOPE_SENDER);
+                    dinput->mail_from : &default_envelope_sender);
        if (path == NULL) {
                input = create_raw_stream(dinput, 0, &mtime);
                i_stream_set_name(input, "stdin");