From: Stephan Bosch Date: Fri, 8 Oct 2021 10:40:48 +0000 (+0200) Subject: lib-smtp: Move common Dovecot-specific definitions to smtp-dovecot.h. X-Git-Tag: 2.4.0~4716 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c1eb26994a015778de346b2dba5b1294cab9c88;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: Move common Dovecot-specific definitions to smtp-dovecot.h. --- diff --git a/src/lib-smtp/Makefile.am b/src/lib-smtp/Makefile.am index a16dc68672..5b86281a8c 100644 --- a/src/lib-smtp/Makefile.am +++ b/src/lib-smtp/Makefile.am @@ -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 index 0000000000..4aacdeebba --- /dev/null +++ b/src/lib-smtp/smtp-dovecot.h @@ -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 diff --git a/src/lmtp/lmtp-common.h b/src/lmtp/lmtp-common.h index 06732bd6a5..8e1729c109 100644 --- a/src/lmtp/lmtp-common.h +++ b/src/lmtp/lmtp-common.h @@ -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; diff --git a/src/lmtp/lmtp-proxy.c b/src/lmtp/lmtp-proxy.c index 233b02ec60..9edc4d30bc 100644 --- a/src/lmtp/lmtp-proxy.c +++ b/src/lmtp/lmtp-proxy.c @@ -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; }