Use LDAP or Active Directory to create WhiteList |
Post Reply |
Author | |
k1
Newbie Joined: 01 October 2009 Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 01 October 2009 at 11:09am |
Hi
Is there a way to use the Active Directory to dynamically create a list of allowed email recipients so that only email addresses found in the Directory will be allowed and Quarantined. The problem is that spammers try different email addresses all the time and they end up in the Quarantine list and will fill it up with unnecessary items. Using the Directory ISP can create and maintain a list of allowed recipients and only Quarantine items in that list. Is this possible? /Keivan |
|
LogSat
Admin Group Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
Post Options
Thanks(0)
|
Keivan,
SpamFilter can easily accept emails directed to valid users only. That is done using the "AuthorizedTO" email whitelist. Simply populate that list with all the valid email addresses in your domain(s), and SpamFilter will reject (not even quarantine) emails addressed to users no in that list. Please note that you can have an external application make changes to the file containing that whitelist. SpamFilter will automatically re- import the entries in that file within a minute if they have been updated by another application. You can thus schedule the export the email addresses from Active Directory via any method you prefer onto a text file (the file should contain only a list of email addresses, one per line), and SpamFilter will use that to further filter emails. |
|
k1
Newbie Joined: 01 October 2009 Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Hi
Yes that's correct, but I don't have a third party application that can do that I just thoght that this could be a very handy function in ISP. With many users there isn't a option doning this manually. Threre are constant changes in users and email adresses and these arn't always done by the IT department so we need a automatic way of doing this.
As far as I can see you alredy have the nessesary parts to doning this in ISP, you have LDAP, AD communication and the Whitelist.
Is there any chance that you could add this feature it would help us alot?!
/Keivan
|
|
LogSat
Admin Group Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
Post Options
Thanks(0)
|
Keivan,
There may be a simpler script, but this is the one we use ourselves in our own environment (no extra tools required). The email addresses in Active Directory for active accounts will be exported to a text file. Simply edit the first two strDn and the ADBulkExportFile constants to fit your environment, and execute the script via command line as follows: C:\>cscript ExportEmails.vbs ===== save this script as "ExportEmails.vbs" ====== 'This constant defines the root DNs for the domain 'Set the log files location Const ADS_SCOPE_SUBTREE = 2
'Open the ADBulkExport file for writing 'Open an ADO Connection to Active Directory 'Open an ADO Command Connection to Active Directory 'Execute the ADO Command to Active Directory and set the objRecordSet Variable to whatever is returned
'--------START Export Accounts to file --------------- ADBulkExport.Close |
|
alexxxx1
Newbie Joined: 25 May 2007 Location: Germany Status: Offline Points: 9 |
Post Options
Thanks(0)
|
Roberto,
I have the requirement to create a authorizedTo List with all e-mail addresses that we using including all e-mail aliases. For that your script does not working because it delivers only the Main e-mail address for an user.
I found a script that delivers also the alias. It's a powershell script:
Listing: smtpaddresslist.ps1
################################
Get-Mailbox | select EmailAddresses | foreach {
$_.EmailAddresses | foreach {
if($_.SmtpAddress){ if($_.IsPrimaryAddress){ "$($_.SmtpAddress)" } else { "$($_.SmtpAddress)" } } } write-output ""
} Get-DistributionGroup | select EmailAddresses | foreach {
$_.EmailAddresses | foreach {
if($_.SmtpAddress){ if($_.IsPrimaryAddress){ "$($_.SmtpAddress)" } else { "$($_.SmtpAddress)" } } } write-output ""
} #########################################
You can redirect the output to a textfile in this way:
powershell -psconsolefile exshell.psc1 -command "& {c:\smtpaddresslist.ps1 >"'C:\Program Files (x86)\SpamFilter\domains\SFI\WL_AuthorizedTOEmails.txt'"}"
But the SpamFilter can't read the Text File. When I copy the content to a new Text File it works. So I think there must be some wrong characters in the file?
Thanks,
Alex
|
|
LogSat
Admin Group Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
Post Options
Thanks(0)
|
Alex,
If you can email us (support @ logsat dot com) the "broken" text file, we'll take a look to see what is causing it be unreadable.
|
|
LogSat
Admin Group Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
Post Options
Thanks(0)
|
Mystery solved. The file has a Unicode character set encoded in UTF-16 (2-byte characters). SpamFilter does not read Unicode files - only plain ASCII files (8 byte characters - half the file/RAM size....).
If you make sure the file is saved in the ANSI char set everything should be OK.
|
|
alexxxx1
Newbie Joined: 25 May 2007 Location: Germany Status: Offline Points: 9 |
Post Options
Thanks(0)
|
thanks Roberto,
it's working. I changed the script in this way:
###################################
Get-Mailbox | select EmailAddresses | foreach {
$_.EmailAddresses | foreach {
if($_.SmtpAddress){ if($_.IsPrimaryAddress){ "$($_.SmtpAddress)" } else { "$($_.SmtpAddress)" } } } write-host ""
} | out-file -filepath 'C:\Program Files (x86)\SpamFilter\domains\SFI\WL_AuthorizedTOEmails.txt' -encoding ASCII Get-DistributionGroup | select EmailAddresses | foreach {
$_.EmailAddresses | foreach {
if($_.SmtpAddress){ if($_.IsPrimaryAddress){ "$($_.SmtpAddress)" } else { "$($_.SmtpAddress)" } } } write-host ""
} | out-file -filepath 'C:\Program Files (x86)\SpamFilter\domains\SFI\WL_AuthorizedTOEmails.txt' -append -encoding ASCII Edited by alexxxx1 - 15 May 2010 at 10:51am |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.141 seconds.