Koozali.org: home of the SME Server

howto block a single email address

ramos

howto block a single email address
« on: July 30, 2007, 10:07:57 AM »
Hello to all!
I want to block a single email address in SME server 7.2. I found several solutions on forums and chose the easiest - global blacklist.

 
Code: [Select]

db spamassassin setprop wbl.global *@vonage.com White
db spamassassin setprop wbl.global *domain2.com White
db spamassassin setprop wbl.global This e-mail address is being protected from spam bots, you need JavaScript enabled to view it White
db spamassassin setprop wbl.global This e-mail address is being protected from spam bots, you need JavaScript enabled to view it Black
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd


However it doesn't work - I still get mail from that address.
Is it another way? Did I miss something?

Thank you folks for some help!

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
howto block a single email address
« Reply #1 on: July 30, 2007, 01:50:28 PM »
You need to change the references of "White" to "Black"

Bob
If you think you know whats going on, you obviously have no idea whats going on!

Offline mmccarn

  • *
  • 2,656
  • +10/-0
howto block a single email address
« Reply #2 on: July 30, 2007, 02:01:41 PM »
From the code you've shown us the only value that is black listed is also white listed - perhaps white listing overrules black listing?

Also, spamassassin is disabled by default - have you enabled it on your system?  (You can check with config show spamassassin).

If spamassassin won't block the sender you're trying to block, you might try to figure out how to do it using badmailfrom.  It looks like this is in /var/qmail/control

ramos

Thank you
« Reply #3 on: July 31, 2007, 06:17:18 AM »
crazybob: I did only added *@somedomain.com only to Blacklist

mmccarn: I enabled spamassassin. I going to try badmailfrom. Do you happen to know the fragment that should be created. I'm kinda newbie in linux    :roll: .

I found a post at http:// http://forums.contribs.org/index.php?topic=36302.0

but it's not very specific for my level of knowlege.

Some help translating that into a howto?

ramos

Its working!!!
« Reply #4 on: July 31, 2007, 06:35:46 AM »
Thank you very much!
Apparently when adding an address or domain @somedomain.com to /var/qmail/control/badmailfrom the sender is blocked and receives back a message of error 550 unrecoverable error bla bla.

No additional steps are required - like restarting or expanding a template. However I don't know if changes are kept after a reboot or upgrade.

Offline mmccarn

  • *
  • 2,656
  • +10/-0
howto block a single email address
« Reply #5 on: July 31, 2007, 02:17:17 PM »
/var/qmail/control/badmailfrom is definitely templated, so you should move your customizations to a template fragment.

Basically, this means creating a file containing your desired content in a folder named /etc/e-smith/templates-custom/var/qmail/control/badmailfrom, something like this:
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/var/qmail/control/badmailfrom
pico -w /etc/e-smith/templates-custom/var/qmail/control/badmailfrom/20badmailfrom
Add the email addresses you want to block to 20badmailfrom, one per line.  When done, save your changes and do:
Code: [Select]
expand-template /var/qmail/control/badmailfrom
signal-event email-update


The SME templating system will look at /etc/e-smith/templates and /etc/e-smith/templates-custom and process any template fragments found for a particular file (/var/qmail/control/badmailfrom, in our example) alphabetically.  If there are identically named fragments in .../templates/... and in .../templates-custom/..., the custom version will be used and the non-custom version will be ignored.

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
howto block a single email address
« Reply #6 on: July 31, 2007, 04:01:44 PM »
I posted some observations here...

http://forums.contribs.org/index.php?topic=37838.msg170317#msg170317

A few posts up is a link to a contrib that allows you to do this from the server-manager.
Regards,
William

IF I give advise.. It's only if it was me....

ramos

howto block a single email address
« Reply #7 on: July 31, 2007, 05:01:53 PM »
Thank you all! You're life saviors!

One question though: using a similar mechanism one could block internal email to one specific address? qpsmtp maybe?

If answer is yes and anyone post a short code to ease the life of us newbies may I ask one of administrators to mark this post as solved and post-it as reference in howto section?

Thank you!