Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: Bud on October 27, 2016, 01:58:09 PM

Title: Block Email from Domain
Post by: Bud on October 27, 2016, 01:58:09 PM
guys please help

i need to block email received from a certain domain being sent to users on my sme 9.1 server

eg: Somebody from Domain x somebody@domainx.com is sending mail to my user(s) on my sme 9.1 server user1@mysmeserver.com

i need to blacklist the domainx.com so that NO email will be delivered to my sme 9.1 server

how do i do this?
Title: Re: Block Email from Domain
Post by: guest22 on October 27, 2016, 02:08:14 PM
https://wiki.contribs.org/Email_Whitelist-Blacklist_Control
Title: Re: Block Email from Domain
Post by: Bud on October 27, 2016, 02:34:08 PM
RequestedDeletion thank you for your help. much appreciated  :D

how can i check to whom somebody@domainx.com has sent mail to my users on my sme 9.1 server

any help greatly appreciated  :)
Title: Re: Block Email from Domain
Post by: guest22 on October 27, 2016, 02:40:38 PM
Logfiles? e.g. qsmtpd logs?
Title: Re: Block Email from Domain
Post by: Stefano on October 27, 2016, 03:09:32 PM
something like

Code: [Select]
grep logterse /var/log/qpsmtpd/current | grep  'domainx.com' | tai64nlocal

should do the trick
Title: Re: Block Email from Domain
Post by: Bud on October 28, 2016, 10:51:41 AM
RequestedDeletion and stefano thank you for your input much appreciated

i have installed the https://wiki.contribs.org/Email_Whitelist-Blacklist_Control contrib and have done the following as a test on my sme 9.1 server

server-manager > E-mail WBL > Black List

i placed an entry in qpsmtpd badhelo " somebody@domainx.com " ( without the inverted commas )
i placed an entry in  qmail badmailfrom " somebody@domainx.com " ( without the inverted commas )
i have placed an entry in spamassassin blacklist_from " somebody@domainx.com " ( without the inverted commas )

i then did a test using

the email is NOT blacklisted and still goes to the users mailbox ie the email is NOT being rejected.

i require the email from somebody@domainx.com to NOT be delivered to any user on the sme 9.1 server

any ideas what i am doing wrong  :D
Title: Re: Block Email from Domain
Post by: guest22 on October 28, 2016, 11:17:55 AM
Did you do a signal-event post-upgrade; signal-event reboot after installing the contrib? And is your server fully updated?
Title: Re: Block Email from Domain
Post by: warren on October 28, 2016, 11:50:46 AM
RequestedDeletion and stefano thank you for your input much appreciated

i have installed the https://wiki.contribs.org/Email_Whitelist-Blacklist_Control contrib and have done the following as a test on my sme 9.1 server

server-manager > E-mail WBL > Black List

i placed an entry in qpsmtpd badhelo " somebody@domainx.com " ( without the inverted commas )
i placed an entry in  qmail badmailfrom " somebody@domainx.com " ( without the inverted commas )
i have placed an entry in spamassassin blacklist_from " somebody@domainx.com " ( without the inverted commas )

i then did a test using

the email is NOT blacklisted and still goes to the users mailbox ie the email is NOT being rejected.

i require the email from somebody@domainx.com to NOT be delivered to any user on the sme 9.1 server

any ideas what i am doing wrong  :D

How did you do the testing ?

Is the email address you want to block in the list when you do :
Code: [Select]
cat /var/qmail/control/badmailfrom
what does this show :
Code: [Select]
grep logterse /var/log/qpsmtpd/current | grep  'check_badmailfrom' | tai64nlocal
On several servers i manage i see this when blocking a sender :

Code: [Select]
2016-10-28 11:37:22.210612500 4542 logging::logterse plugin (deny): ` 209.85.220.181    mail-qk0-f181.google.com        mail-qk0-f181.google.com       <XXXX@gmail.com>             check_badmailfrom       901     sorry, your envelope sender is in my badmailfrom list   msg denied before queued
Title: Re: Block Email from Domain [ SOLVED ]
Post by: Bud on November 01, 2016, 08:59:51 PM
thank you to all that helped me  :)

much appreciated