Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: kirkf on March 28, 2006, 07:42:36 PM

Title: qpsmtp config to reject mail from domain
Post by: kirkf 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!
Title: qpsmtp config to reject mail from domain
Post by: JonB 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
Title: qpsmtp config to reject mail from domain
Post by: kirkf 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
Title: qpsmtp config to reject mail from domain
Post by: hanscees 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
Title: Re: qpsmtp config to reject mail from domain
Post by: raem 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.
Title: qpsmtp config to reject mail from domain
Post by: raem 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.
Title: qpsmtp config to reject mail from domain
Post by: hyperfocused 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?
Title: qpsmtp config to reject mail from domain
Post by: byte 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
Title: qpsmtp config to reject mail from domain
Post by: kruhm 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.
Title: qpsmtp config to reject mail from domain
Post by: CharlieBrady 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.
Title: qpsmtp config to reject mail from domain
Post by: kruhm on March 21, 2007, 03:14:40 PM
added to BT:

http://bugs.contribs.org/show_bug.cgi?id=2409