setting from the transport, when there is one.
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.397 2006/09/25 10:14:20 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.398 2006/09/25 11:25:37 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/10 Added the log_reject_target ACL modifier to specify where to log
rejections.
+PH/11 Callouts were setting the name used for EHLO/HELO from $smtp_active_
+ hostname. This is wrong, because it relates to the incoming message (and
+ probably the interface on which it is arriving) and not to the outgoing
+ callout (which could be using a different interface). This has been
+ changed to use the value of the helo_data option from the smtp transport
+ instead - this is what is used when a message is actually being sent. If
+ there is no remote transport (possible with a router that sets up host
+ addresses), $smtp_active_hostname is used.
Exim version 4.63
-$Cambridge: exim/src/README.UPDATING,v 1.12 2006/07/13 13:53:33 ph10 Exp $
+$Cambridge: exim/src/README.UPDATING,v 1.13 2006/09/25 11:25:37 ph10 Exp $
This document contains detailed information about incompatibilities that might
be encountered when upgrading from one release of Exim to another. The
that might affect a running system.
+Exim version 4.64
+-----------------
+
+1. Callouts were setting the name used for EHLO/HELO from $smtp_active_
+hostname. This is wrong, because it relates to the incoming message (and
+probably the interface on which it is arriving) and not to the outgoing
+callout (which could be using a different interface). This has been
+changed to use the value of the helo_data option from the smtp transport
+instead - this is what is used when a message is actually being sent. If
+there is no remote transport (possible with a router that sets up host
+addresses), $smtp_active_hostname is used. This change is mentioned here in
+case somebody is relying on the use of $smtp_active_hostname.
+
+
Exim version 4.63
-----------------
-/* $Cambridge: exim/src/src/structs.h,v 1.11 2006/09/19 11:28:45 ph10 Exp $ */
+/* $Cambridge: exim/src/src/structs.h,v 1.12 2006/09/25 11:25:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *port;
uschar *protocol;
uschar *hosts;
+ uschar *helo_data;
BOOL hosts_override;
BOOL hosts_randomize;
BOOL gethostbyname;
-/* $Cambridge: exim/src/src/transports/smtp.c,v 1.25 2006/03/09 15:10:16 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/smtp.c,v 1.26 2006/09/25 11:25:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
but before running it in a sub-process. It is used for two things:
(1) To set the fallback host list in addresses, when delivering.
- (2) To pass back the interface, port, and protocol options, for use during
- callout verification.
+ (2) To pass back the interface, port, protocol, and other options, for use
+ during callout verification.
Arguments:
tblock pointer to the transport instance block
tf->gethostbyname = ob->gethostbyname;
tf->qualify_single = ob->dns_qualify_single;
tf->search_parents = ob->dns_search_parents;
+ tf->helo_data = ob->helo_data;
}
/* Set the fallback host list for all the addresses that don't have fallback
-/* $Cambridge: exim/src/src/verify.c,v 1.38 2006/09/05 13:24:10 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.39 2006/09/25 11:25:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
int host_af;
int port = 25;
BOOL send_quit = TRUE;
+ uschar *active_hostname = smtp_active_hostname;
uschar *helo = US"HELO";
uschar *interface = NULL; /* Outgoing interface to use; NULL => any */
uschar inbuffer[4096];
log_write(0, LOG_MAIN|LOG_PANIC, "<%s>: %s", addr->address,
addr->message);
+ /* Expand the helo_data string to find the host name to use. */
+
+ if (tf->helo_data != NULL)
+ {
+ uschar *s = expand_string(tf->helo_data);
+ if (active_hostname == NULL)
+ log_write(0, LOG_MAIN|LOG_PANIC, "<%s>: failed to expand transport's "
+ "helo_data value for callout: %s", expand_string_message);
+ else active_hostname = s;
+ }
+
deliver_host = deliver_host_address = NULL;
deliver_domain = save_deliver_domain;
smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer),
'2', callout) &&
smtp_write_command(&outblock, FALSE, "%s %s\r\n", helo,
- smtp_active_hostname) >= 0 &&
+ active_hostname) >= 0 &&
smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer),
'2', callout);
{
host_item *host_list = addr->host_list;
- /* Default, if no remote transport, to NULL for the interface (=> any),
- "smtp" for the port, and "smtp" for the protocol. */
-
- transport_feedback tf = { NULL, US"smtp", US"smtp", NULL, FALSE, FALSE };
+ /* Make up some data for use in the case where there is no remote
+ transport. */
+
+ transport_feedback tf = {
+ NULL, /* interface (=> any) */
+ US"smtp", /* port */
+ US"smtp", /* protocol */
+ NULL, /* hosts */
+ US"$smtp_active_hostname", /* helo_data */
+ FALSE, /* hosts_override */
+ FALSE, /* hosts_randomize */
+ FALSE, /* gethostbyname */
+ TRUE, /* qualify_single */
+ FALSE /* search_parents */
+ };
/* If verification yielded a remote transport, we want to use that
transport's options, so as to mimic what would happen if we were really
--- /dev/null
+# Exim test configuration 0540
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+rfc1413_query_timeout = 0s
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = check_rcpt
+
+queue_only
+
+
+# ----- ACLs -----
+
+begin acl
+
+check_rcpt:
+ accept verify = recipient/callout
+
+
+# ----- Routers -----
+
+begin routers
+
+r1:
+ driver = accept
+ transport = ${if match {$domain}{^yes}{t1}{t2}}
+
+
+# ----- Transports -----
+
+begin transports
+
+t1:
+ driver = smtp
+ hosts = 127.0.0.1
+ port = PORT_S
+ allow_localhost
+ helo_data = ${if eq{$domain}{yes1}{localhost}{aname}}
+
+t2:
+ driver = smtp
+ hosts = 127.0.0.1
+ port = PORT_S
+ allow_localhost
+
+# End
--- /dev/null
+# Affixes in RCPT commands for recipient callouts
+need_ipv4
+#
+server PORT_S 4
+220 Welcome
+HELO
+250 Hi
+MAIL FROM
+250 OK
+RCPT TO
+250 OK
+QUIT
+250 OK
+*eof
+220 Welcome
+HELO
+250 Hi
+MAIL FROM
+250 OK
+RCPT TO
+250 OK
+QUIT
+250 OK
+*eof
+220 Welcome
+HELO
+250 Hi
+MAIL FROM
+250 OK
+RCPT TO
+250 OK
+QUIT
+250 OK
+*eof
+220 Welcome
+HELO
+250 Hi
+MAIL FROM
+250 OK
+RCPT TO
+250 OK
+QUIT
+250 OK
+****
+exim -odq -bs
+mail from:<>
+RCPT TO:<abc@yes1>
+RCPT TO:<def@yes2>
+RCPT TO:<abc@no>
+RCPT TO:<def@no>
+quit
+****
--- /dev/null
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250 OK\r
+250 Accepted\r
+250 Accepted\r
+250 Accepted\r
+250 Accepted\r
+221 myhost.test.ex closing connection\r
+
+******** SERVER ********
+Listening on port 1224 ...
+Connection request from [127.0.0.1]
+220 Welcome
+HELO localhost
+250 Hi
+MAIL FROM:<>
+250 OK
+RCPT TO:<abc@yes1>
+250 OK
+QUIT
+250 OK
+Expected EOF read from client
+Listening on port 1224 ...
+Connection request from [127.0.0.1]
+220 Welcome
+HELO aname
+250 Hi
+MAIL FROM:<>
+250 OK
+RCPT TO:<def@yes2>
+250 OK
+QUIT
+250 OK
+Expected EOF read from client
+Listening on port 1224 ...
+Connection request from [127.0.0.1]
+220 Welcome
+HELO myhost.test.ex
+250 Hi
+MAIL FROM:<>
+250 OK
+RCPT TO:<abc@no>
+250 OK
+QUIT
+250 OK
+Expected EOF read from client
+Listening on port 1224 ...
+Connection request from [127.0.0.1]
+220 Welcome
+HELO myhost.test.ex
+250 Hi
+MAIL FROM:<>
+250 OK
+RCPT TO:<def@no>
+250 OK
+QUIT
+250 OK
+End of script