Koozali.org: home of the SME Server

qpsmtp config to reject mail from domain

kirkf

qpsmtp config to reject mail from domain
« on: March 28, 2006, 07:42:36 PM »
Hello,

I've done some searching, but haven't found any definitive method, so I'll ask here.  Is there a db setting I can configure to set qpsmtp to reject incoming mail from a specific sender or domain?

If not, could someone help me understand where in qpsmtp's config this could be added?  I see that there is a whitelistsenders file in  /var/service/qpsmtpd/config/, but no blacklist config that I can see.

I can use spamassassin's blacklist to filter the messages to junkmail, but I'd like to just refuse the messages in the first place.

Thanks!

Offline JonB

  • *
  • 351
  • +0/-0
qpsmtp config to reject mail from domain
« Reply #1 on: March 28, 2006, 11:37:23 PM »
Kirkf,

Qpsmtpd has check_badmailfrom set on by default. The badmailfrom plugin checks /var/qmail/control/badmailfrom for any entries.

So you need to edit /etc/e-smith/templates/var/qmail/control/badmailfrom and add the domains that you want to block in the form of spammer@spam.com or a whole domain @spam.com

Then finish off with a

signal-event email-update

Jon
...

kirkf

qpsmtp config to reject mail from domain
« Reply #2 on: March 29, 2006, 05:19:12 AM »
Thanks, Jon.  That's exactly what I was looking for.  I did create a custom template rather than modifying the master template, though.

Kirk

Offline hanscees

  • *
  • 267
  • +0/-0
    • nl.linkedin.com/in/hanscees/
qpsmtp config to reject mail from domain
« Reply #3 on: November 08, 2006, 11:33:30 PM »
Quote from: "kirkf"
Thanks, Jon.  That's exactly what I was looking for.  I did create a custom template rather than modifying the master template, though.

Kirk

I did some hacking and now have a plugin that does the same but then with regexps.

So hanscees in your list will block hanscees@yo.nl and yo@hanscees.nl.

I have recently been used as a fake emailaddress by spammers, so am blocking postmaster and so on. (I know that is not rfc complient, but I am wading through postmaster reject mail every day).

Hans-Cees
nl.linkedin.com/in/hanscees/

Offline raem

  • *
  • 3,972
  • +4/-0
Re: qpsmtp config to reject mail from domain
« Reply #4 on: November 09, 2006, 11:21:23 AM »
kirkf

> I can use spamassassin's blacklist to filter the messages to junkmail,
> but I'd like to just refuse the messages in the first place.

sme7 will refuse the message at the smtp level if it is on your blacklist and the threshold score for rejection is exceeded (which it likely will be).
error 552
Try it and see, it does work.
...

Offline raem

  • *
  • 3,972
  • +4/-0
qpsmtp config to reject mail from domain
« Reply #5 on: November 09, 2006, 11:27:02 AM »
JonB

>So you need to edit /etc/e-smith/templates/var/qmail/control/badmailfrom ....
> Then finish off with a
> signal-event email-update


I found that signal-event email-update is not required.
...

hyperfocused

qpsmtp config to reject mail from domain
« Reply #6 on: February 13, 2007, 07:30:27 PM »
This is great!  And, it still works in SME 7.1!!

However.  

What if I want to reject email only from a specific email address, but don't like the reason this particular method gives?  

"Remote host said: 550 sorry, your envelope sender is in my badmailfrom
list"  is the current reason it gives...

Is there a way to change the reason it gives?  Say... "Remote host said:  550 sorry, but you're an a**hole"... is that possible?

Offline byte

  • *
  • 2,183
  • +2/-0
qpsmtp config to reject mail from domain
« Reply #7 on: February 13, 2007, 11:28:37 PM »
Quote from: "JonB"
So you need to edit /etc/e-smith/templates/var/qmail/control/badmailfrom [..]


You shouldn't edit the master template as this will be overwritten on the next update, so you would need to create a custom template for changes to remain.

Check this bug out...

http://bugs.contribs.org/show_bug.cgi?id=2281
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline kruhm

  • *
  • 680
  • +0/-0
qpsmtp config to reject mail from domain
« Reply #8 on: March 13, 2007, 10:24:51 PM »
I'm finding the: /var/qmail/control/badmailfrom doesn't work.

The: /var/service/qpsmtpd/config/badmailfrom does.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
qpsmtp config to reject mail from domain
« Reply #9 on: March 14, 2007, 03:07:42 AM »
Quote from: "kruhm"
I'm finding the: /var/qmail/control/badmailfrom doesn't work.

The: /var/service/qpsmtpd/config/badmailfrom does.


If you delete /var/service/qpsmtpd/config/badmailfrom then /var/qmail/control/badmailfrom will work.

Offline kruhm

  • *
  • 680
  • +0/-0
qpsmtp config to reject mail from domain
« Reply #10 on: March 21, 2007, 03:14:40 PM »