]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: Move common Dovecot-specific definitions to smtp-dovecot.h.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 8 Oct 2021 10:40:48 +0000 (12:40 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 17 Jan 2022 11:52:09 +0000 (13:52 +0200)
src/lib-smtp/Makefile.am
src/lib-smtp/smtp-dovecot.h [new file with mode: 0644]
src/lmtp/lmtp-common.h
src/lmtp/lmtp-proxy.c

index a16dc68672fc02ae412b13ef75733c4f89011869..5b86281a8cae1ff46f40cb86179b570a535b515b 100644 (file)
@@ -66,7 +66,8 @@ headers = \
        smtp-server-private.h \
        smtp-server.h \
        smtp-submit-settings.h \
-       smtp-submit.h
+       smtp-submit.h \
+       smtp-dovecot.h
 
 pkginc_libdir=$(pkgincludedir)
 pkginc_lib_HEADERS = $(headers)
diff --git a/src/lib-smtp/smtp-dovecot.h b/src/lib-smtp/smtp-dovecot.h
new file mode 100644 (file)
index 0000000..4aacdee
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef SMTP_DOVECOT
+#define SMTP_DOVECOT
+
+#include "smtp-reply.h"
+
+#define SMTP_PROXY_REDIRECT_ENH_CODE     SMTP_REPLY_ENH_CODE(5, 2, 900)
+#define SMTP_PROXY_REDIRECT_ENH_CODE_STR "5.2.900"
+
+#endif
index 06732bd6a5fa2186673f4cd9082acfd72907f229..8e1729c109bfb367643043d32a647e19c89489a4 100644 (file)
@@ -14,9 +14,6 @@
 #define LMTP_RCPT_FORWARD_CAPABILITY "XRCPTFORWARD"
 #define LMTP_RCPT_FORWARD_PARAMETER  "XRCPTFORWARD"
 
-#define LMTP_RCPT_PROXY_REDIRECT_ENH_CODE SMTP_REPLY_ENH_CODE(5, 2, 900)
-#define LMTP_RCPT_PROXY_REDIRECT_ENH_CODE_STR "5.2.900"
-
 typedef void lmtp_client_created_func_t(struct client **client);
 
 extern lmtp_client_created_func_t *hook_client_created;
index 233b02ec600fe1c733af58f1381f2a3518889a05..9edc4d30bc354edec9e191189b9cf43a442fc0e4 100644 (file)
@@ -14,6 +14,7 @@
 #include "smtp-client.h"
 #include "smtp-client-connection.h"
 #include "smtp-client-transaction.h"
+#include "smtp-dovecot.h"
 #include "auth-proxy.h"
 #include "auth-master.h"
 #include "master-service-ssl-settings.h"
@@ -757,7 +758,7 @@ lmtp_proxy_rcpt_cb(const struct smtp_reply *proxy_reply,
                return;
 
        if (smtp_reply_code_equals(proxy_reply, 550,
-                                  LMTP_RCPT_PROXY_REDIRECT_ENH_CODE)) {
+                                  SMTP_PROXY_REDIRECT_ENH_CODE)) {
                lmtp_proxy_rcpt_redirect(lprcpt, proxy_reply);
                return;
        }
@@ -861,7 +862,7 @@ lmtp_proxy_rcpt_handle_not_proxied(struct lmtp_proxy_recipient *lprcpt,
                str_printfa(referral, "%s@", destuser);
        str_printfa(referral, "%s:%u", set->set.host, set->set.port);
        smtp_server_recipient_reply(
-               rcpt, 550, LMTP_RCPT_PROXY_REDIRECT_ENH_CODE_STR,
+               rcpt, 550, SMTP_PROXY_REDIRECT_ENH_CODE_STR,
                "%s Referral", str_c(referral));
        return -1;
 }