Re: [Mimedefang] Process SPF checking for certain recipient domains

2014-07-25 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 24 Jul 2014, Jon Rowlan wrote:


In filter_begin() you know sender and all recipients, there you can

deploy the different checks.


However, what will do if one recipient checks and another one does not

and the message is to reject? You either need to silentliy discard the
message for some recipients or generate bounce messages.

There will not be any cross contamination between domains. So a message
will be for someone at one customer domain and a number of their users
but not for other domains that I host. In reality I only need to check
the first recipient.


Well, maybe the possibility is quite low, that one message hits two 
domains with different filter sets, but how do you ensure there will 
not?


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEVAwUBU9H2yFGgR0+MU/4GAQK2ywf/XsHOHIBbACWVqMdQfkOE56dx5unICISo
RUh8ntB1MlH6I8jQ8+p4Ew8XpHjRYR37n3FGeK1TOthPt+SDrknz0ScKKh8tX67s
85uNqR2rE/NNUMCFzE/x9TonRqxp/9A7m5pJ+ErwA93Q9Yvqcmv0kbHusq+zW/Ro
dKSHdvmGUqjN6PybQqklrG8TxMigz+wVh2Kij17i7hPWUHilUtIkE9VI6AjNeAiH
YXSxamB+yb7GeuHf+25WiuZ0h0JcPNZtPEA5JL2ErOx4uJ99Mb4gHmsjIjwABy7/
3rWJENhOY2QzFVrVOYaxh533AWTyWr6Azr4xwYEvZk3h/rpgCu5FyA==
=NIf6
-END PGP SIGNATURE-
___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Process SPF checking for certain recipient domains

2014-07-25 Thread G.W. Haywood

Hello again,

On Fri, 25 Jul 2014, Jon Rowlan wrote:


The problem is that some domains that I host on my mail server I
want a harsher protection than others.


That's not a problem, it's a requirement.  Almost everybody does it.


In this particular case, a certain set of recipients have received
bombardments of email from a set of IP's and they complain about two
or three hundred emails in a day coming into their mail box.


Two or three hundred spam mails in a day isn't really a bombardment.
Several hundred thousand might be called a bombardment.  At my own
business, the most we've seen in one day is about seventy thousand.
All rejected of course.  Once you see the rejection rates rising in
the logs (you keep a weather eye on your logs, don't you?) then for
example something like

/sbin/iptables -A FORWARD -j LOG_DROP -s spammy.IP.addr.ess

in the firewall stops them even connecting, with very little fuss and
no complicated Perl scripts.  I don't see what SPF has to do with it.


They would suffer the consequences of an SPF protected mail server


What consequences?


(innocent senders are blocked because they don't use SPF


That's nonsense.  Go read the RFCs, understand what SPF is about.
If a sender doesn't use SPF then the receiving mail server takes
no action as a result.  At least that's what's supposed to happen
in a properly configured server.


and mail bounces)


You do know the difference between a mail rejection and a bounce?


because they would see less spam,


SPF is about forgery of mail, not about spam.  Granted, forged mail
is often spam, but there's a clear distinction.


whereas other clients want to see all email


# Tryhing to stay vaguely on-topic, as this is the MIMEDefang list :)
sub filter_recipient
{
  my ($recipient, $sender, $ip, $hostname, $first, $helo,
  $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
  if ($recipient =~ /^?spamlover\@example\.com?$/i)
  {
return ('ACCEPT_AND_NO_MORE_FILTERING', ok);
  }
  return ('CONTINUE', ok);
}

... but I probably wouldn't do it that way.


and will not tolerate too many bounces from their clients.


I didn't follow that part.


I want to selectively use SPF for some domains and not others for
the purposes of the functionality that SPF offers. I want to tune
this depending on the client domain.


Assuming that it's implemented properly, SPF tells you if a mail is
forged.  For some meaning of the word 'forged'.  Nobody wants forged
mail, so there's no reason to implement SPF for only some of your
clients.  But to be perfectly honest, at present (after all SPF has
only been with us for about a decade) so few people publish sane SPF
records that you might as well simply not bother with it at all.
Really.  Put your efffort into something that will yield some return.

The vast majority of SPF records that I see have been cobbled together
using some bug-riddled WebWizard by incompetents who have no idea of
what SPF is for, nor how it works.  Once they've set up the faulty SPF
record they seem to be either terrified or incapable of doing anything
to it - such as fixing it so it doesn't cause more trouble than it's
intended to prevent.  Customers of these incompetents then start going
round in small circles and yelling that we've rejected their mail when
it's their provider's policy that said we should do so.  Go figure.

The best thing you can do is forget you ever heard of SPF and do some
reading on mail protocols so that you understand what you're doing,
which clearly you do not at the moment.


Stop digging.


Digging for what? Answers, I thought that was the point of asking?


I meant stop digging that hole.  Clarify the issues before you go off
solving problems of your own making.  You might want to run the SPF
record for sads.com past the people on the spf-help mailing list:

spf-h...@listbox.com

--

73,
Ged.
___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Process SPF checking for certain recipient domains

2014-07-25 Thread Jon Rowlan
Thanks Ged.

That is helpful although for some odd reason I feel very much told off
:-)

I should have added that I checked the sender domains and they all had
SPF in place which is why I was tempted to try using the SPF mechanism.

I have tried using hosts.deny but that doesn't seem to work for me,
iptables may well be something to look at as you say.

jON


___
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang