Add:
    set acl_m0 = authorizedrelay

to the acl policy that allows authenticated users to relay. (this sets a
internal variable that tells the ACL data stage to know if youre an
authenticated user or not)

directly after that policy that accept's authenticated users, add:

  deny
    message = 5.7.0 You can't spoof the domains this server is authorative
for
    sender_domains = ^(?i).*(mydomain.pl)\$

in the ACL data stage, add this before accept:

  deny
    message = 5.7.0 You can't spoof the MIME From this server is authorative
for
    condition = ${if match
{$h_from:}{(?i)@([a-zA-Z0-9_.\\-]*\\.)?(mydomain.pl)}{yes}{no}}
    condition = ${if eq {$acl_m0}{authorizedrelay}{no}{yes}}


Change $acl_m0 to $acl_m1 -  $acl_m9 in both places if $acl_m0 is already in
use in your ACL.


-----Ursprungligt meddelande-----
Från: Sławomir Dworaczek via Exim-users <exim-users@exim.org> 
Skickat: den 10 mars 2021 10:40
Till: exim-users@exim.org
Ämne: [exim] Spam from my domain to my domain email

Helo
How to protect exim to send email from my domain address to my domain
address without authentication
eg:

Return-path: <i...@safetybuddy.com>
Envelope-to: juzek.no...@mydomain.pl
Delivery-date: Wed, 10 Mar 2021 10:02:44 +0100
Received: from exim by mydomain.pl with bogodone (Exim 4.93)  (envelope-from
<i...@safetybuddy.com>)  id 1lJujs-00049H-Av  for juzek.no...@mydomain.pl;
Wed, 10 Mar 2021 10:02:44 +0100
Received: from p3plsmtp27-01-2.prod.phx3.secureserver.net ([216.69.139.46]
helo=p3plwbeout27-01.prod.phx3.secureserver.net)
 by mydomain.pl with esmtps  (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 (Exim 4.93)
 (envelope-from <i...@safetybuddy.com>)
 id 1lJujs-0003mf-1C
 for juzek.no...@mydomain.pl; Wed, 10 Mar 2021 10:02:44 +0100
Received: from p3plgemwbe27-01.prod.phx3.secureserver.net ([10.36.136.31])
by :WBEOUT: with SMTP  id Jujpl5OsWm3c4JujplAPv6; Wed, 10 Mar 2021 02:02:41
-0700
X-CMAE-Analysis: v=2.4 cv=TeBTCTch c=1 sm=1 tr=0 ts=60488b31
 a=wyIkHV4v9QDcqtJhzmByXA==:117 a=2b_dFAs2WcwA:10 a=yT060k1ugl4A:10
 a=IkcTkHD0fZMA:10 a=dESyimp9J3IA:10 a=5KLPUuaC_9wA:10 a=M51BFTxLslgA:10
 a=eV_4nOGc5AJVSHDehnAA:9 a=VefRpMSl6GughBNr:21 a=_W_S_7VecoQA:10
 a=QEXdDO2ut3YA:10 a=pHzHmUro8NiASowvMSCR:22 a=nt3jZW36AmriUCFCBwmW:22
X-SECURESERVER-ACCT: i...@safetybuddy.com
X-SID: Jujpl5OsWm3c4
Received: (qmail 42421 invoked by uid 99); 10 Mar 2021 09:02:41 -0000
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="utf-8"
X-Originating-IP: 212.102.39.214
User-Agent: Workspace Webmail 6.12.1
Message-Id:
<20210310020239.e1536fe1894a0ef27b11a46a86e6f374.185060f371....@email27.goda
ddy.com>
From: "=?UTF-8?Adam Kowalski=" <a...@mydomain.pl>
X-Sender: i...@safetybuddy.com
Reply-To: "=?UTF-8?Q?Gra=C5=BCyna=20Nelip?=" <jbr...@brockenv.com>
To: "juzek.no...@mydomain.pl" <juzek.no...@mydomain.pl>
Subject: =?UTF-8?Q?P=C5=82atno=C5=9B=C4=87?=
Date: Wed, 10 Mar 2021 02:02:39 -0700
Mime-Version: 1.0
X-CMAE-Envelope:
MS4xfM1khj8mtbitISY7EfIOLC25y2X6Qkx2wpq7eBA2TKiRf5G4GQqRBHPQ7YMZIVaoV239VZQG
ueIZMZx1QUwa1fChLFereIX+4DxI7/T6j4xE0HuI6i5Y
 
MbtDlhfDhaKeQ7H83WmB1FnysX+S7h2AZP+nCMC65Lmgll0oxDuShJHMnl2reKaHzwRWgqI9jlu6
0FtOfE6g1LttS7KDK/MhDLnO27f++a/uJjWe2379pLbx
X-Bogofilterd: true
X-Bogosity: Ham, tests=bogofilter, spamicity=0.132100, version=1.2.5

regards
Slawek


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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to