Koozali.org: home of the SME Server

Change when check_goodrcptto runs?

Offline pizzaco

  • ***
  • 53
  • +0/-0
Change when check_goodrcptto runs?
« on: June 26, 2014, 03:35:14 PM »
Is there any way to move check_goodrcptto to later in the SMTP process so that it checks *after* all the spam checks have been completed? 

I'm concerned about email address harvesting attacks. I may be wrong here, but it seems like it would be better to check for spam content first, and, if found, to give the spammer/attacker a reject notice referencing spam content. That would theoretically  make it more difficult for the spammer to figure out which addresses are actually real and which are fake.  As it stands now, check_goodrcptto runs earlier in the conversation and the attacker can get a 550 and know the address is bad.

I know running it later will consume more bandwidth and resources, but I don't see that as being a problem for my situation.

Thanks!



Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Change when check_goodrcptto runs?
« Reply #1 on: June 27, 2014, 03:06:22 PM »
[caveats]
This may be a very bad idea -- I don't know enough about qpsmtpd to comment on the advisability of this process

On my servers, most spam is already blocked by the dnsbl and rhsbl plugins, both of which have low overhead and run before check_goodrcptto.

Last note: Since google, facebook, twitter, and anyone else who can get your email is already sharing it around the planet, I assume that everyone already knows my entire email userlist -- the SME spam filters effectively block spam even with this data "in the wild", and available to spammers.

[edit]
Plus -- almost all of the spam I get that makes it through my spam filters has been relayed through someone else's server that the spammer has compromised -- meaning there's no way for the spammer to get any useful info back on which addresses worked and which didn't...
[/edit]
[/caveats]

The order of the plugins is controlled by the ascii sort of the various template fragments in /etc/e-smith/templates/var/service/qpsmtpd/config/plugins

To make the change you want, you would need to create custom template fragments something like this:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
cp /etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/38check_goodrcptto 71check_goodrcptto
echo '# 38check_goodrcptto moved via custom template fragment'> 38check_goodrcptto
signal-event email-update

Verify your changes using
Code: [Select]
less /var/service/qpsmtpd/config/peers/0

Remove the changes using
Code: [Select]
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/
'rm' -f 38check_goodrcptto
'rm' -f 71check_goodrcptto
signal-event email-update

« Last Edit: June 27, 2014, 03:12:30 PM by mmccarn »

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Change when check_goodrcptto runs?
« Reply #2 on: June 27, 2014, 06:05:44 PM »
Is there any way to move check_goodrcptto to later in the SMTP process so that it checks *after* all the spam checks have been completed?

When you say "after all the spam checks have been completed" then you mean "just before delivery". i.e. after the "data" phase of SMTP.

You would need to write a different plugin to do that.

Quote
I'm concerned about email address harvesting attacks.

Why? Do you have any evidence that they are occurring?

Offline pizzaco

  • ***
  • 53
  • +0/-0
Re: Change when check_goodrcptto runs?
« Reply #3 on: June 27, 2014, 06:31:34 PM »
Yes, I mean after the data stage.

Quote
I'm concerned about email address harvesting attacks.

Why? Do you have any evidence that they are occurring?

No evidence, other than the fact that at least 50%-60% of inbound emails are to invalid recipients.