You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Petr Bena <pe...@bena.rocks> on 2016/10/14 19:24:08 UTC
How to get spam assassin to detect spoofed mails as SPF is clearly
useless
Hello,
I created this BT
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7360 to implement
SPF-like checks on From: sender as well in addition to envelope sender
(if they differ). It was rejected as invalid because SPF specs are
different.
That is probably true, but it doesn't change the fact that SPF specs as
they are make SPF completely useless. Anyone can spoof anyone's e-mail
right now simply by changing the From: in mail header, and majority, if
not all anti-spam software checks only envelope sender and nothing else.
DKIM and DMARC don't really help much here either. It's true it's
possible to set DMARC policies to require all From fields to be same,
but I don't think that spam assassin is capable of dealing with DMARC
either, plus this policy is really extremely weak.
Gmail has one of best antispams and antispoof protections, but it could
still be easily spoofed like this, only difference was that when you
open a header of email in gmail, you see that DMARC check failed, but
otherwise it's not mentioned anywhere.
Is there any way to get spam assassin to actually figure out that e-mail
is spoofed even if it's obviously easy to figure out? I mean, if you
have a domain with DKIM, DMARC and SPF record and someone is pretending
they are you just by forging "From:" in header, which 99% of mail
clients show as real sender of message, it should be able to recognize
that this is obvious forgery and not let the message pass through with
no score added at all... Isn't this like completely flawed design?
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Benny Pedersen <me...@junc.eu>.
On 2016-10-14 23:24, Petr Bena wrote:
> P.S. this is extremely easy to implement from programmer point of view,
> all you need to do is take existing SPF plugin and just have it verify
> SPF against e-mail that is in From header. It's probably a change of
> few
> lines of code for someone who knows perl better than me. And such
> plugin
> could be just optional and extremely useful for people who actually
> care
> about this.
why wait ?
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 14 Oct 2016, at 17:24, Petr Bena wrote:
> Also I don't understand why mailing lists /have to/ work this way. I
> know it's long-time established standard just like e-mails, but flawed
> and people are abusing it, because it's extremely easy to do that.
Welcome to the Internet: where almost every seemingly strange standard
practice is well-documented in a decades-old series of documents, many
of which get new revisions every few years but which almost no one reads
because they are too technically dense... RFC5598
(https://tools.ietf.org/html/rfc5598) is a great one that pulls together
a lot of the info from more technically specific email-related RFCs into
a Big Picture, but it's a bit longer than the average Tweet.
The RFC5321.MailFrom address is the address to which delivery failure
messages are sent by MTAs. It makes sense for this to match the
RFC5322.From for person-to-person messages but not for mailing lists,
where the original authors of messages don't care much about the
deliverability of their messages to each and every list member, while
the list admin should care but rarely cares enough to handle all the
bounces manually. Usually a mailing list RFC5321.MailFrom is unique to
each message and recipient, so that bounces can be processed and reacted
to by the mailing list software instead of requiring a human to figure
out their provenance and decide whether a list member has been bouncing
enough to be unsubbed. The human list members, on the other hand, want
their MUAs to show them who the human author of a message is,
canonically the RFC5322.From address. Complicating matters, different
lists have different purposes and cultures, such that in many cases it
makes the most sense for members to reply on-list but in others most or
all replies should be off-list. Tangling it up even more, those pesky
humans using mailing lists vary such that some prefer getting and/or
sending replies off-list, some prefer on-list, and others perniciously
insist on using "Reply All" and get snippy when others don't share their
obsession with getting duplicates of messages replying to them.
Shorter: mailing lists work this way because decades ago, people tried
simpler approaches and ran into various annoying edge and corner cases
where simpler ways needed tweaking.
> Mailing list daemon doesn't have to pretend that e-mail was sent by me
> or someone else, it could as well send it from its own address
> users@spamassassin.apache.org and write somewhere else that the mail
> was
> sent by me to this list - in fact it could even hide the email or
> somehow obfuscate it and keep just my real name, so that people
> wouldn't
> be able to send spam in there.
Some mailing lists are starting to do that in response to the attempt by
Yahoo and others to kill off open-access mailing lists with their
"p=reject" DMARC policies. Many users hate that munging, because it
means that their MUAs no longer can readily reply off-list, while
merrily showing the sender UI clues that they are doing so.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Fri, 14 Oct 2016 23:24:21 +0200
Petr Bena <pe...@bena.rocks> wrote:
> How does DKIM prevent others from spoofing your mail address? People
> will still receive unsigned e-mails that look like they were sent by
> you even if they were not.
DKIM by iself does not. DKIM plus DMARC sort-of does. (I say "sort-of"
because most mail readers hide the From: header address and only show
the full name.)
> P.S. this is extremely easy to implement from programmer point of
> view, all you need to do is take existing SPF plugin and just have it
> verify SPF against e-mail that is in From header.
You will have lots of false-positives. I know this from experience.
Regards,
Dianne.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Ralph Seichter <sp...@seichter.de>.
On 14.10.16 23:24, Petr Bena wrote:
> I know that this would break existing standards (which are flawed by
> design TBH), but why not at least make this as an optional feature?
You said it yourself: because it would break existing standards. That's
reason enough not to mess with things. The design dates back to a time
when it was important to simplify mail actually being delivered, which
it does. Hence, it is not flawed, it is just a case of not anticipating
that one day people might abuse the mechanics. Even today, I believe it
is more important to have e-mail and mailing lists actually work than to
prevent abuse.
If you happen to come up with a magic pill, feel free to crate RFCs that
one day might supersede SMTP et al.
-Ralph
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
Exactly this.
Also I don't understand why mailing lists /have to/ work this way. I
know it's long-time established standard just like e-mails, but flawed
and people are abusing it, because it's extremely easy to do that.
Mailing list daemon doesn't have to pretend that e-mail was sent by me
or someone else, it could as well send it from its own address
users@spamassassin.apache.org and write somewhere else that the mail was
sent by me to this list - in fact it could even hide the email or
somehow obfuscate it and keep just my real name, so that people wouldn't
be able to send spam in there.
I know that this would break existing standards (which are flawed by
design TBH), but why not at least make this as an optional feature? SA
could at least add some sort of a warning to mail so that it's obvious
that message send by a@b.c was not in fact sent from their server and
there is a chance that it's a spoofed message.
Whitelists could exist as well for known mailing lists.
How does DKIM prevent others from spoofing your mail address? People
will still receive unsigned e-mails that look like they were sent by you
even if they were not.
P.S. this is extremely easy to implement from programmer point of view,
all you need to do is take existing SPF plugin and just have it verify
SPF against e-mail that is in From header. It's probably a change of few
lines of code for someone who knows perl better than me. And such plugin
could be just optional and extremely useful for people who actually care
about this.
On 10/14/16 22:26, Bowie Bailey wrote:
> On 10/14/2016 3:43 PM, Kris Deugau wrote:
>> Petr Bena wrote:
>>> Is there any way to get spam assassin to actually figure out that
>>> e-mail
>>> is spoofed even if it's obviously easy to figure out?
>> Consider the case of, oh, say, this message. Or virtually every other
>> interactive mailing list on the Internet.
>>
>> Were you to do an SPF check on the From:, you would see it softfail,
>> because so far as your incoming server is concerned, it does not
>> originate from the allowed 209.91.128.0/26 IP block that matches the SPF
>> record for vianet.ca, it originates from the list server.
>>
>> There are many more similar cases where the From: has no technical
>> relation, just a real-world business relation, to the envelope sender
>> address.
>
> On the other hand, SA is a points-based system. If you checked SPF
> based on the From header, you could then whitelist known list servers
> and other exceptions and add a point or so to the rest. If you set
> the score at 0.001 and monitored the non-spam hits for a while, you
> could probably come up with a pretty good list of exceptions before
> upping the score. (Of course this assumes you are in a position where
> you can legally look at the messages passing through your system.)
>
> It could be helpful, or there could be too many exceptions to be
> useful. I'd say it's worth a try to see what happens.
>
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bowie Bailey <Bo...@BUC.com>.
On 10/15/2016 12:53 PM, Matus UHLAR - fantomas wrote:
>
> and immediately after implementing, those people and organizations
> would be
> surprised they block mail they should not block (see above).
No, it wouldn't block mail. It would add a bit to the score. If there
are other spam signs, it might be blocked or delivered to a spam
folder. That's how SA works. SA assigns positive scores to lots of
things that are RFC compliant, but are more commonly seen in spam than
in ham. You almost never mark mail as spam based on only one or two rules.
I've lost track of who was the OP, but the answer to you questions seems
to boil down to this: No, there is no SA rule or plugin that will do
what you want. And while it may be a bad idea, feel free to create a
custom plugin and give it a try. If you get positive results, let us know.
My personal feeling is that a plugin like this might work well for a
small mailserver where the number of exceptions would be manageable. It
probably would not be workable for a large mailserver with a diverse
group of users.
--
Bowie
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
>On 10/15/2016 1:51 PM, Matus UHLAR - fantomas wrote:
>>I can immediately guess this rule would need way too many exceptions to be
>>useful. And when anyone in the world subscribed to any list, it would
>>need an exception.
On 15.10.16 15:35, Petr Bena wrote:
>Nope, the exception would go for a whole mailing list, not for every
>of its users.
you did not get it: there are zillions of mailing lists, forwarderss etc.
this rule would really need too many exceptions for any mailing lists to be
useful, ever since beginning.
> Anyway given that this would be optional plugin for sa,
>it would be only used by people / organizations who care about
>authenticity of the message sender and these that would be OK with
>the fact that mail addresses within this domain just couldn't be
>easily used for stuff like mailing lists.
and immediately after implementing, those people and organizations would be
surprised they block mail they should not block (see above).
> Believe me, there are
>people or organizations who would happily exchange ability to use
>mailing lists within some domain for guarantee that their emails
>can't be spoofed in no way (at least within their own domain).
believe me, what you have proposed is nonsende - years ago Microsoft tried
to implement is under name SenderID (aka spf/2) and nobody uses it now
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
You have the right to remain silent. Anything you say will be misquoted,
then used against you.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Axb <ax...@gmail.com>.
On 10/15/2016 04:57 PM, Dianne Skoll wrote:
> On Sat, 15 Oct 2016 15:35:25 +0200
> Petr Bena <pe...@bena.rocks> wrote:
>
>> Believe me, there are people or organizations who would happily
>> exchange ability to use mailing lists within some domain for
>> guarantee that their emails can't be spoofed in no way (at least
>> within their own domain).
>
> You seriously don't understand email security.
>
> Here's a thought experiment: How does your email reader display the
> following in the From: column?
>
> From: "Petr Bena <pe...@bena.rocks>" <un...@spammer.org>
>
> and imagine that SPF, DKIM and DMARC for spammer.org all pass just fine.
>
as centuries of combined experience will never beat FUSSP .-)
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 15 Oct 2016, at 14:50, Petr Bena wrote:
> I was looking to accomplish something similar, but seems that SA can't
> do that and there are probably no open source plugins or postfix hooks
> that allow this (so far).
This class of problem is one reason to pick MIMEDefang as your tool for
integrating Postfix and SpamAssassin. Like Amavis, it loads the
SpamAssassin modules itself rather than using a spamc/spamd interaction
but unlike Amavis its main config file is a Perl script with
implementations of a filter_* subroutine for each milter phase that it
is enabled to use. If you want to write code in the filter()
implementation that parses the message to find the From header and use
it and the client IP in Mail::SPF::* calls, you are free to do so.
Probably about 15 lines of Perl, if you write loose Perl.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
On 10/15/16 20:35, Antony Stone wrote:
> On Saturday 15 October 2016 at 20:30:25, Axb wrote:
>
>> On 10/15/2016 08:13 PM, Petr Bena wrote:
>>> What I was hoping for was, that as someone who does bother checking, to
>>> find out a solution that would help me prevent from receiving spoofed
>>> e-mails
>>>
>> There is no publicly available SpamAssassin solution to cope with your
>> need.
> Hm, I am intrigued by your wording. Are you saying that there are non-
> publicly available solutions?
>
>
> Antony.
>
First of all sorry for "top posting" I have just figured out what it
means, no idea why my thunderbird was configured in that way.
Anyway, I am nearly sure that at least one of the companies I used to
work for had some of these "solutions" in place, given that they were
using MS Exchange as mailing solution I am fairly sure it was some
closed source commercial anti-spam that was doing that. I made some
shell scripts back then which were sending emails on behalf of our UNIX
team, and I remember we couldn't get them delivered to their Exchange
server as long as we used our UX team mailbox as "From:" sender. Clearly
that Exchange server was rejecting emails that were pretending to be
sent out of it, while they weren't.
I was looking to accomplish something similar, but seems that SA can't
do that and there are probably no open source plugins or postfix hooks
that allow this (so far).
So yes there are definitely some solutions out there, but whether they
are publicly available, I have no idea (I was actually hoping to
discover some).
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Axb <ax...@gmail.com>.
On 10/15/2016 08:35 PM, Antony Stone wrote:
> On Saturday 15 October 2016 at 20:30:25, Axb wrote:
>
>> On 10/15/2016 08:13 PM, Petr Bena wrote:
>>>
>>> What I was hoping for was, that as someone who does bother checking, to
>>> find out a solution that would help me prevent from receiving spoofed
>>> e-mails
>
>> There is no publicly available SpamAssassin solution to cope with your
>> need.
>
> Hm, I am intrigued by your wording. Are you saying that there are non-
> publicly available solutions?
There may be... haven't heard of one though.
certainly not part of the SA project.
Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless
Posted by Antony Stone <An...@spamassassin.open.source.it>.
On Saturday 15 October 2016 at 20:30:25, Axb wrote:
> On 10/15/2016 08:13 PM, Petr Bena wrote:
> >
> > What I was hoping for was, that as someone who does bother checking, to
> > find out a solution that would help me prevent from receiving spoofed
> > e-mails
> There is no publicly available SpamAssassin solution to cope with your
> need.
Hm, I am intrigued by your wording. Are you saying that there are non-
publicly available solutions?
Antony.
--
These clients are often infected by viruses or other malware and need to be
fixed. If not, the user at that client needs to be fixed...
- Henrik Nordstrom, on Squid users' mailing list
Please reply to the list;
please *don't* CC me.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 15 Oct 2016, at 14:13, Petr Bena wrote:
> That would obviously work and blocked hackers from spoofing,
No, it would not do so.
It's clear that you didn't bother reading Dianne Skoll's message and
considering or testing her counter-example.
> but as you said, it would also break some other stuff, like mailing
> lists for instance,
And also not work for some From spoofing, which is ridiculously easy to
do.
> so you deemed this solution evil and something what should never be
> done on any mail server, even if that mail server was used only by
> people who don't care about mailing lists at all.
I don't think anyone said "evil" but it WILL catch mail other than
mailing lists and spam. It also won't catch some forms of From header
spoofing unless you also prohibit some forms of formally allowable From
headers.
So it might be absolutely acceptable for some systems. Your server, your
rules. No one can stop you from building such a plugin, recruiting
others to help you do so and deploy it, and thereby demonstrate how
useful and how harmful such a tactic is. I do not think you will ever be
able to get such a plugin included as a part of the Apache SpamAssassin
project, but that's why OSS is so great: you can create and distribute a
plugin for SA on your own or even fork the whole project and distribute
an alternative package. You do not need the blessing of the members of
this list or of any governance mechanisms of the Apache Software
Foundation to design and implement a SpamAssassin plugin.
> So is there actually any other solution?
There is not any comprehensive solution to identify From header forgery
across all or even most domains without substantial false positive
and/or false negative rates and due to the history of Internet email
there cannot be such a solution any time soon. However, many sites can
safely control spoofing of their own domain names in their own inbound
mail rather easily if they are willing to impose some basic simple
rules, which will vary from site to site.
One could go the Full Yahoo: publish a p=reject DMARC policy, require
all users to use an authenticated submission mechanism, sign their mail
with DKIM, and honor the DMARC policy. They'd still need to filter out
the pathological cases like Dianne's example, but that is not hard or
very risky. This will also cause some other sites to refuse some mail
spoofing those domains and some sites to refuse some valid mail because
of DKIM's inherent fragility. Oh and yes: forget about mailing lists.
A purely local approach is again to require all users to use an
authenticated submission mechanism, but then just reject any mail with
any local domains in the From coming in over a port 25 connection from
untrusted IP's. Exempt mailing lists as needed. Of course this doesn't
catch forgeries of non-local domains and doesn't prevent local domains
from being forged on mail to other sites, but it is a usable approach.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Axb <ax...@gmail.com>.
On 10/15/2016 08:13 PM, Petr Bena wrote:
> Hello,
>
> What I was hoping for was, that as someone who does bother checking, to
> find out a solution that would help me prevent from receiving spoofed
> e-mails, because as I mentioned multiple times SPF, DKIM, and DMARC is
> not able to do that. I am looking for a way how to detect that e-mail is
> spoofed. Any way.
>
> Now, for sure users who do not want to bother to check will always
> receive spoofed e-mails easily, so how about users who do want to check?
> What solution that works is out there? What can you actually do to
> prevent receiving spoofed e-mails?
>
> One of solutions that I proposed is an optional SA plugin that would
> treat the email found in "From:" header as envelope sender and check
> against that, raising the score or doing something if it failed.
>
> That would obviously work and blocked hackers from spoofing, but as you
> said, it would also break some other stuff, like mailing lists for
> instance, so you deemed this solution evil and something what should
> never be done on any mail server, even if that mail server was used only
> by people who don't care about mailing lists at all.
>
> So is there actually any other solution? That is what I am looking for,
> and that is why I started this thread.
There is no publicly available SpamAssassin solution to cope with your
need.
Axb
PS:Your top posting is annoying...
> On 10/15/16 19:59, Ralph Seichter wrote:
>> On 15.10.16 17:33, Petr Bena wrote:
>>
>>> I started this discussion stating the fact that SPF, DKIM and DMARC
>>> don't prevent people from being able to spoof your email address.
>> These mechanisms are not meant to prevent spoofing (and they can't),
>> just to make it easier to detect spoofing on the receiving end. If the
>> receiver does not bother checking, decides against checking, or simply
>> is incapable of checking, the sender can jump through all sorts of hoops
>> and it won't help. And it might all fall to pieces anyway, based on what
>> the MUA displays.
>>
>> I'm not sure I understand what type of discussion you hope to nurture by
>> stating that A does not prevent B when A was not designed to prevent B.
>>
>> -Ralph
>
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Ralph Seichter <sp...@seichter.de>.
On 15.10.16 20:13, Petr Bena wrote:
> One of solutions that I proposed is an optional SA plugin that would
> treat the email found in "From:" header as envelope sender and check
> against that, raising the score or doing something if it failed.
A sending mail on behalf of B does not automatically imply illegitimate
mail. There are whole businesses based on this (which DMARC acknowledges
by the way).
> you deemed this solution evil and something what should never be done
> on any mail server, even if that mail server was used only by people
> who don't care about mailing lists at all.
That is not even close to what I wrote. Please read my message again,
and don't misrepresent my comments in a sensationalist fashion. We're
not having the U.S. presidential elections here. ;-)
> So is there actually any other solution? That is what I am looking for,
> and that is why I started this thread.
Detection of sender domain spoofing is possible, to a degree, but I
don't see how outright prevention would be possible.
-Ralph
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by David Jones <dj...@ena.com>.
>Thanks for that, I will do that, another thing that comes to my mind:
>if my mail server sign every single e-mail with DKIM, that e-mail
>should be signed even if it's redistributed by mailing list daemon
>or not? I see my own e-mails here and e-mails of some other people
>in this list to be DKIM signed.
If this passed DKIM checks, DKIM_VALID, then it should not hit
DKIM_VALID_AU in that case. Read up on whitelist_auth related
to SPF and DKIM rule hits.
>So isn't there a way to get either postfix or SA to reject or flag emails
>that are sent specifically "from my domain" but aren't signed with
>DKIM? I even think that it's possible to set a DMARC policy to require
>emails from a domain to be signed.
"From my domain" needs to be defined. I hope you know the
difference from the envelope-from and the visible From: header.
Most spammers are going to spoof the visible From: header but
the envelope-from will be different and can be blocked by good
DBLs like Invaluement and regular IP-based RBLs. The envelope-
from with your own domain can be blocked normally at the MTA
level. Your mail flow for legit senders of your domain should be
authenticating to internal or trusted mail servers that are allowed
to relay at the MTA level by IP or network before the check of the
envelope-from domain is checked. Make sure you know the
order of checks performed by your MTA.
I don't have any specific protection in place for the dozens of
domains that I filter for and we don't have a spoofing problem
with all of the MTA checks in place and a fairly well trained
Bayes database.
>This would block forged e-mails but would not block e-mails from
>mailing lists.
>Isn't it somehow possible to tell SA to score-up these mails if they
>fail this DMARC policy?
I have not needed to do any special scoring yet of DMARC failures
with the other MTA checks in place. Get your MTA tuned up a bit
and see if this solves the problem for you. This could take some
research, learning, and time to perfect. If you use Postfix, there
have been some recent postings on this mailing list related to
senderscore.org and postscreen that will help you get a good
head start.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Ralph Seichter <sp...@seichter.de>.
On 15.10.16 21:08, Petr Bena wrote:
> if my mail server sign every single e-mail with DKIM, that e-mail should
> be signed even if it's redistributed by mailing list daemon or not?
Sadly, there are mailing list admins who think it wise to have subject
lines or message bodies modified, e.g. by adding prefixes or footers.
The Roundcube Users mailing list is one such example. The modifications
will invalidate DKIM signatures if any signed header/body is affected.
Personally, I have policies that prevent e-mail sent to this type of
mailing list from ever being DKIM-signed on my end, to avoid "DKIM
failed" scores on the receiver side. Really annoying.
-Ralph
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
On 10/15/16 20:56, David Jones wrote:
>
> >What I was hoping for was, that as someone who does bother checking, to
>
> >find out a solution that would help me prevent from receiving spoofed
> >e-mails, because as I mentioned multiple times SPF, DKIM, and DMARC is
> >not able to do that. I am looking for a way how to detect that e-mail is
> >spoofed. Any way.
>
> >Now, for sure users who do not want to bother to check will always
> >receive spoofed e-mails easily, so how about users who do want to check?
> >What solution that works is out there? What can you actually do to
> >prevent receiving spoofed e-mails?
>
> >One of solutions that I proposed is an optional SA plugin that would
> >treat the email found in "From:" header as envelope sender and check
> >against that, raising the score or doing something if it failed.
>
> >That would obviously work and blocked hackers from spoofing, but as you
> >said, it would also break some other stuff, like mailing lists for
> >instance, so you deemed this solution evil and something what should
> >never be done on any mail server, even if that mail server was used only
> >by people who don't care about mailing lists at all.
>
> >So is there actually any other solution? That is what I am looking for,
> >and that is why I started this thread.
>
> The best thing you can do is setup postfix postscreen with as many
> RBLs properly weighted to block the marjority of spoofing senders.
> This has been documented on this list so search the archives.
>
> Second is setup an extensive list of whitelist_auth domains that are
> commonly spoofed (ups.com, fedex.com, dhl.com, etc. -- ebay.com
> and paypal.com are already in the default rules) then train your Bayes
> and adjust scoring on existing rules to block the spoofed spam.
>
> Depending on your user base and where your located, you can use
> language detection and country codes to add points to your SA score
> with ok_languages and the RelayCountry plugin.
>
> There is no hard and fast way to detect spoofing so just try to block
> it in SA just like any other spam. Try to reject as much as you can at
> the MTA level so SA only has to check a very small percentage of the
> mail connection attempts.
>
> Dave
Hi,
Thanks for that, I will do that, another thing that comes to my mind: if
my mail server sign every single e-mail with DKIM, that e-mail should be
signed even if it's redistributed by mailing list daemon or not? I see
my own e-mails here and e-mails of some other people in this list to be
DKIM signed.
So isn't there a way to get either postfix or SA to reject or flag
emails that are sent specifically "from my domain" but aren't signed
with DKIM? I even think that it's possible to set a DMARC policy to
require emails from a domain to be signed.
This would block forged e-mails but would not block e-mails from mailing
lists.
Isn't it somehow possible to tell SA to score-up these mails if they
fail this DMARC policy?
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by David Jones <dj...@ena.com>.
>What I was hoping for was, that as someone who does bother checking, to
>find out a solution that would help me prevent from receiving spoofed
>e-mails, because as I mentioned multiple times SPF, DKIM, and DMARC is
>not able to do that. I am looking for a way how to detect that e-mail is
>spoofed. Any way.
>Now, for sure users who do not want to bother to check will always
>receive spoofed e-mails easily, so how about users who do want to check?
>What solution that works is out there? What can you actually do to
>prevent receiving spoofed e-mails?
>One of solutions that I proposed is an optional SA plugin that would
>treat the email found in "From:" header as envelope sender and check
>against that, raising the score or doing something if it failed.
>That would obviously work and blocked hackers from spoofing, but as you
>said, it would also break some other stuff, like mailing lists for
>instance, so you deemed this solution evil and something what should
>never be done on any mail server, even if that mail server was used only
>by people who don't care about mailing lists at all.
>So is there actually any other solution? That is what I am looking for,
>and that is why I started this thread.
The best thing you can do is setup postfix postscreen with as many
RBLs properly weighted to block the marjority of spoofing senders.
This has been documented on this list so search the archives.
Second is setup an extensive list of whitelist_auth domains that are
commonly spoofed (ups.com, fedex.com, dhl.com, etc. -- ebay.com
and paypal.com are already in the default rules) then train your Bayes
and adjust scoring on existing rules to block the spoofed spam.
Depending on your user base and where your located, you can use
language detection and country codes to add points to your SA score
with ok_languages and the RelayCountry plugin.
There is no hard and fast way to detect spoofing so just try to block
it in SA just like any other spam. Try to reject as much as you can at
the MTA level so SA only has to check a very small percentage of the
mail connection attempts.
Dave
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
Hello,
What I was hoping for was, that as someone who does bother checking, to
find out a solution that would help me prevent from receiving spoofed
e-mails, because as I mentioned multiple times SPF, DKIM, and DMARC is
not able to do that. I am looking for a way how to detect that e-mail is
spoofed. Any way.
Now, for sure users who do not want to bother to check will always
receive spoofed e-mails easily, so how about users who do want to check?
What solution that works is out there? What can you actually do to
prevent receiving spoofed e-mails?
One of solutions that I proposed is an optional SA plugin that would
treat the email found in "From:" header as envelope sender and check
against that, raising the score or doing something if it failed.
That would obviously work and blocked hackers from spoofing, but as you
said, it would also break some other stuff, like mailing lists for
instance, so you deemed this solution evil and something what should
never be done on any mail server, even if that mail server was used only
by people who don't care about mailing lists at all.
So is there actually any other solution? That is what I am looking for,
and that is why I started this thread.
Thank you
On 10/15/16 19:59, Ralph Seichter wrote:
> On 15.10.16 17:33, Petr Bena wrote:
>
>> I started this discussion stating the fact that SPF, DKIM and DMARC
>> don't prevent people from being able to spoof your email address.
> These mechanisms are not meant to prevent spoofing (and they can't),
> just to make it easier to detect spoofing on the receiving end. If the
> receiver does not bother checking, decides against checking, or simply
> is incapable of checking, the sender can jump through all sorts of hoops
> and it won't help. And it might all fall to pieces anyway, based on what
> the MUA displays.
>
> I'm not sure I understand what type of discussion you hope to nurture by
> stating that A does not prevent B when A was not designed to prevent B.
>
> -Ralph
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Ralph Seichter <sp...@seichter.de>.
On 15.10.16 17:33, Petr Bena wrote:
> I started this discussion stating the fact that SPF, DKIM and DMARC
> don't prevent people from being able to spoof your email address.
These mechanisms are not meant to prevent spoofing (and they can't),
just to make it easier to detect spoofing on the receiving end. If the
receiver does not bother checking, decides against checking, or simply
is incapable of checking, the sender can jump through all sorts of hoops
and it won't help. And it might all fall to pieces anyway, based on what
the MUA displays.
I'm not sure I understand what type of discussion you hope to nurture by
stating that A does not prevent B when A was not designed to prevent B.
-Ralph
Re: The real spoofing issue
Posted by Antony Stone <An...@spamassassin.open.source.it>.
On Sunday 16 October 2016 at 17:30:19, Dianne Skoll wrote:
> Oh, and one more thing...
>
> ... every email reader I've ever used shows neither the From: address nor
> the envelope sender by default. They all default to showing the full name
> on the From: line, which naturally is impossible to protect or verify.
Indeed. This is bad (but understandable, since (a) companies like Microsoft
and Apple try to hide "all this technical stuff" from poor bewildered users,
and (b) the majority of users would not know what to make of it anyway, unless
the discrepancy were pointed out to them in no uncertain terms).
The growth of email on mobile devices with limited screen pixels doesn't help,
either, since this encourages developers of web-based or client-based email
systems to reduce the amount of detail shown to the user.
> I would love for mail readers to display this in the sender column:
>
> Dianne Skoll <df...@roaringpenguin.com> [spammer.org]
Yes. Users seem (I don't really know, I've not done a survey, but I hope?) to
have understood the "green locked padlock" / "red unlocked padlock" symbols in
their browser address lines these days, for good and bad SSL connections, so
surely something similar should be possible with email addresses?
> However, the DMARC people said UI design was not in DMARC's scope. Meh.
"Meh" indeed, however I wonder if either:
- some significant mail client provider (Thunderbird?) could be persuaded to
implement this as a feature, and see whether others catch on and copy it
- it could be included in some project such as MailScanner, which has access
to the entire email content, and can also modify anything it likes,
specifically including the subject, to highlight suspicious senders of the sort
you've outlined above ?
I know there would be false positives from such a system (neatly summarised in
a couple of your earlier postings in this thread), however these could be
dealt with in the "local configuration" aspect of running any mail server,
where the "trusted=doubtful" flag could be converted to "trusted=yes" for
specific cases.
> (And I'm not even convinced that would offer much protection... end-users
> are wonderful at ignoring red flags.)
Yes, well, that's a well-known and well-documented problem outside the scope
of any RFC, technical solution, system admin, or psychologist :(
Antony.
--
Perfection in design is achieved not when there is nothing left to add, but
rather when there is nothing left to take away.
- Antoine de Saint-Exupery
Please reply to the list;
please *don't* CC me.
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Paul Stead <pa...@zeninternet.co.uk>.
The following rules look for a From label which looks to have an email address looks for this type of spoofed address
The following would be valid, for example:
From: "paul@domain.com"<ma...@domain.com> <pa...@domain.com>
http://ruleqa.spamassassin.org/20161017-r1765221-n/T_PDS_FROM_2_EMAILS/detail
http://ruleqa.spamassassin.org/20161017-r1765221-n/T_FROM_2_EMAILS/detail - similar to above with less metas
They both seem to hit more ham than spam on the Corpus
Paul
On 18/10/16 07:27, Ruga wrote:
Yes, you can prefix a quoted string to the actual address. No, the quoted string is not part of the address.
There are two approaches here: one is to defend the spammer's abuse of the standard (intended to trick the average Joe into believing they have received mail from someone else), and the other is to read the standard
On Tue, Oct 18, 2016 at 4:02 AM, Dianne Skoll <'dfs@roaringpenguin.com'><mailto:'dfs@roaringpenguin.com'> wrote:
On Mon, 17 Oct 2016 19:11:29 -0400
Ruga <ru...@protonmail.com> wrote:
> rfc 822 (the actual standard):
Which as I mentioned is obsolete, but I'll play with you...
> authentic = "From" ":" mailbox ; Single author / ...
> mailbox = addr-spec ; simple address / phrase route-addr
> addr-spec = local-part "@" domain
And you left out the BNF of "phrase", didn't you? Tsk tsk!
You can't pick and choose pieces of RFCs, you know. They come as a package
deal.
TL;DR, the header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <so...@spammer.org>
is absolutely compliant with RFC-822 and its successors, RFC-2822 and
RFC-5322.
Regards,
Dianne.
--
Paul Stead
Systems Engineer
Zen Internet
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On October 18, 2016 2:27:09 AM EDT, Ruga <ru...@protonmail.com> wrote:
>Yes, you can prefix a quoted string to the actual address. No, the
>quoted string is not part of the address.
Indeed.
>There are two approaches here: one is to defend the spammer's abuse of
>the standard (intended to trick the average Joe into believing they
>have received mail from someone else), and the other is to read the
>standard
I think you are the one with reading comprehension problems if you are still implying my example violates the standard.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
Yes, you can prefix a quoted string to the actual address. No, the quoted string is not part of the address.
There are two approaches here: one is to defend the spammer's abuse of the standard (intended to trick the average Joe into believing they have received mail from someone else), and the other is to read the standard
On Tue, Oct 18, 2016 at 4:02 AM, Dianne Skoll <'dfs@roaringpenguin.com'> wrote:
On Mon, 17 Oct 2016 19:11:29 -0400
Ruga <ru...@protonmail.com> wrote:
> rfc 822 (the actual standard):
Which as I mentioned is obsolete, but I'll play with you...
> authentic = "From" ":" mailbox ; Single author / ...
> mailbox = addr-spec ; simple address / phrase route-addr
> addr-spec = local-part "@" domain
And you left out the BNF of "phrase", didn't you? Tsk tsk!
You can't pick and choose pieces of RFCs, you know. They come as a package
deal.
TL;DR, the header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <so...@spammer.org>
is absolutely compliant with RFC-822 and its successors, RFC-2822 and
RFC-5322.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On October 18, 2016 2:09:37 AM EDT, Ruga <ru...@protonmail.com> wrote:
>RFC 2822 and 5322 are in the "Standards Track".
>RFC 822 is still the standard.
Interesting, but the example is still RFC-compliant, even with 822.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
RFC 2822 and 5322 are in the "Standards Track".
RFC 822 is still the standard.
On Tue, Oct 18, 2016 at 2:52 AM, Dianne Skoll <'dfs@roaringpenguin.com'> wrote:
On October 17, 2016 7:11:29 PM EDT, Ruga <ru...@protonmail.com> wrote:
>rfc 822 (the actual standard):
Are you serious? RFC 822 is decades obsolete, long since superseded by 2822 and then by 5322.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On October 17, 2016 7:11:29 PM EDT, Ruga <ru...@protonmail.com> wrote:
>rfc 822 (the actual standard):
Are you serious? RFC 822 is decades obsolete, long since superseded by 2822 and then by 5322.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Mon, 17 Oct 2016 19:11:29 -0400
Ruga <ru...@protonmail.com> wrote:
> rfc 822 (the actual standard):
Which as I mentioned is obsolete, but I'll play with you...
> authentic = "From" ":" mailbox ; Single author / ...
> mailbox = addr-spec ; simple address / phrase route-addr
> addr-spec = local-part "@" domain
And you left out the BNF of "phrase", didn't you? Tsk tsk!
You can't pick and choose pieces of RFCs, you know. They come as a package
deal.
TL;DR, the header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <so...@spammer.org>
is absolutely compliant with RFC-822 and its successors, RFC-2822 and
RFC-5322.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
rfc 822 (the actual standard):
authentic = "From" ":" mailbox ; Single author / ...
mailbox = addr-spec ; simple address / phrase route-addr
addr-spec = local-part "@" domain
On Tue, Oct 18, 2016 at 12:52 AM, Ruga <'ruga@protonmail.com'> wrote:
https://tools.ietf.org/html/rfc5322#section-3.6.2
On Mon, Oct 17, 2016 at 2:18 AM, Dianne Skoll <'dfs@roaringpenguin.com'> wrote:
On Sun, 16 Oct 2016 18:08:20 -0400
Ruga <ru...@protonmail.com> wrote:
> In my servers, the above string is not RFC compliant,
> and therefore the whole mail is automatically
> rejected as SPAM.
Your servers fail in RFC comprehension. The message header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
is absolutely 100% RFC-compliant.
If you feel it is not, please cite the RFC that's violated, including
the specific section being violated.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Joseph Brennan <br...@columbia.edu>.
--On October 18, 2016 at 02:06:38 -0400 Ruga <ru...@protonmail.com> wrote:
>
> <<In all cases, the "From:" field SHOULD NOT contain any mailbox that
> does not belong to the author(s) of the message.>>
... unless you're applying DMARC, which says the "From:" should instead
"align" with something other than the author of the message in some cases.
--Joseph Brennan
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Tue, 18 Oct 2016 02:06:38 -0400
Ruga <ru...@protonmail.com> wrote:
> <<In all cases, the "From:" field SHOULD NOT contain any mailbox that
> does not belong to the author(s) of the message.>>
A Quoted-String phrase is NOT a mailbox. It's just a quoted string
that is not subject to any further interpretation.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
<<In all cases, the "From:" field SHOULD NOT contain any mailbox that does not belong to the author(s) of the message.>>
On Tue, Oct 18, 2016 at 1:25 AM, Paul Stead <'paul.stead@zeninternet.co.uk'> wrote:
On 17/10/16 23:52, Ruga wrote:
https://tools.ietf.org/html/rfc5322#section-3.6.2
from = "From:" mailbox-list CRLF ... https://tools.ietf.org/html/rfc5322#section-3.4 ... ---8<--- mailbox = name-addr / addr-spec name-addr = [display-name] angle-addr display-name = phrase mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list Normally, a mailbox is composed of two parts: (1) an optional display name that indicates the name of the recipient (which can be a person or a system) that could be displayed to the user of a mail application, and (2) an addr-spec address enclosed in angle brackets ("<" and ">"). There is an alternate simple form of a mailbox where the addr-spec address appears alone, without the recipient's name or the angle brackets. The Internet addr-spec address is described in [section 3.4.1](https://tools.ietf.org/html/rfc5322#section-3.4.1).
--
Paul Stead
Systems Engineer
Zen Internet
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Paul Stead <pa...@zeninternet.co.uk>.
On 17/10/16 23:52, Ruga wrote:
https://tools.ietf.org/html/rfc5322#section-3.6.2
from = "From:" mailbox-list CRLF
...
https://tools.ietf.org/html/rfc5322#section-3.4
...
---8<---
mailbox = name-addr / addr-spec
name-addr = [display-name] angle-addr
display-name = phrase
mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
Normally, a mailbox is composed of two parts: (1) an optional display
name that indicates the name of the recipient (which can be a person
or a system) that could be displayed to the user of a mail
application, and (2) an addr-spec address enclosed in angle brackets
("<" and ">"). There is an alternate simple form of a mailbox where
the addr-spec address appears alone, without the recipient's name or
the angle brackets. The Internet addr-spec address is described in
section 3.4.1<https://tools.ietf.org/html/rfc5322#section-3.4.1>.
--
Paul Stead
Systems Engineer
Zen Internet
Re: The real spoofing issue
Posted by Ralph Seichter <sp...@seichter.de>.
On 18.10.16 00:52, Ruga wrote:
> https://tools.ietf.org/html/rfc5322#section-3.6.2
The header line
From: "John Doe <jo...@doe.org>" <jd...@thedoefamily.net>
does not violate the RFC section you linked. It may be unusual, and you
are of course free to personally (!) use it as a spam indicator, but it
is definitely RFC-compliant, so don't try to tell people otherwise.
-Ralph
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
https://tools.ietf.org/html/rfc5322#section-3.6.2
On Mon, Oct 17, 2016 at 2:18 AM, Dianne Skoll <'dfs@roaringpenguin.com'> wrote:
On Sun, 16 Oct 2016 18:08:20 -0400
Ruga <ru...@protonmail.com> wrote:
> In my servers, the above string is not RFC compliant,
> and therefore the whole mail is automatically
> rejected as SPAM.
Your servers fail in RFC comprehension. The message header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
is absolutely 100% RFC-compliant.
If you feel it is not, please cite the RFC that's violated, including
the specific section being violated.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 16 Oct 2016, at 18:08, Ruga wrote:
>> From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
>
> In my servers, the above string is not RFC compliant,
Are you writing your own RFC's? That's cool: the IETF could do with some
competition. Where are you publishing them and accepting comments?
The IETF's RFC5322 includes this ABNF ultimately specifying the From
header:
local-part = dot-atom / quoted-string / obs-local-part
domain = dot-atom / domain-literal / obs-domain
domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
dtext = %d33-90 / ; Printable US-ASCII
%d94-126 / ; characters not including
obs-dtext ; "[", "]", or "\"
qtext = %d33 / ; Printable US-ASCII
%d35-91 / ; characters not including
%d93-126 / ; "\" or the quote character
obs-qtext
quoted-pair = ("\" (VCHAR / WSP)) / obs-qp
qcontent = qtext / quoted-pair
quoted-string = [CFWS]
DQUOTE *([FWS] qcontent) [FWS] DQUOTE
[CFWS]
word = atom / quoted-string
phrase = 1*word / obs-phrase
display-name = phrase
angle-addr = [CFWS] "<" addr-spec ">" [CFWS] /
obs-angle-addr
name-addr = [display-name] angle-addr
addr-spec = local-part "@" domain
mailbox = name-addr / addr-spec
mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
from = "From:" mailbox-list CRLF
It seems to me that Dianne's example is entirely legal as a From header,
essentially because you can put almost anything inside a quoted-string.
You'll note that I've left out all the still-legal 'obs-*' component
specs because you do not need them in this case. Note that RFC5322 did
not expand what is allowed in a From header.
Re: The real spoofing issue
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Mon, 17 Oct 2016 14:45:11 +0100
RW <rw...@googlemail.com> wrote:
> On Mon, 17 Oct 2016 15:20:27 +0200
> Ralph Seichter wrote:
> > From: "John Doe <jo...@doe.org>" <jd...@thedoefamily.net>
> > is perfectly legitimate.
> but an unusual and rather silly thing to do.
As I mentioned, Yahoo Groups did something like this last time I checked.
They did it in order not to break DMARC, but still make the original sender
address visible.
> Most of what SpamAssassin targets is RFC compliant. It would be
> perfectly legitimate to score bogus addresses in the display name if
> it proved useful.
Yes, and spammers would move on to something like:
From: =?UTF-8?Q?John=20Doe=20=3Cjohn=E2=80=8B=40=E2=80=8Bdoe.org=3E?= <jd...@thedoefamily.net>
To answer the obvious question, (0xE2 0x80 0x8B) is UTF-8 for a
zero-width space, meaning the mail reader would display an apparent
email address but no sane parser would extract an email address.
Making a parser that could cope with all the tricks in the Unicode
toolbox would be very hard.
Regards,
Dianne.
Re: The real spoofing issue
Posted by RW <rw...@googlemail.com>.
On Mon, 17 Oct 2016 16:30:43 +0200
Ralph Seichter wrote:
> On 17.10.16 15:45, RW wrote:
>
> > Most of what SpamAssassin targets is RFC compliant. It would be
> > perfectly legitimate to score bogus addresses in the display name
> > if it proved useful.
>
> With "useful" being open to interpretation.
As with everything, "useful" comes from rule QA and feedback.
> Some of my customers
> are willing to accept a much higher degree of potential spam than
> others, to ensure that legitimate mail is less likely to be weeded
> out. Still, as long as the default SA scores are zero (or close to
> zero) it might be feasible to check if the decoded From-Header
> contains mismatching e-mail addresses. It could be a spoof attempt,
> it could be misconfigured software, but it could also be legitimate.
I'm not saying that it should be done, in my experience spammers don't
usually put email addresses there. My point is that RFC compliance is
irrelevant.
Re: The real spoofing issue
Posted by Ralph Seichter <sp...@seichter.de>.
On 17.10.16 15:45, RW wrote:
> Most of what SpamAssassin targets is RFC compliant. It would be
> perfectly legitimate to score bogus addresses in the display name
> if it proved useful.
With "useful" being open to interpretation. ;-) Some of my customers are
willing to accept a much higher degree of potential spam than others, to
ensure that legitimate mail is less likely to be weeded out. Still, as
long as the default SA scores are zero (or close to zero) it might be
feasible to check if the decoded From-Header contains mismatching e-mail
addresses. It could be a spoof attempt, it could be misconfigured
software, but it could also be legitimate.
-Ralph
Re: The real spoofing issue
Posted by RW <rw...@googlemail.com>.
On Mon, 17 Oct 2016 15:20:27 +0200
Ralph Seichter wrote:
> On 17.10.16 02:38, Benny Pedersen wrote:
>
> > one could argue if From:Name and From:Addr have differing domains
> > its forged ?
>
> Which RFC defines "From:Name" and "From:Addr" (I don't see the terms
> in RFC5322), and where does it say that domain names must match if
> they are present? The header line
>
> From: "John Doe <jo...@doe.org>" <jd...@thedoefamily.net>
>
> is perfectly legitimate.
but an unusual and rather silly thing to do.
> Guessing whether or not domains are related
> is not something I'd like a piece of software to do.
Most of what SpamAssassin targets is RFC compliant. It would be
perfectly legitimate to score bogus addresses in the display name if
it proved useful.
Re: The real spoofing issue
Posted by Ralph Seichter <sp...@seichter.de>.
On 17.10.16 02:38, Benny Pedersen wrote:
> one could argue if From:Name and From:Addr have differing domains its
> forged ?
Which RFC defines "From:Name" and "From:Addr" (I don't see the terms in
RFC5322), and where does it say that domain names must match if they are
present? The header line
From: "John Doe <jo...@doe.org>" <jd...@thedoefamily.net>
is perfectly legitimate. Guessing whether or not domains are related is
not something I'd like a piece of software to do.
-Ralph
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Benny Pedersen <me...@junc.eu>.
On 2016-10-17 02:18, Dianne Skoll wrote:
> From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
>
> is absolutely 100% RFC-compliant.
lets break test it :)
> If you feel it is not, please cite the RFC that's violated, including
> the specific section being violated.
one could argue if From:Name and From:Addr have differing domains its
forged ?
Re: The real spoofing issue (was Re: How to get spam assassin to
detect spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Sun, 16 Oct 2016 18:08:20 -0400
Ruga <ru...@protonmail.com> wrote:
> In my servers, the above string is not RFC compliant,
> and therefore the whole mail is automatically
> rejected as SPAM.
Your servers fail in RFC comprehension. The message header:
From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
is absolutely 100% RFC-compliant.
If you feel it is not, please cite the RFC that's violated, including
the specific section being violated.
Regards,
Dianne.
Re: The real spoofing issue (was Re: How to get spam assassin to detect spoofed mails as SPF is clearly useless)
Posted by Ruga <ru...@protonmail.com>.
> From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
In my servers, the above string is not RFC compliant,
and therefore the whole mail is automatically
rejected as SPAM.
The real spoofing issue (was Re: How to get spam assassin to detect
spoofed mails as SPF is clearly useless)
Posted by Dianne Skoll <df...@roaringpenguin.com>.
Oh, and one more thing...
Even if there were a magic bullet to absolutely detect forged From:
addresses and forged envelope senders... it would not help with
phishing attacks and spoofing. That's because every email reader I've
ever used shows neither the From: address nor the envelope sender by
default. They all default to showing the full name on the From: line,
which naturally is impossible to protect or verify. On the DMARC list quite
a while ago, I was agitating for a recommendation that mail readers SHOULD
show the domain part of the from header, just like Slashot displays the
domain associated with a link. So if the From: header looked like this:
From: "Dianne Skoll <df...@roaringpenguin.com>" <un...@spammer.org>
I would love for mail readers to display this in the sender column:
Dianne Skoll <df...@roaringpenguin.com> [spammer.org]
However, the DMARC people said UI design was not in DMARC's scope. Meh.
Regards,
Dianne.
(And I'm not even convinced that would offer much protection... end-users
are wonderful at ignoring red flags.)
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Sat, 15 Oct 2016 17:33:00 +0200
Petr Bena <pe...@bena.rocks> wrote:
> What exactly were you trying to tell me?
I'm trying to tell you that unless we throw out SMTP, there is *no way*
to detect spoofed email. That's because SMTP allows for "legitimate"
spoofing (AKA mailing lists) which makes it impossible to figure out what
"illegitimate" spoofing is, in the general case.
I did mention that you can use local domain-specific knowledge to add
a measure of protection to your own inbound email, but that such
measures are not generally applicable.
Regards,
Dianne.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 15 Oct 2016, at 11:33, Petr Bena wrote:
> I don't understand your point. I started this discussion stating the
> fact that SPF, DKIM and DMARC don't prevent people from being able to
> spoof your email address.
>
> And you tell me that I don't understand email security because SPF,
> DKIM
> and DMARC don't prevent people from being able to spoof my email
> address?
No. Note which part of your message Dianne responded to.
> What exactly were you trying to tell me?
I can't answer for her but I can offer a more direct and verbosely
explicit message:
"Spoofing" of the From header is not primarily a technical problem, it
is a human problem. Humans want to see just another human's name in a
"From" field but are accustomed to also seeing email addresses
sometimes, because email clients vary in how and how well they can
interpret the arcane variant formats that can exist in From headers.
Complicating that further, people do things with email that can be
surprising and problematic to model technically, only sometimes being
formally wrong. To "guarantee" that From headers cannot be effectively
spoofed you need to constrain the From headers of ALL mail you handle to
a much simpler family of formats than what RFC5322 allows, which WILL
cause the rejection of legitimate mail.
> On 10/15/16 16:57, Dianne Skoll wrote:
>> On Sat, 15 Oct 2016 15:35:25 +0200
>> Petr Bena <pe...@bena.rocks> wrote:
>>
>>> Believe me, there are people or organizations who would happily
>>> exchange ability to use mailing lists within some domain for
>>> guarantee that their emails can't be spoofed in no way (at least
>>> within their own domain).
>> You seriously don't understand email security.
>>
>> Here's a thought experiment: How does your email reader display the
>> following in the From: column?
>>
>> From: "Petr Bena <pe...@bena.rocks>" <un...@spammer.org>
>>
>> and imagine that SPF, DKIM and DMARC for spammer.org all pass just
>> fine.
>>
>> Regards,
>>
>> Dianne.
>
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
I don't understand your point. I started this discussion stating the
fact that SPF, DKIM and DMARC don't prevent people from being able to
spoof your email address.
And you tell me that I don't understand email security because SPF, DKIM
and DMARC don't prevent people from being able to spoof my email address?
What exactly were you trying to tell me?
On 10/15/16 16:57, Dianne Skoll wrote:
> On Sat, 15 Oct 2016 15:35:25 +0200
> Petr Bena <pe...@bena.rocks> wrote:
>
>> Believe me, there are people or organizations who would happily
>> exchange ability to use mailing lists within some domain for
>> guarantee that their emails can't be spoofed in no way (at least
>> within their own domain).
> You seriously don't understand email security.
>
> Here's a thought experiment: How does your email reader display the
> following in the From: column?
>
> From: "Petr Bena <pe...@bena.rocks>" <un...@spammer.org>
>
> and imagine that SPF, DKIM and DMARC for spammer.org all pass just fine.
>
> Regards,
>
> Dianne.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Sat, 15 Oct 2016 15:35:25 +0200
Petr Bena <pe...@bena.rocks> wrote:
> Believe me, there are people or organizations who would happily
> exchange ability to use mailing lists within some domain for
> guarantee that their emails can't be spoofed in no way (at least
> within their own domain).
You seriously don't understand email security.
Here's a thought experiment: How does your email reader display the
following in the From: column?
From: "Petr Bena <pe...@bena.rocks>" <un...@spammer.org>
and imagine that SPF, DKIM and DMARC for spammer.org all pass just fine.
Regards,
Dianne.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Petr Bena <pe...@bena.rocks>.
Nope, the exception would go for a whole mailing list, not for every of
its users. Anyway given that this would be optional plugin for sa, it
would be only used by people / organizations who care about authenticity
of the message sender and these that would be OK with the fact that mail
addresses within this domain just couldn't be easily used for stuff like
mailing lists. Believe me, there are people or organizations who would
happily exchange ability to use mailing lists within some domain for
guarantee that their emails can't be spoofed in no way (at least within
their own domain).
On 10/15/2016 1:51 PM, Matus UHLAR - fantomas wrote:
> On 14.10.16 16:26, Bowie Bailey wrote:
>> On the other hand, SA is a points-based system. If you checked SPF
>> based on the From header, you could then whitelist known list servers
>> and other exceptions and add a point or so to the rest. If you set
>> the score at 0.001 and monitored the non-spam hits for a while, you
>> could probably come up with a pretty good list of exceptions before
>> upping the score. (Of course this assumes you are in a position
>> where you can legally look at the messages passing through your system.)
>>
>> It could be helpful, or there could be too many exceptions to be
>> useful. I'd say it's worth a try to see what happens.
>
> I can immediately guess this rule would need way too many exceptions
> to be
> useful. And when anyone in the world subscribed to any list, it would
> need
> an exception.
>
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 14.10.16 16:26, Bowie Bailey wrote:
>On the other hand, SA is a points-based system. If you checked SPF
>based on the From header, you could then whitelist known list servers
>and other exceptions and add a point or so to the rest. If you set
>the score at 0.001 and monitored the non-spam hits for a while, you
>could probably come up with a pretty good list of exceptions before
>upping the score. (Of course this assumes you are in a position
>where you can legally look at the messages passing through your
>system.)
>
>It could be helpful, or there could be too many exceptions to be
>useful. I'd say it's worth a try to see what happens.
I can immediately guess this rule would need way too many exceptions to be
useful. And when anyone in the world subscribed to any list, it would need
an exception.
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
99 percent of lawyers give the rest a bad name.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Bowie Bailey <Bo...@BUC.com>.
On 10/14/2016 3:43 PM, Kris Deugau wrote:
> Petr Bena wrote:
>> Is there any way to get spam assassin to actually figure out that e-mail
>> is spoofed even if it's obviously easy to figure out?
> Consider the case of, oh, say, this message. Or virtually every other
> interactive mailing list on the Internet.
>
> Were you to do an SPF check on the From:, you would see it softfail,
> because so far as your incoming server is concerned, it does not
> originate from the allowed 209.91.128.0/26 IP block that matches the SPF
> record for vianet.ca, it originates from the list server.
>
> There are many more similar cases where the From: has no technical
> relation, just a real-world business relation, to the envelope sender
> address.
On the other hand, SA is a points-based system. If you checked SPF
based on the From header, you could then whitelist known list servers
and other exceptions and add a point or so to the rest. If you set the
score at 0.001 and monitored the non-spam hits for a while, you could
probably come up with a pretty good list of exceptions before upping the
score. (Of course this assumes you are in a position where you can
legally look at the messages passing through your system.)
It could be helpful, or there could be too many exceptions to be
useful. I'd say it's worth a try to see what happens.
--
Bowie
Re: How to get spam assassin to detect spoofed mails as SPF is clearly
useless
Posted by Kris Deugau <kd...@vianet.ca>.
Petr Bena wrote:
> Is there any way to get spam assassin to actually figure out that e-mail
> is spoofed even if it's obviously easy to figure out?
Consider the case of, oh, say, this message. Or virtually every other
interactive mailing list on the Internet.
Were you to do an SPF check on the From:, you would see it softfail,
because so far as your incoming server is concerned, it does not
originate from the allowed 209.91.128.0/26 IP block that matches the SPF
record for vianet.ca, it originates from the list server.
There are many more similar cases where the From: has no technical
relation, just a real-world business relation, to the envelope sender
address.
-kgd
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Dianne Skoll <df...@roaringpenguin.com>.
On Fri, 14 Oct 2016 21:24:08 +0200
Petr Bena <pe...@bena.rocks> wrote:
> That is probably true, but it doesn't change the fact that SPF specs
> as they are make SPF completely useless.
It also doesn't change the fact that running SPF on the From: header
domain is completely wrong and will break all kinds of things.
> Is there any way to get spam assassin to actually figure out that
> e-mail is spoofed even if it's obviously easy to figure out?
No. Because there is no definitive way to determine if an email is
"spoofed". Tell me, is this email spoofed? The header from
<df...@roaringpenguin.com> clearly fails SPF, and the envelope sender is
likely to be something in the "spamassassin.apache.org" domain. This is
obviously spoofed.
By any sensible measure, all of this list traffic is spoofed.
> Isn't this like completely flawed design?
SMTP provides no authentication. So when nothing can be
authenticated, there's no such thing as "spoofing". Arguably, it's a
flawed design, but inarguably it's much to late to replace SMTP.
DKIM is about the best we have, but even that doesn't pretend to
prevent spoofing. All it does is assert that a specific email passed
through and was signed by a server that knows the private key
corresponding to a certain public key.
Regards,
Dianne.
P.S. The situation is not all bleak, of course. Knowledge of your own domain
can let you make rules that do help to stop spear-phishing attacks, but
these are domain-specific and not generally applicable.
Re: How to get spam assassin to detect spoofed mails as SPF is
clearly useless
Posted by Benny Pedersen <me...@junc.eu>.
On 2016-10-14 21:24, Petr Bena wrote:
> I created this BT
> https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7360 to implement
> SPF-like checks on From: sender as well in addition to envelope sender
> (if they differ). It was rejected as invalid because SPF specs are
> different.
Authentication-Results: linode.junc.eu; spf=pass (sender SPF authorized)
smtp.mailfrom=spamassassin.apache.org (client-ip=140.211.11.3;
helo=mail.apache.org;
envelope-from=users-return-113753-me=junc.eu@spamassassin.apache.org;
receiver=me@junc.eu)
Authentication-Results: linode.junc.eu; dmarc=none
header.from=bena.rocks
Authentication-Results: linode.junc.eu; dkim=none; dkim-atps=neutral
if you begin dkim signing your own mails, and add dmarc its could help
to block forging your domain as sender
spamassassin can reuse opendmarc results, what hold you back on doing
this ?
if gmail is good why ask for something that is outside of gmail ?
note gmail does not care of dnssec, and thus dkim can pass without
dnssec is like there was no dkim pass for me
poor manns spoof tests is to check if dkim pass or not, while if deeper
testing is implement dmarc in spamassassin with full dnssec check,
aswell if adsp says is sign all mail and dkim signature is missing its
forged
so in spamassassin its possible to add adsp require to domains that is
often sending forged mails, even that domain does not use dkim
note spf is not using dnssec as is now, but dkim and dmarc is
so i say dkim/dmarc is bad since it allow pass on non dnssec domains :(