Commit Graph

43 Commits

Author SHA1 Message Date
Daniel B
a8747407be No dmarc policy (#263)
* Update data_post_headers documentation
We cannot reject at this stage, which is only there to alter headers.
Fix #258

* DMARC plugin: reject in data_post
Followup of #258: we cannot reject a connection during data_post_headers. So add a new hook in data_post to do the real rejection

* Support spf rejects when no DMARC policy is published
When using DMARC, you have to run sender_permitted_from first, and without rejecting anything. If a DMARC policy is published, then fine, the dmarc plugin will handle this. But if there's no DMARC policy at all, then we can decide solely on SPF to reject on not. This decision must be taken after dmarc runs, so, add a hook into post_data (dmarc is evaluated in post_data_headers). A new no_dmarc_policy argument is available and you can decide the level at wich you want to reject on SPF failures

* Typo
2016-05-04 14:46:24 -07:00
Matt Simerson
993bd4e7df spf: switch header appending hook
This doesn't really change anything, because the SPF plugin generally is listed in config/plugins before the `data_post` plugins that do content evaluation. This merely assures that regardless of the ordering of plugins in config/plugins, the SPF results header will be present.
2014-12-30 14:20:42 -08:00
Jonathan Hall
897a1fd8aa Remove a ton of 'return ()', and a few other minor readability tweaks. 2014-09-17 20:28:51 -05:00
Matt Simerson
c202d3ef69 dmarc integrated with Mail::DMARC
reimplemented dmarc module to use Mail::DMARC
updated SPF plugin to save SPF results in dmarc_spf note
update dkim to store DKIM results in dkim_result & dkim_verifier notes
2013-12-17 23:53:00 -05:00
Matt Simerson
4ae16219bd added Authentication-Results header, with provider
dkim, dmarc, fcrdns (iprev), spf, and smtp-auth
2013-08-05 15:05:38 -07:00
Matt Simerson
3180c9da31 SPF: added more precise disposition logs, so that
postprocess can determine if a SPF failure caused a rejection
2013-08-05 15:05:36 -07:00
Matt Simerson
c0210a7877 SPF: arrage flow so if a pass result is possible,
we will get it and set the note for DMARC plugin
2013-08-05 15:05:36 -07:00
Matt Simerson
75a3e4baae find plugins -type f -exec perltidy -b {} \; 2013-08-05 15:05:15 -07:00
Matt Simerson
f03128523c SPF: add pod, documenting spf_pass_host note 2013-08-05 15:05:14 -07:00
Matt Simerson
0f01a39e88 SPF: add trans. note spf_pass_host if SPF=pass 2013-08-05 15:05:14 -07:00
Matt Simerson
b7320a8eb9 SPF: POD formatting fix 2013-08-05 15:05:14 -07:00
Matt Simerson
5853ec1a47 spf: add comment re: Authentication-Results header 2013-08-05 15:05:13 -07:00
Matt Simerson
fc5eeec122 added karma awards for SPF pass/fail 2013-08-05 15:05:12 -07:00
Matt Simerson
af55a8d6dd SPF: use $conn->relay_client instead of duplicated
is_in_relayclients method. Expects relay plugin to have set relay_client, a reasonable assumption.
2013-08-05 15:05:09 -07:00
Matt Simerson
016d2b06bc spf: improved support for IPv6 clients 2013-08-05 15:02:17 -07:00
Matt Simerson
b6b1cdd03e SPF: more logging additions 2013-08-05 15:01:52 -07:00
Matt Simerson
1b7457b555 SPF: add more log messages 2013-08-05 15:01:50 -07:00
Matt Simerson
143534d7a6 spf: remove rcpt hook, process to completion during from 2013-08-05 15:01:50 -07:00
Matt Simerson
7ff2d050f3 initial import - based on my qpsmtpd fork
which will merge into the main branch fairly easily
2013-08-05 15:01:47 -07:00
Matt Simerson
4e2ae484a2 Merge pull request #15 from msimerson/early
consolidated chunks of code duplicated 4x into log_and_deny and log_and_...
2013-08-05 12:33:42 -07:00
Matt Simerson
5a8a9be26c make SPF level 2 a little more lenient 2012-06-04 03:34:47 -04:00
Matt Simerson
57a0e4ba7b updated plugins to use QP::Plugins::is_immune 2012-06-04 03:26:16 -04:00
Matt Simerson
51486d0b04 SPF plugin: refactored, tests, new config option
added POD description of spfquery note

changed spf_deny -> reject  (and offered 4 more options, see POD for reject)
	backwards compatible with old config settings
	replicates qmail-smtpd SPF patch behavior

improved logging (again)

uses a stringy eval 'use Mail::SPF' in the register sub. If missing, warn and log the error, and don't register any hooks. This is much nicer error than the current, "*** Remote host closed connection unexpectedly." broken mail server that results from enabling the SPF plugin without Mail::SPF installed.

background: I noticed I was deferring valid emails with the SPF plugin at 'spf_deny 1', and without changing the code, there wasn't a way to change how ~all records were handled. This provides that flexibility.
2012-05-21 04:19:45 -04:00
Matt Simerson
35f26c23bb spf plugin, added logging 2012-05-07 09:56:37 -07:00
Pim van den Berg
8f7494f0cb spf: exit relayclients while loop when client_ip doesnt match
Checking an invalid address kept looping.
2012-04-30 22:20:00 -07:00
Pim van den Berg
2ef465e7aa spf: remove DENYSOFT on SPF softfail
With a DENYSOFT (450) the sender will keep trying to deliver the e-mail.
It makes no sense.

This commit also makes it compatible again with the plugin from before commit:
02912 [rewrote sender_permitted_from]
2012-04-30 22:19:54 -07:00
Ask Bjørn Hansen
a23d4b3da9 Fix 01-syntax test failures
Exclude some tests with dependencies.

Remove -T from perl line in plugins
This makes it harder to test with PERL5LIB/perlbrew etc
2012-04-29 01:36:01 -07:00
Matt Simerson
dbaa9dbd6c POD corrections, additional tests, plugin consistency
on files in plugins dir:
  fixed a number of POD errors

  formatted some # comments into POD

  removed bare 1;  (these are plugins, not perl modules)
    most instances of this were copy/pasted from a previous plugin that had it

  removed instances of # vim ts=N ...
    they weren't consistent, many didn't match .perltidyrc

  on modules that failed perl -c tests, added 'use Qpsmtpd::Constants;'

Conflicts:

	plugins/async/check_earlytalker
	plugins/async/dns_whitelist_soft
	plugins/async/dnsbl
	plugins/async/queue/smtp-forward
	plugins/async/require_resolvable_fromhost
	plugins/async/rhsbl
	plugins/async/uribl
	plugins/auth/auth_checkpassword
	plugins/auth/auth_cvm_unix_local
	plugins/auth/auth_flat_file
	plugins/auth/auth_ldap_bind
	plugins/auth/auth_vpopmail
	plugins/auth/auth_vpopmail_sql
	plugins/auth/authdeny
	plugins/check_badmailfromto
	plugins/check_badrcptto_patterns
	plugins/check_bogus_bounce
	plugins/check_earlytalker
	plugins/check_norelay
	plugins/check_spamhelo
	plugins/connection_time
	plugins/dns_whitelist_soft
	plugins/dnsbl
	plugins/domainkeys
	plugins/greylisting
	plugins/hosts_allow
	plugins/http_config
	plugins/logging/adaptive
	plugins/logging/apache
	plugins/logging/connection_id
	plugins/logging/transaction_id
	plugins/logging/warn
	plugins/milter
	plugins/queue/exim-bsmtp
	plugins/queue/maildir
	plugins/queue/postfix-queue
	plugins/queue/smtp-forward
	plugins/quit_fortune
	plugins/random_error
	plugins/rcpt_map
	plugins/rcpt_regexp
	plugins/relay_only
	plugins/require_resolvable_fromhost
	plugins/rhsbl
	plugins/sender_permitted_from
	plugins/spamassassin
	plugins/tls
	plugins/tls_cert
	plugins/uribl
	plugins/virus/aveclient
	plugins/virus/bitdefender
	plugins/virus/clamav
	plugins/virus/clamdscan
	plugins/virus/hbedv
	plugins/virus/kavscanner
	plugins/virus/klez_filter
	plugins/virus/sophie
	plugins/virus/uvscan
2012-04-29 00:00:10 -07:00
Robert
61de599c1b Normalize #! lines on all plugins
find . -type f | xargs -n1 perl -pi.bak -0777 -e '$want = "#!perl -Tw"; s/\A#!.*\n/$want\n/; s/\A([^#])/$want\n\1/s'
2012-04-28 20:41:31 -07:00
Matt Simerson
821b182081 fixed spelling error, added spf code to notes 2012-04-28 20:15:36 -07:00
Matt Simerson
1701406f78 suppress log error when $user unset
test for and return earlier when a null sender is encountered.
Prevents using an undefined variable.
2012-04-28 20:08:17 -07:00
Matt Simerson
0291260284 rewrote sender_permitted_from
rewrote the plugin using Mail::SPF, which is the replacement for Mail::SPF::Query (by the same author).  The two plugins are mutually exclusive and SpamAssassin expects to have Mail::SPF available.

Signed-off-by: Robert <rspier@pobox.com>
2010-05-11 21:13:13 -07:00
John Peacock
8fcb46177b Add Qpsmtpd::Command to gather all parsing logic in one place (Hanno
Hecker)


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@631 958fd67b-6ff1-0310-b445-bb7760255be9
2006-04-07 18:58:02 +00:00
John Peacock
a69b2e1526 [merge from trunk] Missed hook to data_post to add headers
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@514 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-18 11:13:17 +00:00
Robert Spier
90daeb3786 r483@dog: rspier | 2005-07-06 21:17:00 -0700
The great plugin renaming in the name of inheritance and standardization commit.
 
 1. new concept of standard hook_ names.
 2. Plugin::init
 3. renamed many subroutines in plugins (and cleaned up register subs)
 4. updated README.plugins
 


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@479 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-07 04:17:39 +00:00
Robert Spier
ed2ab5f5fd From: Nick Leverton <>
Subject: SPF plugin: using it in practice (PATCH attached for CVS)
Date: Tue, 30 Nov 2004 11:35:30 +0000
Message-ID: <20041130113530.GA31737@leverton.org>


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@355 958fd67b-6ff1-0310-b445-bb7760255be9
2004-12-02 07:26:11 +00:00
Matt Sergeant
9c700b18e1 New for 0.28: Log levels and $Include for config/plugins
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@217 958fd67b-6ff1-0310-b445-bb7760255be9
2004-03-05 12:46:24 +00:00
Ask Bjørn Hansen
773ca08ebf + Update the SPF plugin (Philip Gladstone, philip@gladstonefamily.net):
+   * Integrated with Mail::SPF::Query 1.991
+   * Don't do SPF processing when you are acting as a relay system
+   * Remove the MX changes as they are now inside Mail::SPF::Query


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@201 958fd67b-6ff1-0310-b445-bb7760255be9
2004-02-03 02:57:04 +00:00
Matt Sergeant
df1a9a08ad SPF now requires the HELO string
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@199 958fd67b-6ff1-0310-b445-bb7760255be9
2003-12-11 09:07:51 +00:00
Ask Bjørn Hansen
199c2164a4 default the header to "unknown"
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@164 958fd67b-6ff1-0310-b445-bb7760255be9
2003-07-08 03:12:04 +00:00
Matt Sergeant
5a7b0c937b Patch from freeside to do things slightly more correctly
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@162 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-27 23:00:52 +00:00
Matt Sergeant
4548b77eca Right names are "fail" and "softfail" (bad docs, bad)
Add headers by default instead of issuing DENY


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@161 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-27 17:27:35 +00:00
Matt Sergeant
04f2e4ee73 Initial hack at an SPF filter
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@160 958fd67b-6ff1-0310-b445-bb7760255be9
2003-06-27 12:25:52 +00:00