Mailing List Archive

How to cofigure exim config about spf
Hello, When I compiled exim, spf was enabled, and I used the libspf2 library. How can I configure spf in /etc/exim.conf, it is only setting CHECK_RCPT_SPF = true , and else ?
The exim config is below:
.ifdef CHECK_RCPT_SPF
deny
message = [SPF] $sender_host_address is not allowed to send mail from \
${if def:sender_address_domain {$sender_address_domain}{$sender_helo_name}}.
log_message = SPF check failed.
!acl = acl_local_deny_exceptions
condition = ${run{/usr/bin/spfquery.mail-spf-perl --ip \
${quote:$sender_host_address} --identity \
${if def:sender_address_domain \
{--scope mfrom --identity ${quote:$sender_address}}\
{--scope helo --identity ${quote:$sender_helo_name}}}}\
{no}{${if eq {$runrc}{1}{yes}{no}}}}
defer
message = Temporary DNS error while checking SPF record. Try again later.
!acl = acl_local_deny_exceptions
condition = ${if eq {$runrc}{5}{yes}{no}}


warn
condition = ${if <={$runrc}{6}{yes}{no}}
add_header = Received-SPF: ${if eq {$runrc}{0}{pass}\
{${if eq {$runrc}{2}{softfail}\
{${if eq {$runrc}{3}{neutral}\
{${if eq {$runrc}{4}{permerror}\
{${if eq {$runrc}{6}{none}{error}}}}}}}}}\
} client-ip=$sender_host_address; \
${if def:sender_address_domain \
{envelope-from=${sender_address}; }{}}\
helo=$sender_helo_name


warn
log_message = Unexpected error in SPF check.
condition = ${if >{$runrc}{6}{yes}{no}}
.endif


I find there is not exist about file which path is /usr/bin/spfquery.mail-spf-perl.


and the result of command aboout exim --version is below:
Exim version 4.96 #2 built 27-Dec-2022 11:45:39
Copyright (c) University of Cambridge, 1995 - 2018
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2022
Berkeley DB: Berkeley DB 5.3.28: (September 9, 2013)
Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc OpenSSL TLS_resume Content_Scanning DANE DKIM DMARC DNSSEC Event OCSP PIPECONNECT PRDR PROXY Queue_Ramp SOCKS SPF TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch ldap ldapdn ldapm nis nis0 passwd sqlite
Authenticators: cram_md5 cyrus_sasl dovecot gsasl plaintext spa tls
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Malware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Configuration file is /etc/exim/exim.conf




TomNewChao
Thanks







--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: How to cofigure exim config about spf [ In reply to ]
Hi,

TomNewChao via Exim-users <exim-users@exim.org> (Fr 10 Mär 2023 03:00:13 CET):
> Hello, When I compiled exim, spf was enabled, and I used the libspf2 library. How can I configure spf in /etc/exim.conf, it is only setting CHECK_RCPT_SPF = true , and else ?

> The exim config is below:
> .ifdef CHECK_RCPT_SPF
> deny

> condition = ${run{/usr/bin/spfquery.mail-spf-perl --ip \
> ${quote:$sender_host_address} --identity \
> ${if def:sender_address_domain \
> {--scope mfrom --identity ${quote:$sender_address}}\
> {--scope helo --identity ${quote:$sender_helo_name}}}}\
> {no}{${if eq {$runrc}{1}{yes}{no}}}}

If I'm not mistaken, this is nothing, the upstream provides. What's the
origin of this configuration?

> Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc OpenSSL TLS_resume Content_Scanning DANE DKIM DMARC DNSSEC Event OCSP PIPECONNECT PRDR PROXY Queue_Ramp SOCKS SPF TCP_Fast_Open

Since you've SPF compiled in, all you need to do is reading the Spec
file and configuring the *built-in* SPF functionality. No need for
external program invocations. The Spec, near section 58.4 contains
information on this topic.

https://www.exim.org/exim-html-current/doc/html/spec_html/ch-dkim_spf_srs_and_dmarc.html

Best regards from Dresden/Germany
Viele Grüße aus Dresden
Heiko Schlittermann
--
SCHLITTERMANN.de ---------------------------- internet & unix support -
Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
gnupg encrypted messages are welcome --------------- key ID: F69376CE -