<div dir='auto'>Dear Bilal,<div dir="auto"><br></div><div dir="auto">First upgrade everything to the latest versions.</div><div dir="auto"><br></div><div dir="auto">MailScanner  = 5.1.3</div><div dir="auto">spamassassin = 3.4.2<br><br>One way to get this working</div><div dir="auto"><br></div><div dir="auto">Set up an extra SMTP server on your internal network. Make sure this server can not be reached from the internet.</div><div dir="auto">Whitelist the extra SMTP server in Mailscanner based on its IP address</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div data-smartmail="gmail_signature" dir="auto"><br>Met vriendelijke groet, Best regards,<br><br><br><br>Thom van der Boon<br>E-Mail: thom@vdb.nl<br><br><br><br><br>=====<br><br><br><br><br>Thom.H. van der Boon b.v.<br>Transito 4<br><br>6909 DA  Babberich<br>Tel.: +31 (0)88 4272727<br>Fax: +31 (0)88 4272789<br>Home Page: http://www.vdb.nl/</div></div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Op 6 mei 2019 17:26 schreef bilal.ahmed@kfueit.edu.pk:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><p>Dear Experts,</p><p> </p><p>First of all thanks for your advice , exactly you people are right that I whitelist all my domain it lets the spammers forge email address with my domain email address to get pass through.</p><p> </p><p>My MTA Postfix  , IMAP Server is Cyrus,  <span style="font-size:9pt;font-family:'verdana' , sans-serif;color:black">Postfix Version: 3.1.0 </span><span style="font-size:9pt;font-family:'verdana' , sans-serif;color:black">, </span><span style="font-size:9pt;font-family:'verdana' , sans-serif;color:black">MailScanner Version: 5.0.7</span><span style="font-size:9pt;font-family:'verdana' , sans-serif;color:black">,  </span><span style="font-size:9pt;font-family:'verdana' , sans-serif;color:black">SpamAssassin Version: 3.4.1</span><span style="font-size:13.5pt;font-family:'verdana' , sans-serif;color:black"> </span></p><p>My scenario is that my Email server is hosted internally at Private ip address range . My TXT Record at public dns is for my public faced IP address.</p><p> </p><p> </p><p>Issue is that when I send email at GMAIL,Yahoo,Hotmail etc my SPF is valid as shown at their received email headers. SPF is valid checked at MXTOOLS as well.</p><p>But my own mailscanner says SPF Fails may be because email server ip is private and TXT record is for mail server public faced IP. </p><p> </p><p>I am doing all this SPF check to get rid of spoofed emails that using my domain address so  I have whitelisted my internal network and host:mydomain  </p><p> </p><p>How to get rid of this SPF fail on my own mailscanner so that my own emails not get high score ?</p><p>Any other solution to prevent Email spoofing ?</p><p>  </p><p> </p><p> </p><p> </p><p> </p><div><p style="line-height:90%"><b><span style="line-height:90%;font-family:'gadugi' , sans-serif;color:#13a538">Bilal Ahmad</span></b></p><p style="line-height:90%"><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:#203478">Network Administrator</span></p><p style="line-height:90%"><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:#203478">Cell: +92 333 7451870  </span><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:red">|</span><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:#203478">  Tel: +92 68 5882400  </span><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:red">|</span><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:#203478">  Ext. 2499</span></p><p style="line-height:90%"><span style="font-size:10pt;line-height:90%;font-family:'gadugi' , sans-serif;color:#203478">www.kfueit.edu.pk</span></p><p> </p></div><p> </p><div><div style="border:none;border-top:solid #e1e1e1 1pt;padding:3pt 0cm 0cm 0cm"><p><b>From:</b> MailScanner <mailscanner-bounces+bilal.ahmed=kfueit.edu.pk@lists.mailscanner.info> <b>On Behalf Of </b>David Jones via MailScanner<br><b>Sent:</b> Monday, 6 May 2019 10:39 AM<br><b>To:</b> MailScanner Discussion <mailscanner@lists.mailscanner.info><br><b>Cc:</b> David Jones <djones@ena.com><br><b>Subject:</b> Re: Email SPoofing Block Help with SPF in Mailscanner</p></div></div><p> </p><div><p><span style="font-size:12pt;color:black">Martin,</span></p></div><div><p><span style="font-size:12pt;color:black"> </span></p></div><div><p><span style="font-size:12pt;color:black">I knew you wouldn't have done that which is why I removed your name from the top of the reply.  My response was for the OP and others that might have done that.  :)</span></p></div><div><p><span style="font-size:12pt;color:black"> </span></p></div><div><p><span style="font-size:12pt;color:black">Dave</span></p></div><div><div><p><span style="font-size:12pt;color:black"> </span></p></div><div align="center" style="text-align:center"><hr size="2" width="98%" align="center"></div><div><p><b><span style="color:black">From:</span></b><span style="color:black"> MailScanner <<a href="mailto:mailscanner-bounces+djones=ena.com@lists.mailscanner.info">mailscanner-bounces+djones=ena.com@lists.mailscanner.info</a>> on behalf of Martin Hepworth <<a href="mailto:maxsec@gmail.com">maxsec@gmail.com</a>><br><b>Sent:</b> Sunday, May 5, 2019 10:47 AM<br><b>To:</b> MailScanner Discussion<br><b>Subject:</b> Re: Email SPoofing Block Help with SPF in Mailscanner</span> </p><div><p> </p></div></div><div><div><div><p>Was a question not an instruction, the whitelist of your own domain is a common configuration error and will make sure spoofed emails allegedly from your own domain will get through.</p></div></div><div><p> </p></div><div><p>Martin</p></div><div><p> </p><div><div><p>On Sun, 5 May 2019 at 14:45, David Jones via MailScanner <<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a>> wrote:</p></div><blockquote style="border:none;border-left:solid #cccccc 1pt;padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><p style="margin-bottom:12pt">Never, ever, ever whitelist either in MailScanner or SpamAssassin any <br>domains that your MTA is configured to accept.  This will definitely let <br>spoofed emails through.<br><br>> On Sat, 4 May 2019 at 20:38, <<a href="mailto:bilal.ahmed@kfueit.edu.pk">bilal.ahmed@kfueit.edu.pk</a> <br>> <mailto:<a href="mailto:bilal.ahmed@kfueit.edu.pk">bilal.ahmed@kfueit.edu.pk</a>>> wrote:<br>> <br>>     Kindly I need a help someone is spoofing address of my domain and<br>>     forwarding email to my own domain.____<br>> <br><br>We need an example email with headers lightly redacted posted to <br>someplace like <a href="http://pastebin.com">pastebin.com</a>.  It would also help to see the maillog <br>entries for that queue ID.<br><br>There are multiple ways to block this based on the email headers.<br><br>We aren't even sure what domain to check the SPF record for without any <br>headers.<br><br>You should consider setting these values in MailScanner.conf if not <br>already to help with troubleshooting:<br><br>Add Envelope From Header = yes<br>Detailed Spam Report = yes<br>Include Scores In SpamAssassin Report = yes<br>Always Include SpamAssassin Report = yes<br>Spam Score = yes<br><br>These must be on based on what information you provided but make sure:<br>Spam Checks = yes<br>Use SpamAssassin = yes<br><br>>     My SPF is already added in Public DNS.____<br>> <br><br>Your own SPF setting in DNS will help prevent spoofing to others but <br>will not necessarily help spoofing to your own mail server running <br>MailScanner/SpamAssassin depending on your mail flow setup.  For <br>example, does outbound mail flow for your domain go through this same <br>mail server unauthenticated from an internal mail server?  Does an <br>internal mail server smarthost to or run locally on this MailScanner <br>instance?<br><br>If your outbound mail does not go through this MailScanner instance, <br>then you have options like this in your /etc/mail/spamassassin/<a href="http://local.cf">local.cf</a> <br>or /etc/mail/spamassassin/<a href="http://mailscanner.cf">mailscanner.cf</a>:<br><br>blacklist_from *@<a href="http://yourdomain.com">yourdomain.com</a><br><br>It appears that your outbound mail does flow through this MailScanner <br>box based on the "score SPF_FAIL 15.0" so the entry above would block <br>legit email just like the "score SPF_FAIL 15.0" entry.<br><br>You might be able to add this to the etc/mail/spamassassin/<a href="http://local.cf">local.cf</a> or <br>/etc/mail/spamassassin/<a href="http://mailscanner.cf">mailscanner.cf</a>:<br><br>whitelist_from_rcvd *@<a href="http://yourdomain.com">yourdomain.com</a> [ip.add.re.ss]<br><br>where the "ip.add.re.ss" is the internal IP address of your mail server. <br>  Note this is not ideal since you will no longer be filtering outbound <br>email.<br><br>NOTE: this would only be temporary until a better solution is determined <br>after seeing the email headers of a spoofed email and knowing more about <br>the mail flow.<br><br>>     __ __<br>> <br>>     Please Any solution to block invalid SPF record address in my<br>>     Mailscanner/spamassasian.____<br>> <br><br>Please provide more detail.  Mail filtering is very complex so we can't <br>help without details.<br><br>- original email lightly redacted posted to <a href="http://pastebin.com">pastebin.com</a><br>- what is the MTA?<br>- what RBLs are configured in the MTA?<br>- version of MailScanner<br>- version of SpamAssassin<br><br>>     Because I have seen the spoof address with no SPF record are passing<br>>     through Mainscanner.____<br>> <br><br>This may be more of a question for the SpamAssassin Users mailing list <br>if MailScanner is properly using SpamAssassin.<br><br>-- <br>David Jones<br><br><br>-- <br>MailScanner mailing list<br><a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br><a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a></p></blockquote></div></div><p>-- </p><div><p>-- <br>Martin Hepworth, CISSP<br>Oxford, UK</p></div></div></div></div></div></blockquote></div><br></div></div>