Re: [exim] [exim-announce] Exim 4.95-RC2 released

2021-09-08 Thread Jeremy Harris via Exim-users

On 08/09/2021 10:14, David Restall via Exim-users wrote:

Granted (I did allude to this in the email) but what actually is the
problem that it is masking ?


The problem arises from a program of constification of the Exim source.
That is, using the 'C' const qualifer to mark up variables that we think
should not be modified, so that the compiler can a) static-check that
assertion, and b) possibly generate more efficient code.

It's a long and difficult job, and still in progress.  The filter modules
are particularly difficult because they were written in a different style,
and one I personally find rather abstruse.  So the current boundary of
the constification effort has reached those commented points.


 I didn't dig all the way through the code
and have no idea what the variables do (s ?  absolutely stupid name that
_REALLY_  helps debugging for instance) & why does it need to be const :-)


"s" is the project-standard name for a string pointer.  It generally has
a short lifetime.


)   If the comments are correct and losing track of const is known about
then surely it can't be a big problem


Wrong.


so why not just cast the result to
resolve the warning or remove the constness ?


Because the wish is to introduce, where appropriate, const-ness.


 If it's a big issue, then
innocuous comments are not helpful and the problem should be resolved.
Whichever way you look at it, it's sloppy code and that should not be
dismissed with a glib response.


Feel free to donate your time and expertise to the effort.
--
Cheers,
  Jeremy

--
## 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: [exim] Exim 4.95-RC2 released

2021-09-08 Thread Evgeniy Berdnikov via Exim-users
On Wed, Sep 08, 2021 at 09:50:54AM +0100, Jeremy Harris via Exim-users wrote:
> One item which would be useful to know: what "trust list" might have been
> involved during this callout.  The transport tls_verify_certificates option
> controls this.

 My config is based on Debian default configuration, which assigns
 "/etc/ssl/certs/ca-certificates.crt" to tls_verify_certificates
 (if this file exists). I have

-rw-r--r-- 1 root root 197624 Jan 24  2021 /etc/ssl/certs/ca-certificates.crt

 this file was here when Exim-4.92 was running without segfaults.
 File seems good, not truncated.
-- 
 Eugene Berdnikov

-- 
## 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: [exim] [exim-announce] Exim 4.95-RC2 released

2021-09-08 Thread David Restall via Exim-users
Hi,

> On 08/09/2021 09:01, David Restall via Exim-users wrote:
> > While compiling 4.95-RC2 I'm still seeing the following warnings emitted :-
> > 
> > cc filter.c
> > filter.c: In function 'interpret_commands':
> > filter.c:2018:23: warning: assignment discards 'const' qualifier from 
> > pointer target type [-Wdiscarded-qualifiers]
> >   2018 |  else headers_charset = s; /*XXX loses track of const */
> 
> These are expected and can be ignored.
> 
> > and the source compiles clean without warnings.
> 
> Unfortunately, you've only hidden the problem.

Granted (I did allude to this in the email) but what actually is the
problem that it is masking ?  I didn't dig all the way through the code
and have no idea what the variables do (s ?  absolutely stupid name that
_REALLY_ helps debugging for instance) & why does it need to be const :-)
)   If the comments are correct and losing track of const is known about
then surely it can't be a big problem so why not just cast the result to
resolve the warning or remove the constness ?  If it's a big issue, then
innocuous comments are not helpful and the problem should be resolved.
Whichever way you look at it, it's sloppy code and that should not be
dismissed with a glib response.

Regards,



D
lists/exim/users/2021-09-08.2.tx   exim-users
++
| Dave Restall, Computer Anorak, Geek, Cyclist, Radio Amateur G4FCU, Bodger  |
| Mob +44 (0) 7973 831245  Skype: dave.restall Radio: G4FCU  |
| email : d...@restall.net  - Anti-SocialMediaist -  Web : Not Ready Yet :-( |
+- QOTD -+
| New York now leads the world's great cities in the number of people|
| around whom you shouldn't make a sudden move.  |
| -- David Letterman |
++


> -- 
> Cheers,
>Jeremy
> 
> -- 
> ## 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/
> 

-- 
## 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: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread Cyborg via Exim-users

Am 08.09.21 um 09:31 schrieb MRob via Exim-users:



I'm not sure this is what you want but I have an "or" condition:

    condition = ${if or{\
  {match{$mime_content_type}{(?i)executable}}\

{match{$mime_filename}{\N(?i)\.(exe|com|vbs|bat|pif|scr|hta|js|cmd|chm|cpl|jsp|reg|vbe|lnk|dll|sys|btm|dat|msi|prf|vb)$\N}}\ 


  }}
Here I use mime type and filename extension.


I don't think you can put hosts or sender_domains in like that:
${if or{{hosts = ...}{sender_domains = ...}}}



Ofcourse not, you need to add those checks you need too:

or{
     {COND1}
 {COND2}
}

where COND can be one with FORANY/FORALL:

forany{}{}

   These conditions iterate over a list. The first argument is expanded
   to form the list. By default, the list separator is a colon, but it
   can be changed by the normal method (6.21
   
).
   The second argument is interpreted as a condition that is to be
   applied to each item in the list in turn. During the interpretation
   of the condition, the current list item is placed in a variable
   called $item.

 *

   For forany, interpretation stops if the condition is true for
   any item, and the result of the whole condition is true. If the
   condition is false for all items in the list, the overall
   condition is false.

 *

   For forall, interpretation stops if the condition is false for
   any item, and the result of the whole condition is false. If the
   condition is true for all items in the list, the overall
   condition is true.

   Note that negation of forany means that the condition must be false
   for all items for the overall condition to succeed, and negation of
   forall means that the condition must be false for at least one item.
   In this example, the list separator is changed to a comma:

   ${if forany{<, $recipients}{match{$item}{^user3@}}{yes}{no}}

that way, you can parse those lists and combine the results in an OR . I 
think MATCH or EQ are the compareoperators you need.



Best regards,

Marius


--
## 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: [exim] Exim 4.95-RC2 released

2021-09-08 Thread Jeremy Harris via Exim-users

On 08/09/2021 07:58, Evgeniy Berdnikov via Exim-users wrote:

  OK. Exim was recompiled with MISSING_POSIX_MEMALIGN.
  Segfaults are still here. I see no significant difference with old dumps.


Good to know.


  Fault happens on sender verify callout, in rcpt or pre-data ACLs.
  Here is the recent example, callout from acl_check_rcpt:

Reading symbols from /usr/sbin/exim4...
[New LWP 1352271]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/exim4 -bd -q1m'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xf7238b0d in _gnutls_trust_list_get_issuer (list=0x58441780,
 cert=0x59027530, issuer=0xffbec6a8, flags=0)
 at ../../../lib/x509/verify-high.c:1026


Looking at a current GnuTLS tree, hopefully not too different to
that used for your library version:

   1012 int _gnutls_trust_list_get_issuer(gnutls_x509_trust_list_t list,
   1013   gnutls_x509_crt_t cert,
   1014   gnutls_x509_crt_t * issuer,
   1015   unsigned int flags)
   1016 {
   1017 int ret;
   1018 unsigned int i;
   1019 size_t hash;
   1020
   1021 hash =
   1022 hash_pjw_bare(cert->raw_issuer_dn.data,
   1023   cert->raw_issuer_dn.size);
   1024 hash %= list->size;
   1025
   1026 for (i = 0; i < list->node[hash].trusted_ca_size; i++) {
   1027 ret =
   1028 gnutls_x509_crt_check_issuer(cert,
   1029  list->node[hash].
   1030  trusted_cas[i]);

... I'd say this is likely a problem internal to GnuTLS, not directly
down to something exim passed it.  You should involve the GnuTLS maintainers
at this point (but please keep me in the loop).


One item which would be useful to know: what "trust list" might have been
involved during this callout.  The transport tls_verify_certificates option
controls this.

--
Cheers,
  Jeremy

--
## 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: [exim] [exim-announce] Exim 4.95-RC2 released

2021-09-08 Thread Jeremy Harris via Exim-users

On 08/09/2021 09:01, David Restall via Exim-users wrote:

While compiling 4.95-RC2 I'm still seeing the following warnings emitted :-

cc filter.c
filter.c: In function 'interpret_commands':
filter.c:2018:23: warning: assignment discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
  2018 |  else headers_charset = s; /*XXX loses track of const */


These are expected and can be ignored.


and the source compiles clean without warnings.


Unfortunately, you've only hidden the problem.
--
Cheers,
  Jeremy

--
## 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: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread Jasen Betts via Exim-users
On 2021-09-08, MRob via Exim-users  wrote:
> On 2021-09-08 05:03, Jasen Betts via Exim-users wrote:
>> On 2021-09-07, MRob via Exim-users  wrote:
>>> Hellos, I was trying to write a clause that needs to combine
>>> 'sender_domains' and 'hosts' in *OR* condition so I can't put on two
>>> separate lines.
>>> 
>>> Is only way for this to repeat the full clause, once with 
>>> sender_domains
>>> and one with hosts?
>> 
>> 
>> if it was an accept or deny rule you could just have another
>> rule for the other condition
>> 
>> So it must be a require rule
>> 
>> change it to a deny rule and invert both conditions.
>> De Morgan's theorem.
>
> It's a deny rule, but I can't change it to accept because if it doesn't 
> match I want it to continue to the next clause.

make two deny rules.

deny sender_domains = +thing
 message = I don't like that domain
deny hosts = +thing
 message = I don't like that host

-- 
  Jasen.

-- 
## 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: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread Jeremy Harris via Exim-users

On 08/09/2021 08:31, MRob via Exim-users wrote:

I don't think you can put hosts or sender_domains in like that:
${if or{{hosts = ...}{sender_domains = ...}}}


No, but there are variables with the values you are interested
in, and operators for them, which you can build a condition from.
--
Cheers,
  Jeremy

--
## 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: [exim] [exim-announce] Exim 4.95-RC2 released

2021-09-08 Thread David Restall via Exim-users
Hi,

While compiling 4.95-RC2 I'm still seeing the following warnings emitted :-

cc filter.c
filter.c: In function 'interpret_commands':
filter.c:2018:23: warning: assignment discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 2018 |  else headers_charset = s; /*XXX loses track of const */
  |   ^
filter.c:2042:12: warning: assignment discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 2042 |   fmsg = expargs[0];  /*XXX loses track of const */
  |^
filter.c:2129:40: warning: assignment discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 2129 |if (i != mailarg_index_text) for (p = s; *p != 0; p++)
  |^
filter.c:2179:24: warning: assignment discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 2179 |commands->args[i].u = s; /*XXX loses track of const */
  |^
cc filtertest.c


I'm compiling using gcc on Alpine Linux :-

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/9.3.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-9.3.0/configure 
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info 
--build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl 
--target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 9.3.0' 
--enable-checking=release
--disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls 
--disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie 
--enable-default-ssp --enable-cloog-backend 
--enable-languages=c,c++,d,objc,fortran,ada --disable-libssp --disable-libmpx 
--disable-libmudflap
--disable-libsanitizer --enable-shared --enable-threads --enable-tls 
--with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 9.3.0 (Alpine 9.3.0) 

I modified the relevant lines in filter.c to cast the RHS :-

2018c2018
<   else headers_charset = (uschar *) s;/*XXX loses track of const */
---
>   else headers_charset = s;   /*XXX loses track of const */
2042c2042
<   fmsg = (uschar *) (expargs[0]); /*XXX loses track of const */
---
>   fmsg = expargs[0];  /*XXX loses track of const */
2129c2129
< if (i != mailarg_index_text) for (p = (uschar *) s; *p != 0; p++)
---
> if (i != mailarg_index_text) for (p = s; *p != 0; p++)
2179c2179
< commands->args[i].u = (uschar *) s;   /*XXX loses track of const */
---
> commands->args[i].u = s;  /*XXX loses track of const */

(I left the comments :-) )

and the source compiles clean without warnings.

Whether this breaks big stuff is unknown - my simple tests ran ok.

Regards,



D
lists/exim/users/2021-09-08.tx exim-users
++
| Dave Restall, Computer Anorak, Geek, Cyclist, Radio Amateur G4FCU, Bodger  |
| Mob +44 (0) 7973 831245  Skype: dave.restall Radio: G4FCU  |
| email : d...@restall.net  - Anti-SocialMediaist -  Web : Not Ready Yet :-( |
+- QOTD -+
| "You who hate the Jews so, why did you adopt their religion?"  |
| -- Friedrich Nietzsche, addressing anti-semitic|
| Christians |
++


-- 
## 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: [exim] Spurious DKIM failures

2021-09-08 Thread Evgeniy Berdnikov via Exim-users
On Tue, Sep 07, 2021 at 03:32:02PM +0100, Jeremy Harris via Exim-users wrote:
> 44a62f5861 looks relevant:
> 
> JH/59 DKIM: Fix small-message verification under TLS with chunking. If a
>   pipelined SMTP command followed the BDAT LAST then it would be
>   incorrectly treated as part of the message body, causing a verification
>   fail.

 PIPELINING is not advertised. I also studied smtp session in traffic
 dump: sender wait for replies and do not send commands ahead.

> ... except for:>   Removal of TLS layer does not help to prevent DKIM 
> failures.
> 
> Worth checking you have it, though.

 There are "P=esmtp" in log records and "with esmtp" in headers.
 I read traffic dumps for plain smtp connections.
-- 
 Eugene Berdnikov

-- 
## 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: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread MRob via Exim-users

On 2021-09-08 07:02, nb via Exim-users wrote:

Le 2021-09-08 06:46, MRob via Exim-users a écrit :

On 2021-09-08 05:03, Jasen Betts via Exim-users wrote:
> On 2021-09-07, MRob via Exim-users  wrote:
> > Hellos, I was trying to write a clause that needs to combine
> > 'sender_domains' and 'hosts' in *OR* condition so I can't put on two
> > separate lines.
> >
> > Is only way for this to repeat the full clause, once with
> > sender_domains
> > and one with hosts?
>
>
> if it was an accept or deny rule you could just have another
> rule for the other condition
>
> So it must be a require rule
>
> change it to a deny rule and invert both conditions.
> De Morgan's theorem.

It's a deny rule, but I can't change it to accept because if it 
doesn't

match I want it to continue to the next clause.

--
## 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/


Hi,

I'm not sure this is what you want but I have an "or" condition:

condition = ${if or{\
  {match{$mime_content_type}{(?i)executable}}\

{match{$mime_filename}{\N(?i)\.(exe|com|vbs|bat|pif|scr|hta|js|cmd|chm|cpl|jsp|reg|vbe|lnk|dll|sys|btm|dat|msi|prf|vb)$\N}}\
  }}
Here I use mime type and filename extension.


I don't think you can put hosts or sender_domains in like that:
${if or{{hosts = ...}{sender_domains = ...}}}

--
## 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: [exim] Exim 4.95-RC2 released

2021-09-08 Thread Evgeniy Berdnikov via Exim-users
On Tue, Sep 07, 2021 at 03:32:02PM +0100, Jeremy Harris via Exim-users wrote:
> Another test you could try is a build with
>  #define MISSING_POSIX_MEMALIGN
> in OS/os.h-Linux.
> If that still coredumps in the same place, it's not a "write
> to readonly data" trap; so more likely a null pointer.

 OK. Exim was recompiled with MISSING_POSIX_MEMALIGN.
 Segfaults are still here. I see no significant difference with old dumps.
 Fault happens on sender verify callout, in rcpt or pre-data ACLs.
 Here is the recent example, callout from acl_check_rcpt:

Reading symbols from /usr/sbin/exim4...
[New LWP 1352271]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/exim4 -bd -q1m'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xf7238b0d in _gnutls_trust_list_get_issuer (list=0x58441780, 
cert=0x59027530, issuer=0xffbec6a8, flags=0)
at ../../../lib/x509/verify-high.c:1026
#0  0xf7238b0d in _gnutls_trust_list_get_issuer (list=0x58441780, 
cert=0x59027530, issuer=0xffbec6a8, flags=0)
at ../../../lib/x509/verify-high.c:1026
ret = 
i = 0
hash = 1408224284
#1  0xf7238be6 in gnutls_x509_trust_list_get_issuer (list=0x58441780, 
cert=0x59027530, issuer=0xffbec6a8, flags=0)
at ../../../lib/x509/verify-high.c:1128
ret = 
__func__ = "gnutls_x509_trust_list_get_issuer"
#2  0xf7239613 in gnutls_x509_trust_list_verify_crt2 (list=0x58441780, 
cert_list=0xffbec6bc, cert_list_size=, data=0x0, 
elements=0, flags=33554432, voutput=0xffbec970, func=0x0)
at ../../../lib/x509/verify-high.c:1521
sorted_size = 
j = 
issuer = 0xffbec704
ret = 
i = 
hash = 
sorted = {0x59025230, 0x59027530, 0x5, 0x8c, 0xf73ffe7c , 
  0xffbec810, 0xf72022f6 <_gnutls_x509_crt_get_extension+6>, 
  0xf7375f0c, 0x4946dc00, 0x59027530, 0xf72a922d, 0xf73fb8fb, 
  0xf7375f0c, 0xf65428ec, 0x58da0540, 0x59027530}
retrieved = {0xf71ebedf , 0x585c0830, 0x0, 
  0xf7579885 <__errno_location+5>, 0xf71ebec1 , 
  0xf65428ec, 0x0, 0x0, 0x4946dc00, 0xf71ebea7 , 
  0xf7375f0c, 0x0, 
  0xf71c3f4c <_gnutls_ocsp_verify_mandatory_stapling+156>, 0x585c0830, 
  0x585c0830, 0x0}
retrieved_size = 0
hostname = 
purpose = 
email = 
hostname_size = 
have_set_name = 
saved_output = 
ip = {data = , size = }
cert_set = {node = , size = }
__func__ = "gnutls_x509_trust_list_verify_crt2"
__PRETTY_FUNCTION__ = "gnutls_x509_trust_list_verify_crt2"
#3  0xf71c4647 in _gnutls_x509_cert_verify_peers (session=0x58da0540, 
data=0x0, elements=0, status=0xffbec970) at ../../lib/cert-session.c:597
info = 
cred = 0x58441620
peer_certificate_list = 0x5840d9c0
resp = {data = 0x58d9fde0 "0\202\001\323\n\001", size = 471}
peer_certificate_list_size = 
i = 
x = 
ret = 
cand_issuers = 
cand_issuers_size = 
ocsp_status = 0
verify_flags = 
__func__ = "_gnutls_x509_cert_verify_peers"
#4  0xf71c4f3f in gnutls_certificate_verify_peers (session=0x58da0540, 
data=0x0, elements=0, status=0xffbec970) at ../../lib/cert-session.c:776
info = 
__func__ = "gnutls_certificate_verify_peers"
#5  0xf71c4fd0 in gnutls_certificate_verify_peers2 (session=0x58da0540, 
status=0xffbec970) at ../../lib/cert-session.c:653
No locals.
#6  0x566f288b in verify_certificate (state=, errstr=0xffbeca80)
at tls-gnu.c:2518
rc = 
verify = 1480842840
__FUNCTION__ = "verify_certificate"
#7  0x566f4b1b in tls_client_start (cctx=0x5900d248, conn_args=0x58ffd1ec, 
cookie=0x58d9e69c, tlsp=0x567d1ee0 , errstr=0xffbeca80)
at tls-gnu.c:3591
host = 0x584f4934
tb = 
ob = 0x5843dd6c
rc = 0
state = 0x5843efac
cipher_list = 
require_ocsp = 0
request_ocsp = 1
__FUNCTION__ = "tls_client_start"
#8  0x567265b6 in smtp_setup_conn (sx=, 
suppress_tls=) at smtp.c:2673
buffer2 = "220 2.0.0 SMTP server 
ready\000\360˾\377;\260>\367\354ʾ\377.\267tV\360˾\377\006\000\000\000\354ʾ\377\250GOX\027\000\000\000\250GOXprotecti.\267tV\250GOXok\003com\000V\000\000\000\000\001\200\255\373\250GOX\250GOX\250GOX\250GOX\265GOX\277GOX\250GOX\277GOX",
 '\000' , 
"\324\031}V\000\000\000\000\330\031}V\000\000\000\377\000\000\000\000(\023xV\001\000CM\374EOX\377\377\377\377",
 '\000' , "\377\377\377\377"...
ob = 
pass_message = 0
message = 0x0
yield = 0
tls_errstr = 0x0
__FUNCTION__ = "smtp_setup_conn"
#9  0x56700d46 in do_callout (pm_mailfrom=, 
se_mailfrom=, options=, 
callout_connect=, callout_overall=, 
callout=, tf=0xffbedde0, host_list=, 
addr=) at verify.c:677

Re: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread nb via Exim-users
Le 2021-09-08 06:46, MRob via Exim-users a écrit :
> On 2021-09-08 05:03, Jasen Betts via Exim-users wrote:
> > On 2021-09-07, MRob via Exim-users  wrote:
> > > Hellos, I was trying to write a clause that needs to combine
> > > 'sender_domains' and 'hosts' in *OR* condition so I can't put on two
> > > separate lines.
> > > 
> > > Is only way for this to repeat the full clause, once with
> > > sender_domains
> > > and one with hosts?
> > 
> > 
> > if it was an accept or deny rule you could just have another
> > rule for the other condition
> > 
> > So it must be a require rule
> > 
> > change it to a deny rule and invert both conditions.
> > De Morgan's theorem.
> 
> It's a deny rule, but I can't change it to accept because if it doesn't
> match I want it to continue to the next clause.
> 
> -- 
> ## 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/
> 
Hi,

I'm not sure this is what you want but I have an "or" condition:

condition = ${if or{\
  {match{$mime_content_type}{(?i)executable}}\
  
{match{$mime_filename}{\N(?i)\.(exe|com|vbs|bat|pif|scr|hta|js|cmd|chm|cpl|jsp|reg|vbe|lnk|dll|sys|btm|dat|msi|prf|vb)$\N}}\
  }}
Here I use mime type and filename extension.

-- 
## 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: [exim] Combine hosts/sender_domains in condition?

2021-09-08 Thread MRob via Exim-users

On 2021-09-08 05:03, Jasen Betts via Exim-users wrote:

On 2021-09-07, MRob via Exim-users  wrote:

Hellos, I was trying to write a clause that needs to combine
'sender_domains' and 'hosts' in *OR* condition so I can't put on two
separate lines.

Is only way for this to repeat the full clause, once with 
sender_domains

and one with hosts?



if it was an accept or deny rule you could just have another
rule for the other condition

So it must be a require rule

change it to a deny rule and invert both conditions.
De Morgan's theorem.


It's a deny rule, but I can't change it to accept because if it doesn't 
match I want it to continue to the next clause.


--
## 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/