Skip to content

Commit

Permalink
Merge pull request #85 from jcbf/prepare_2.5.1
Browse files Browse the repository at this point in the history
Prepare 2.5.1
  • Loading branch information
jcbf committed Nov 12, 2020
2 parents e27c988 + acc3e3e commit 20deb21
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION ?= 2.5
VERSION = $(shell grep -E '^\#define\s+VERSION' smf-spf.c | cut -d\" -f2)

CC = gcc
PREFIX = /usr/local
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ This was abandoned code and has several bugfixes and enhancements. like:
- Create a test suite and coverage tests
- Configurable refuse when SPF is none
- Reject NDR when there is no SPF policy defined
- Added outbound mail related features
- Skip evaluation for authenticated users
- Allow source IP replacement for outbound evaluation


## [v2.5.1](https://github.com/jcbf/smf-spf/tree/v2.5.1) (2020-11-12)
[Full Changelog](https://github.com/jcbf/smf-spf/compare/v2.5.0...v2.5.1)

**Fixed bugs:**

- Config values with spaces are ignore [\#82](https://github.com/jcbf/smf-spf/issues/82)
- Fix travis [\#84](https://github.com/jcbf/smf-spf/pull/84) ([jcbf](https://github.com/jcbf))
- Added missing commits for skipAuth feature [\#80](https://github.com/jcbf/smf-spf/pull/80) ([jcbf](https://github.com/jcbf))

[Full Changelog](https://github.com/jcbf/smf-spf/compare/2.4.5...v2.5.0)

## [v2.5.0](https://github.com/jcbf/smf-spf/tree/v2.5.0) (2020-10-04)

**Implemented enhancements:**
Expand Down
14 changes: 2 additions & 12 deletions smf-spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#define QUARANTINE 0
#define DAEMONIZE 1
#define SKIP_AUTH true
#define VERSION "2.5.0"
#define VERSION "2.5.1"
#define REJECT_REASON "Rejected, look at http://www.openspf.org/why.html?sender=%s&ip=%s&receiver=%s"
#define SYSLOG_DISABLE -2
#define SKIP_NDR false
Expand Down Expand Up @@ -923,17 +923,7 @@ static sfsistat smf_envfrom(SMFICTX *ctx, char **args) {
strtolower(context->sender);
if (conf.froms && from_check(context->sender)) return SMFIS_ACCEPT;
}
if (context->rcpts) {
STR *it = context->rcpts, *it_next;

while (it) {
it_next = it->next;
SAFE_FREE(it->str);
SAFE_FREE(it);
it = it_next;
}
context->rcpts = NULL;
}
SAFE_FREE(context->rcpts);
SAFE_FREE(context->subject);
context->status = SPF_RESULT_NONE;
if ((site = smfi_getsymval(ctx, "j")))
Expand Down
20 changes: 19 additions & 1 deletion tests/05-cache-test-fail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,26 @@ if mt.getreply(conn) ~= SMFIR_CONTINUE then
error("mt.mailfrom() unexpected reply")
end

if mt.rcptto(conn, "<user@example.com>") ~= nil then
error("mt.rcptto() failed")
end
if mt.getreply(conn) ~= SMFIR_CONTINUE then
error("mt.rcptto() unexpected reply")
end
if mt.rcptto(conn, "<user2@example.com>") ~= nil then
error("mt.rcptto() failed")
end
if mt.getreply(conn) ~= SMFIR_CONTINUE then
error("mt.rcptto() unexpected reply")
end
if mt.rcptto(conn, "<user3@example.com>") ~= nil then
error("mt.rcptto() failed")
end
if mt.getreply(conn) ~= SMFIR_CONTINUE then
error("mt.rcptto() unexpected reply")
end

-- send headers
-- mt.rcptto() is called implicitly
if mt.header(conn, "From", "user") ~= nil then
error("mt.header(From) failed")
end
Expand Down
4 changes: 2 additions & 2 deletions tests/05-cache-test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ end
-- send envelope macros and sender data
-- mt.helo() is called implicitly
mt.macro(conn, SMFIC_MAIL, "i", "t-verify-malformed")
if mt.mailfrom(conn, "<user@underspell.com>") ~= nil then
if mt.mailfrom(conn, "<user2@underspell.com>") ~= nil then
error("mt.mailfrom() failed")
end
if mt.getreply(conn) ~= SMFIR_CONTINUE then
Expand Down Expand Up @@ -209,4 +209,4 @@ else
error("missing Authentication-Results field")
end

mt.disconnect(conn)
mt.disconnect(conn)

0 comments on commit 20deb21

Please sign in to comment.