summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-04-08 21:33:51 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-04-12 23:29:45 +0100
commit9bfc60ebf1f86a212280c19a28bb4399e8fbb392 (patch)
tree7ac81534ffc5fe219ad356dc57ca512028fd0e8e /src
parent9671784a54a6729881f7716a0b963a0422e8b3dd (diff)
recipient verify callout
Diffstat (limited to 'src')
-rw-r--r--src/src/acl.c3
-rw-r--r--src/src/transports/smtp.c2
-rw-r--r--src/src/verify.c50
3 files changed, 52 insertions, 3 deletions
diff --git a/src/src/acl.c b/src/src/acl.c
index ea078f6fd..e16fbb989 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -4382,6 +4382,9 @@ if (where == ACL_WHERE_RCPT)
*log_msgptr = US"defer in percent_hack_domains check";
return DEFER;
}
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ addr->p.utf8 = message_smtputf8;
+#endif
deliver_domain = addr->domain;
deliver_localpart = addr->local_part;
}
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index ef2650a3e..c64885531 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -574,7 +574,7 @@ if (*errno_value == ERRNO_WRITEINCOMPLETE)
/* Handle lack of advertised SMTPUTF8, for international message */
if (*errno_value == ERRNO_UTF8_FWD)
{
- *message = US string_sprintf("utf8 support required for forwarding");
+ *message = US string_sprintf("utf8 support required but not offerred for forwarding");
DEBUG(D_deliver|D_transport) debug_printf("%s\n", *message);
return TRUE;
}
diff --git a/src/src/verify.c b/src/src/verify.c
index 678ee6315..e39b55db8 100644
--- a/src/src/verify.c
+++ b/src/src/verify.c
@@ -920,6 +920,25 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
}
}
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ else if ( addr->p.utf8
+ && !( esmtp
+ && ( regex_UTF8
+ || ( (regex_UTF8 = regex_must_compile(
+ US"\\n250[\\s\\-]SMTPUTF8(\\s|\\n|$)", FALSE, TRUE)),
+ TRUE
+ ) )
+ && pcre_exec(regex_UTF8, NULL, CS responsebuffer,
+ Ustrlen(responsebuffer), 0, PCRE_EOPT, NULL, 0) >= 0
+ ) )
+ {
+ HDEBUG(D_acl|D_v) debug_printf("utf8 required but not offered\n");
+ errno = ERRNO_UTF8_FWD;
+ setflag(addr, af_verify_nsfail);
+ done = FALSE;
+ }
+#endif
+
/* If we haven't authenticated, but are required to, give up. */
/* Try to AUTH */
@@ -937,7 +956,13 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
( (addr->auth_sndr = client_authenticated_sender),
/* Send the MAIL command */
- (smtp_write_command(&outblock, FALSE, "MAIL FROM:<%s>%s\r\n",
+ (smtp_write_command(&outblock, FALSE,
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ addr->p.utf8
+ ? "MAIL FROM:<%s>%s SMTPUTF8\r\n"
+ :
+#endif
+ "MAIL FROM:<%s>%s\r\n",
from_address, responsebuffer) >= 0)
) &&
@@ -1022,7 +1047,13 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer),
'2', callout) &&
- smtp_write_command(&outblock, FALSE, "MAIL FROM:<%s>\r\n",
+ smtp_write_command(&outblock, FALSE,
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ addr->p.utf8
+ ? "MAIL FROM:<%s> SMTPUTF8\r\n"
+ :
+#endif
+ "MAIL FROM:<%s>\r\n",
from_address) >= 0 &&
smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer),
'2', callout);
@@ -1146,6 +1177,21 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount.
HDEBUG(D_verify) debug_printf("SMTP timeout\n");
send_quit = FALSE;
}
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ else if (errno == ERRNO_UTF8_FWD)
+ {
+ extern int acl_where; /* src/acl.c */
+ errno = 0;
+ addr->message = string_sprintf(
+ "response to \"%s\" from %s [%s] did not include SMTPUTF8",
+ big_buffer, host->name, host->address);
+ addr->user_message = acl_where == ACL_WHERE_RCPT
+ ? US"533 mailbox name not allowed"
+ : US"550 mailbox unavailable";
+ yield = FAIL;
+ done = TRUE;
+ }
+#endif
else if (errno == 0)
{
if (*responsebuffer == 0) Ustrcpy(responsebuffer, US"connection dropped");