Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon AntiSpam > Archive > Blacklist a sender email for all users of a domain within outlook ?

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon AntiSpam  / Archive  /

Blacklist a sender email for all users of a domain within outlook ?

[Jacobs, Axel]
Axel Jacobs
Newbie
Newbie
Posts: 4

MDaemon
SecurityGateway
Outlook Connector
SecurityPlus
ProtectionPlus
WebAdmin
Axel Jacobs - 07:24am, Nov 26 2020

Hello Is there a way to reproduce the feature of the personal BlackList address book for a group of users ?

I would like for all users of a domain to share/manage a common blacklisted sender emails from within outlook (with MD connector plugin)

Maybe a Public Folders/Contacts/BlackList ? or to forward the spam email to a special email that could trigger an event ?

Thanks in advance

  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Arron Caruth - Nov 30, 2020 4:20 pm (#1 Total: 2)  

Guest User  

Photo of Author
Posts: 1

There is no easy way to do this.  But it is possible using a combination of accounts, content filter rules and scripting. 

 

Before you implement something, I’d really like to caution you about doing so.  We get support calls all the time about users adding incorrect addresses to their white and blacklists resulting in all messages from an address being allowed through or all messages from an address being blocked.  Sometimes they add their own address, other times they add an address to the wrong list, regardless of what they do it causes a hassle for the user and the admin to work out and fix.  If you give users power to do this for the entire domain, mistakes will affect everyone and could end up blocking legitimate mail and/or allowing lots of spam through and cause headaches for the entire domain.  You know your users better than I do, I don’t know them at all, so really you are the only one that can decide if this is write for your environment. 

 

To implement something, create an account, it can be named anything you want.  I called my account bad@domain.com.  Configure the account so that it cannot send/receive email to external domains.  I assume you only have a single domain in MDaemon, if you have multiple domains you will want to take further steps to ensure that a user from another domain cannot add items to the white or black lists. 

 

On the attachments dialog for the account select the radio button for “Extract Attachments and put them in account’s Documents folder.”

 

Then create a content filter rule like the following(You’ll want to update the content filter rule to work for your domain):

 

[Rule015]

RuleName=Extract Attachments

Enable=Yes

ThisRuleCondition=All

ProcessQueue=BOTH

Condition01=X-MDAEMON-DELIVER-TO|contains|AND|bad@test.com|

Action01=extract attachments|"1","message/rfc822","C:\MDaemon\Users\test.com\bad\Documents.IMAP","1"

 

Finaly put a script in place similar to the following powershell script.  You’ll have to use Task Manager or something like that to run the script on a regular schedule.  Please be aware this script has had very limited testing and likely has bugs that will need to be worked out.  It has very little error handling, forexample if it can’t find the Return-Path header it won’t do anything. A user can add any address to the blacklist, including their own.  You’ll probably want to prevent accounts on your domain from getting added to the list. It never removes the files on disk so they will build up forever.  If there is something other than an email address in the return-path, or the syntax varies at all, it will add strange stuff to your sender blacklist.  You’ll have to upate the script to work for your domain.  Basically “test.com” should be replaced with your domain and “Bad” should be replaced with whatever mailbox name you choose to use.

 

 

$BadMailStore = "C:\MDaemon\Users\test.com\Bad\Documents.IMAP"

$Domain = "test.com"

$SenderBlackList = "C:\MDaemon\App\SenderBlackList.dat"

$Change = $False

$Sem = "C:\MDaemon\App\BlackList.sem"

 

ForEach($File in Get-ChildItem -Path $BadMailStore | Where {-not $_.psiscontainer -and $_.FullName -notlike "*.mrk"}) {

 

    $Match = Select-String $File -Pattern "^Return-Path:" | select-object -First 1

 

    $RPath = $Match.Line

    Write-Host "Return-Path found: " $RPath

 

    $Junk,$RPath = $RPath.split("<")

   

    $RPath = $RPath.TrimEnd(">")

 

    if(!(Select-String -Path $SenderBlackList -Pattern "$Domain $RPath" -SimpleMatch -Quiet)){

 

        $Change = $true

        Write-Host "Adding: $Domain $RPath"

 

        Add-Content -Path $SenderBlackList -Value "$Domain $RPath"

    } else {

 

        Write-Host "$RPath is already on the blacklist."

    }

 

 

}

 

if($Change -eq $True){

 

    New-Item -path $Sem

}

 

To use this users will need to forward a message as an attachment to bad@test.com.  When MDaemon receives it the attached message will be extracted to the documents folder.  The powershell script will then parse the message looking for the return path.  If the address in the return-path is not already on the black list for the domain it will be added.  Then a semaphore file is created to tell MDaemon to reload the blacklist.

 

I hope that helps.

 

--
Arron Caruth
Vice President of Product Development
o: 817-601-3222    e: Arron.Caruth@mdaemon.com

MDaemon Technologies
Simple Secure Email
Visit us on www.mdaemon.com | Facebook | LinkedIn | YouTube
Sent using the MDaemon Email Server

From: md-anti-spam@mdaemon.com [mailto:md-anti-spam@mdaemon.com] On Behalf Of lists-md-anti-spam@mdaemon.com (Axel Jacobs)
Sent: Thursday, November 26, 2020 6:24 AM
To: md-anti-spam List Member <md-anti-spam@mdaemon.com>
Subject: [md-anti-spam] Blacklist a sender email for all users of a domain within outlook ?

 

Hello Is there a way to reproduce the feature of the personal BlackList address book for a group of users ?

I would like for all users of a domain to share/manage a common blacklisted sender emails from within outlook (with MD connector plugin)

Maybe a Public Folders/Contacts/BlackList ? or to forward the spam email to a special email that could trigger an event ?

Thanks in advance


View/reply at Blacklist a sender email for all users of a domain within outlook ?

 
 
--MD-ANTI-SPAM-------------------------------------------------------
This list is for questions and discussions about preventing SPAM 
using MDAEMON. To unsubscribe from this mailing list send an email to 
md-anti-spam-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------
 
---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
---------------------------------------------------------------------

--MD-ANTI-SPAM-------------------------------------------------------
This list is for questions and discussions about preventing SPAM
using MDAEMON. To unsubscribe from this mailing list send an email to
md-anti-spam-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
---------------------------------------------------------------------



  (newer msg:1)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.