}
deliver_recipients = addr;
-deliver_address_data = addr->p.address_data;
-deliver_domain_data = addr->p.domain_data;
-deliver_localpart_data = addr->p.localpart_data;
+deliver_address_data = addr->prop.address_data;
+deliver_domain_data = addr->prop.domain_data;
+deliver_localpart_data = addr->prop.localpart_data;
/* These may be unset for multiple addresses */
s = string_append(s, &size, &ptr, 3, US" F=<", sender_address, US">");
#ifdef EXPERIMENTAL_SRS
-if(addr->p.srs_sender)
- s = string_append(s, &size, &ptr, 3, US" SRS=<", addr->p.srs_sender, US">");
+if(addr->prop.srs_sender)
+ s = string_append(s, &size, &ptr, 3, US" SRS=<", addr->prop.srs_sender, US">");
#endif
/* You might think that the return path must always be set for a successful
/* Handle returning options, but only if there is an address to return
the text to. */
- if (sender_address[0] != 0 || addr->p.errors_address != NULL)
+ if (sender_address[0] != 0 || addr->prop.errors_address != NULL)
{
if (tb->return_output)
{
if (!testflag(addr, af_ignore_error) &&
(addr->special_action == SPECIAL_FREEZE ||
- (sender_address[0] == 0 && addr->p.errors_address == NULL)
+ (sender_address[0] == 0 && addr->prop.errors_address == NULL)
))
{
frozen_info = (addr->special_action == SPECIAL_FREEZE)? US"" :
/* Set up the return path from the errors or sender address. If the transport
has its own return path setting, expand it and replace the existing value. */
-if(addr->p.errors_address != NULL)
- return_path = addr->p.errors_address;
+if(addr->prop.errors_address != NULL)
+ return_path = addr->prop.errors_address;
#ifdef EXPERIMENTAL_SRS
-else if(addr->p.srs_sender != NULL)
- return_path = addr->p.srs_sender;
+else if(addr->prop.srs_sender != NULL)
+ return_path = addr->prop.srs_sender;
#endif
else
return_path = sender_address;
(addr->flags & (af_pfr|af_file)) == (next->flags & (af_pfr|af_file)) &&
(!uses_lp || Ustrcmp(next->local_part, addr->local_part) == 0) &&
(!uses_dom || Ustrcmp(next->domain, addr->domain) == 0) &&
- same_strings(next->p.errors_address, addr->p.errors_address) &&
- same_headers(next->p.extra_headers, addr->p.extra_headers) &&
- same_strings(next->p.remove_headers, addr->p.remove_headers) &&
+ same_strings(next->prop.errors_address, addr->prop.errors_address) &&
+ same_headers(next->prop.extra_headers, addr->prop.extra_headers) &&
+ same_strings(next->prop.remove_headers, addr->prop.remove_headers) &&
same_ugid(tp, addr, next) &&
((addr->host_list == NULL && next->host_list == NULL) ||
(addr->host_list != NULL && next->host_list != NULL &&
if ( (multi_domain || Ustrcmp(next->domain, addr->domain) == 0)
&& tp == next->transport
&& same_hosts(next->host_list, addr->host_list)
- && same_strings(next->p.errors_address, addr->p.errors_address)
- && same_headers(next->p.extra_headers, addr->p.extra_headers)
+ && same_strings(next->prop.errors_address, addr->prop.errors_address)
+ && same_headers(next->prop.extra_headers, addr->prop.extra_headers)
&& same_ugid(tp, next, addr)
- && ( next->p.remove_headers == addr->p.remove_headers
- || ( next->p.remove_headers != NULL
- && addr->p.remove_headers != NULL
- && Ustrcmp(next->p.remove_headers, addr->p.remove_headers) == 0
+ && ( next->prop.remove_headers == addr->prop.remove_headers
+ || ( next->prop.remove_headers
+ && addr->prop.remove_headers
+ && Ustrcmp(next->prop.remove_headers, addr->prop.remove_headers) == 0
) )
&& ( !multi_domain
|| ( (
/* Compute the return path, expanding a new one if required. The old one
must be set first, as it might be referred to in the expansion. */
- if(addr->p.errors_address != NULL)
- return_path = addr->p.errors_address;
+ if(addr->prop.errors_address != NULL)
+ return_path = addr->prop.errors_address;
#ifdef EXPERIMENTAL_SRS
- else if(addr->p.srs_sender != NULL)
- return_path = addr->p.srs_sender;
+ else if(addr->prop.srs_sender != NULL)
+ return_path = addr->prop.srs_sender;
#endif
else
return_path = sender_address;
{
recipient_item *r = recipients_list + i;
address_item *new = deliver_make_addr(r->address, FALSE);
- new->p.errors_address = r->errors_to;
+ new->prop.errors_address = r->errors_to;
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ new->prop.utf8 = message_smtputf8;
+ DEBUG(D_deliver) debug_printf("utf8: %c\n", message_smtputf8 ? 'T':'F');
+#endif
if (r->pno >= 0)
new->onetime_parent = recipients_list[r->pno].address;
/* Just in case some router parameter refers to it. */
- return_path = (addr->p.errors_address != NULL)?
- addr->p.errors_address : sender_address;
+ return_path = (addr->prop.errors_address != NULL)?
+ addr->prop.errors_address : sender_address;
/* If a router defers an address, add a retry item. Whether or not to
use the local part in the key is a property of the router. */
if (addr_remote == addr &&
addr->router->same_domain_copy_routing &&
- addr->p.extra_headers == NULL &&
- addr->p.remove_headers == NULL &&
+ addr->prop.extra_headers == NULL &&
+ addr->prop.remove_headers == NULL &&
old_domain == addr->domain)
{
address_item **chain = &addr_route;
addr2->transport = addr->transport;
addr2->host_list = addr->host_list;
addr2->fallback_hosts = addr->fallback_hosts;
- addr2->p.errors_address = addr->p.errors_address;
+ addr2->prop.errors_address = addr->prop.errors_address;
copyflag(addr2, addr, af_hide_child | af_local_host_removed);
DEBUG(D_deliver|D_route)
addr_dsntmp = addr_succeed;
addr_senddsn = NULL;
-while(addr_dsntmp != NULL)
+while(addr_dsntmp)
{
- DEBUG(D_deliver)
- debug_printf("DSN: processing router : %s\n", addr_dsntmp->router->name);
-
- DEBUG(D_deliver)
- debug_printf("DSN: processing successful delivery address: %s\n", addr_dsntmp->address);
-
/* af_ignore_error not honored here. it's not an error */
-
- DEBUG(D_deliver) debug_printf("DSN: Sender_address: %s\n", sender_address);
- DEBUG(D_deliver) debug_printf("DSN: orcpt: %s flags: %d\n", addr_dsntmp->dsn_orcpt, addr_dsntmp->dsn_flags);
- DEBUG(D_deliver) debug_printf("DSN: envid: %s ret: %d\n", dsn_envid, dsn_ret);
- DEBUG(D_deliver) debug_printf("DSN: Final recipient: %s\n", addr_dsntmp->address);
- DEBUG(D_deliver) debug_printf("DSN: Remote SMTP server supports DSN: %d\n", addr_dsntmp->dsn_aware);
+ DEBUG(D_deliver)
+ {
+ debug_printf("DSN: processing router : %s\n"
+ "DSN: processing successful delivery address: %s\n"
+ "DSN: Sender_address: %s\n"
+ "DSN: orcpt: %s flags: %d\n"
+ "DSN: envid: %s ret: %d\n"
+ "DSN: Final recipient: %s\n"
+ "DSN: Remote SMTP server supports DSN: %d\n",
+ addr_dsntmp->router->name,
+ addr_dsntmp->address,
+ sender_address,
+ addr_dsntmp->dsn_orcpt, addr_dsntmp->dsn_flags,
+ dsn_envid, dsn_ret,
+ addr_dsntmp->address,
+ addr_dsntmp->dsn_aware
+ );
+ }
/* send report if next hop not DSN aware or a router flagged "last DSN hop"
and a report was requested */
- if (((addr_dsntmp->dsn_aware != dsn_support_yes) ||
- ((addr_dsntmp->dsn_flags & rf_dsnlasthop) != 0))
- &&
- (((addr_dsntmp->dsn_flags & rf_dsnflags) != 0) &&
- ((addr_dsntmp->dsn_flags & rf_notify_success) != 0)))
+ if ( ( addr_dsntmp->dsn_aware != dsn_support_yes
+ || addr_dsntmp->dsn_flags & rf_dsnlasthop
+ )
+ && addr_dsntmp->dsn_flags & rf_dsnflags
+ && addr_dsntmp->dsn_flags & rf_notify_success
+ )
{
/* copy and relink address_item and send report with all of them at once later */
address_item *addr_next;
addr_senddsn->next = addr_next;
}
else
- {
- DEBUG(D_deliver) debug_printf("DSN: *** NOT SENDING DSN SUCCESS Message ***\n");
- }
+ DEBUG(D_deliver) debug_printf("DSN: not sending DSN success message\n");
addr_dsntmp = addr_dsntmp->next;
}
-if (addr_senddsn != NULL)
+if (addr_senddsn)
{
pid_t pid;
int fd;
If neither of these cases obtains, something has gone wrong. Log the
incident, but then ignore the error. */
- if (sender_address[0] == 0 && addr_failed->p.errors_address == NULL)
+ if (sender_address[0] == 0 && addr_failed->prop.errors_address == NULL)
{
- if (!testflag(addr_failed, af_retry_timedout) &&
- !testflag(addr_failed, af_ignore_error))
+ if ( !testflag(addr_failed, af_retry_timedout)
+ && !testflag(addr_failed, af_ignore_error))
{
log_write(0, LOG_MAIN|LOG_PANIC, "internal error: bounce message "
"failure is neither frozen nor ignored (it's been ignored)");
mark the recipient done. */
if ( testflag(addr_failed, af_ignore_error)
- || ( ((addr_failed->dsn_flags & rf_dsnflags) != 0)
- && ((addr_failed->dsn_flags & rf_notify_failure) != rf_notify_failure))
+ || ( addr_failed->dsn_flags & rf_dsnflags
+ && (addr_failed->dsn_flags & rf_notify_failure) != rf_notify_failure)
)
{
addr = addr_failed;
else
{
- bounce_recipient = addr_failed->p.errors_address
- ? addr_failed->p.errors_address : sender_address;
+ bounce_recipient = addr_failed->prop.errors_address
+ ? addr_failed->prop.errors_address : sender_address;
/* Make a subprocess to send a message */
paddr = &addr_failed;
for (addr = addr_failed; addr != NULL; addr = *paddr)
- if (Ustrcmp(bounce_recipient, addr->p.errors_address
- ? addr->p.errors_address : sender_address) == 0)
+ if (Ustrcmp(bounce_recipient, addr->prop.errors_address
+ ? addr->prop.errors_address : sender_address) == 0)
{ /* The same - dechain */
*paddr = addr->next;
*pmsgchain = addr;
}
/* output machine readable part */
- fprintf(f, "--%s\n"
- "Content-type: message/delivery-status\n\n"
- "Reporting-MTA: dns; %s\n",
- bound, smtp_active_hostname);
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ if (message_smtputf8)
+ fprintf(f, "--%s\n"
+ "Content-type: message/global-delivery-status\n\n"
+ "Reporting-MTA: dns; %s\n",
+ bound, smtp_active_hostname);
+ else
+#endif
+ fprintf(f, "--%s\n"
+ "Content-type: message/delivery-status\n\n"
+ "Reporting-MTA: dns; %s\n",
+ bound, smtp_active_hostname);
if (dsn_envid)
{
}
}
- fputs(topt & topt_no_body ? "Content-type: text/rfc822-headers\n\n"
- : "Content-type: message/rfc822\n\n",
- f);
+#ifdef EXPERIMENTAL_INTERNATIONAL
+ if (message_smtputf8)
+ fputs(topt & topt_no_body ? "Content-type: message/global-headers\n\n"
+ : "Content-type: message/global\n\n",
+ f);
+ else
+#endif
+ fputs(topt & topt_no_body ? "Content-type: text/rfc822-headers\n\n"
+ : "Content-type: message/rfc822\n\n",
+ f);
fflush(f);
transport_filter_argv = NULL; /* Just in case */
DEBUG(D_deliver) debug_printf("one_time: adding %s in place of %s\n",
otaddr->address, otaddr->parent->address);
receive_add_recipient(otaddr->address, t);
- recipients_list[recipients_count-1].errors_to = otaddr->p.errors_address;
+ recipients_list[recipients_count-1].errors_to = otaddr->prop.errors_address;
tree_add_nonrecipient(otaddr->parent->address);
update_spool = TRUE;
}
if (sender_address[0] != 0)
{
- if (addr->p.errors_address == NULL)
+ if (addr->prop.errors_address == NULL)
{
if (Ustrstr(recipients, sender_address) == NULL)
recipients = string_sprintf("%s%s%s", recipients,
}
else
{
- if (Ustrstr(recipients, addr->p.errors_address) == NULL)
+ if (Ustrstr(recipients, addr->prop.errors_address) == NULL)
recipients = string_sprintf("%s%s%s", recipients,
- (recipients[0] == 0)? "" : ",", addr->p.errors_address);
+ (recipients[0] == 0)? "" : ",", addr->prop.errors_address);
}
}
}
regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
#endif
+#ifdef SUPPORT_TLS
+if (!regex_UTF8) regex_UTF8 =
+ regex_must_compile(US"\\n250[\\s\\-]SMTPUTF8(\\s|\\n|$)", FALSE, TRUE);
+#endif
+
if (!regex_DSN) regex_DSN =
regex_must_compile(US"\\n250[\\s\\-]DSN(\\s|\\n|$)", FALSE, TRUE);
}
+uschar *
+deliver_get_sender_address (uschar * id)
+{
+if (!spool_open_datafile(id))
+ return NULL;
+
+sprintf(CS spoolname, "%s-H", id);
+if (spool_read_header(spoolname, TRUE, TRUE) != spool_read_OK)
+ return NULL;
+
+(void)close(deliver_datafile);
+deliver_datafile = -1;
+
+return sender_address;
+}
+
/* vi: aw ai sw=2
*/
/* End of deliver.c */