<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.sophos.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Filtering rules</title><link>https://community.sophos.com/puremessage/f/discussions/91129/filtering-rules</link><description>Does anyone know if there is a way of creating a filter in Puremessage that will block emails which certain words in the subject lines, plus come from *@Hotmail or *@gmail.com or *@outlook.com . So, for instance - and email with a subject containing </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Filtering rules</title><link>https://community.sophos.com/thread/339352?ContentTypeID=1</link><pubDate>Thu, 06 Jul 2017 09:29:49 GMT</pubDate><guid isPermaLink="false">4be5eb7d-caa4-4ff5-8e60-8f9463545a35:ae4d806c-73a8-44d2-8ef7-9f1c4029f748</guid><dc:creator>LEFBE</dc:creator><description>&lt;p&gt;Hello Julia,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Below a suggested rule:&amp;nbsp;&lt;br /&gt;Please note you need to adapt it based on your needs:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In this rule the following actions are done:&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check if envelope from contains @gmail.com, @outlook.com, @hotmail.com (please note you can also check for header from)
&lt;ul&gt;
&lt;li&gt;If true
&lt;ul&gt;
&lt;li&gt;then check if the subject contains SEO&lt;/li&gt;
&lt;li&gt;if true
&lt;ul&gt;
&lt;li&gt;then add value into message_log file (here : SEO_DETECTED) and add tag into the subject (here :&amp;nbsp;[SEO DETECTED] )&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Finally, the PMX Rule:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#&amp;nbsp;attr&amp;nbsp;NAME=Security&amp;nbsp;Rules&amp;nbsp;-&amp;nbsp;SEO&amp;nbsp;detection&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;anyof(envelope&amp;nbsp;:comparator&amp;nbsp;&amp;quot;i;ascii-casemap&amp;quot;&amp;nbsp;:all&amp;nbsp;:contains&amp;nbsp;[&amp;quot;from&amp;quot;]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&amp;quot;@&lt;a href="http://gmail.com"&gt;gmail.com&lt;/a&gt;&amp;quot;],&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;envelope&amp;nbsp;:comparator&amp;nbsp;&amp;quot;i;ascii-casemap&amp;quot;&amp;nbsp;:all&amp;nbsp;:contains&amp;nbsp;[&amp;quot;from&amp;quot;]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&amp;quot;@&lt;a href="http://outlook.com"&gt;outlook.com&lt;/a&gt;&amp;quot;],&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;envelope&amp;nbsp;:comparator&amp;nbsp;&amp;quot;i;ascii-casemap&amp;quot;&amp;nbsp;:all&amp;nbsp;:contains&amp;nbsp;[&amp;quot;from&amp;quot;]&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&amp;quot;@&lt;a href="http://hotmail.com"&gt;hotmail.com&lt;/a&gt;&amp;quot;])&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;{&lt;/strong&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pmx_mark1&amp;nbsp;&amp;quot;External_IPBlock&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;attr&amp;nbsp;NAME=Security&amp;nbsp;Rules&amp;nbsp;-&amp;nbsp;SEO&amp;nbsp;detection&amp;nbsp;in&amp;nbsp;subject&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;header&amp;nbsp;:comparator&amp;nbsp;&amp;quot;i;ascii-casemap&amp;quot;&amp;nbsp;:contains&amp;nbsp;[&amp;quot;Subject&amp;quot;]&amp;nbsp;[&amp;quot;SEO&amp;quot;]&amp;nbsp;&lt;strong&gt;{&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pmx_mark1 &amp;quot;SEO_DETECTED&amp;quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pmx_replace_header :index 0 &amp;quot;Subject&amp;quot; &amp;quot;[SEO DETECTED] %%SUBJECT:h_utf8%%&amp;quot;;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I Hope this information help you.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Best regards,&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Filtering rules</title><link>https://community.sophos.com/thread/339153?ContentTypeID=1</link><pubDate>Wed, 05 Jul 2017 04:42:20 GMT</pubDate><guid isPermaLink="false">4be5eb7d-caa4-4ff5-8e60-8f9463545a35:ac0352ff-83d6-451b-a636-ec0029f03db3</guid><dc:creator>Jens P&amp;#246;nninghaus</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;since I am only familar with Puremessage for Unix, the following might not apply to whatever you are referring to as &amp;#39;Puremessage&amp;#39;.&lt;br /&gt;&lt;br /&gt;Since there was no answer within the last couple of weeks, I am tempted to assume that there is no (known) easy way to get this done without substantial changes to the (sieve) policy or your setup.&lt;br /&gt;&lt;br /&gt;From my perspective, the most natural approach would be to try to create a custom spam-rule for that in order to adjust the weights. I&amp;#39;m asking for means to create site specific composite rules, e.g. (featuretest1 &amp;amp;&amp;amp; featuretest2), once in a while for about a decade but didn&amp;#39;t see any &amp;#39;improvements/comebacks&amp;#39;. The typical suggested workaround was to provide samples to have the rule set adjusted.&lt;br /&gt;You might look into having two independent &amp;#39;simple&amp;#39; tests with moderate weights, but that will most probably introduce trouble in the sets of mails having feature 1 or 2 but not both but some other independent feature(s) that might give enough additional weight to sink the boat. So in almost all cases where I checked that that approach it was to coarse to give reliable coverage with little risk of collateral damage.&lt;br /&gt;Next option is to &amp;#39;hard&amp;#39; code those tests in your policy as nested allof/anyof is available as well as substring tests for subject and e.g. envelope from address. &lt;br /&gt;Another option is to have an additional (pmx derived or totally independent) milter hooked to your MTA to do that job.&lt;br /&gt;So, in principle you can &amp;#39;create&amp;#39; a filter in Puremessage to get that done (btw. what is &amp;#39;come from &amp;lt;domain&amp;gt;&amp;#39; actually referring to in a technical sense, e.g. env-from, header-from, dns domain of connecting ip, ...)&amp;nbsp; but probably not the way that would seem most natural to us and which I would prefer to have at hand for those cases that are highly site specific and which might need some adjustment from time to time.&lt;br /&gt;&lt;br /&gt;Hope this helps or stimulates feedback that gives new thoughts and insights to a very long lasting topic.&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>