#ifdef WITH_CONTENT_SCAN
malware_init();
#endif
+#ifdef SUPPORT_SPF
+spf_init();
+#endif
/* Close the log so it can be renamed and moved. In the few cases below where
this long-running process writes to the log (always exceptional conditions), it
#ifdef SUPPORT_SPF
/* set up SPF context */
- spf_init(sender_helo_name, sender_host_address);
+ spf_conn_init(sender_helo_name, sender_host_address);
#endif
/* Apply an ACL check if one is defined; afterwards, recheck
-/* spf_init sets up a context that can be re-used for several
- messages on the same SMTP connection (that come from the
- same host with the same HELO string).
-XXX the spf_server layer could usefully be separately init'd
-given that it sets up a dns cache.
-Return: Boolean success */
+/* Construct the SPF library stack.
+ Return: Boolean success.
+*/
BOOL
-spf_init(uschar *spf_helo_domain, uschar *spf_remote_addr)
+spf_init(void)
{
-int debug = 0;
SPF_dns_server_t * dc;
+int debug = 0;
-DEBUG(D_receive)
- {
- debug_printf("spf_init: %s %s\n", spf_helo_domain, spf_remote_addr);
- debug = 1;
- }
+DEBUG(D_receive) debug = 1;
/* We insert our own DNS access layer rather than letting the spf library
do it, so that our dns access path is used for debug tracing and for the
DEBUG(D_receive) debug_printf("spf: SPF_server_new() failed.\n");
return FALSE;
}
+return TRUE;
+}
+
+
+/* Set up a context that can be re-used for several
+ messages on the same SMTP connection (that come from the
+ same host with the same HELO string).
+
+Return: Boolean success
+*/
+
+BOOL
+spf_conn_init(uschar * spf_helo_domain, uschar * spf_remote_addr)
+{
+DEBUG(D_receive)
+ debug_printf("spf_conn_init: %s %s\n", spf_helo_domain, spf_remote_addr);
+
+if (!spf_server && !spf_init()) return FALSE;
if (SPF_server_set_rec_dom(spf_server, CS primary_hostname))
{
} spf_result_id;
/* prototypes */
-BOOL spf_init(uschar *,uschar *);
+BOOL spf_init(void);
+BOOL spf_conn_init(uschar *, uschar *);
int spf_process(const uschar **, uschar *, int);
#define SPF_PROCESS_NORMAL 0
sender_fullhost = (test) [127.0.0.1]
sender_rcvhost = [127.0.0.1] (helo=test)
set_process_info: pppp handling incoming connection from (test) [127.0.0.1]
-spf_init: test 127.0.0.1
+spf_conn_init: test 127.0.0.1
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
sender_fullhost = ([V4NET.2.3.4]) [V4NET.2.3.4]
sender_rcvhost = [V4NET.2.3.4]
set_process_info: pppp handling incoming connection from ([V4NET.2.3.4]) [V4NET.2.3.4]
-spf_init: [V4NET.2.3.4] V4NET.2.3.4
+spf_conn_init: [V4NET.2.3.4] V4NET.2.3.4
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
sender_fullhost = host.name.tld [V4NET.2.3.4]
sender_rcvhost = host.name.tld ([V4NET.2.3.4])
set_process_info: pppp handling incoming connection from host.name.tld [V4NET.2.3.4]
-spf_init: [V4NET.2.3.4] V4NET.2.3.4
+spf_conn_init: [V4NET.2.3.4] V4NET.2.3.4
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
sender_fullhost = (something) [V4NET.0.0.0]
sender_rcvhost = [V4NET.0.0.0] (helo=something)
set_process_info: pppp handling incoming connection from (something) [V4NET.0.0.0]
-spf_init: something V4NET.0.0.0
+spf_conn_init: something V4NET.0.0.0
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 port 1226
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 port 1226
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:1228 port 1225 (IPv4) port 1226 (IPv4)
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [127.0.0.1]:1228 port 1225 (IPv4) port 1226 (IPv4)
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 port 1226 [127.0.0.1]:1228
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 port 1226 [127.0.0.1]:1228
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:1228 port 1227 (IPv4)
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [127.0.0.1]:1228 port 1227 (IPv4)
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 port 1226
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 port 1226
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
sender_fullhost = ([1.2.3.4]) [1.2.3.4]
sender_rcvhost = [1.2.3.4]
set_process_info: pppp handling incoming connection from ([1.2.3.4]) [1.2.3.4]
-spf_init: [1.2.3.4] 1.2.3.4
+spf_conn_init: [1.2.3.4] 1.2.3.4
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
SMTP>> 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
smtp_setup_msg entered
SMTP<< ehlo x.y
-spf_init: x.y NULL
+spf_conn_init: x.y NULL
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4)
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4)
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4)
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4)
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv6 and IPv4) [127.0.0.1]:1228
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:{1225,1226}
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [ip6:ip6:ip6:ip6:ip6:ip6:ip6:ip6]:{1225,1226}
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1227 (IPv6 and IPv4) [127.0.0.1]:1228
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1227 (IPv6 and IPv4) [127.0.0.1]:1228
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on [127.0.0.1]:{1227,1225}
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on [127.0.0.1]:{1227,1225}
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
Exim version x.yz ....
LOG: MAIN
exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv4)
set_process_info: pppp daemon(x.yz): no queue runs, listening for SMTP on port 1225 (IPv6 and IPv4) port 1226 (IPv4)
+SPF_dns_exim_new
+spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
+spf_compile.c:1210 Debug: Compiling record v=spf1
daemon running with uid=EXIM_UID gid=EXIM_GID euid=EXIM_UID egid=EXIM_GID
Listening...
sender_fullhost = (testing.testing) [10.0.0.5]
sender_rcvhost = [10.0.0.5] (helo=testing.testing ident=CALLER)
set_process_info: pppp handling incoming connection from (testing.testing) [10.0.0.5] U=CALLER
-spf_init: testing.testing 10.0.0.5
+spf_conn_init: testing.testing 10.0.0.5
SPF_dns_exim_new
spf_compile.c:523 Debug: Parsing macro starting at Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}
spf_compile.c:1210 Debug: Compiling record v=spf1