diff --git a/Makefile b/Makefile index b315077..7cff08b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index c143301..2dd568c 100644 --- a/README.md +++ b/README.md @@ -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:** diff --git a/smf-spf.c b/smf-spf.c index f7fe3b8..65b9a38 100644 --- a/smf-spf.c +++ b/smf-spf.c @@ -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 @@ -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"))) diff --git a/tests/05-cache-test-fail.lua b/tests/05-cache-test-fail.lua index 02acff1..f4c689c 100644 --- a/tests/05-cache-test-fail.lua +++ b/tests/05-cache-test-fail.lua @@ -30,8 +30,26 @@ if mt.getreply(conn) ~= SMFIR_CONTINUE then error("mt.mailfrom() unexpected reply") end +if mt.rcptto(conn, "") ~= nil then + error("mt.rcptto() failed") +end +if mt.getreply(conn) ~= SMFIR_CONTINUE then + error("mt.rcptto() unexpected reply") +end +if mt.rcptto(conn, "") ~= nil then + error("mt.rcptto() failed") +end +if mt.getreply(conn) ~= SMFIR_CONTINUE then + error("mt.rcptto() unexpected reply") +end +if mt.rcptto(conn, "") ~= 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 diff --git a/tests/05-cache-test.lua b/tests/05-cache-test.lua index 40b5946..8a33c4c 100644 --- a/tests/05-cache-test.lua +++ b/tests/05-cache-test.lua @@ -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, "") ~= nil then +if mt.mailfrom(conn, "") ~= nil then error("mt.mailfrom() failed") end if mt.getreply(conn) ~= SMFIR_CONTINUE then @@ -209,4 +209,4 @@ else error("missing Authentication-Results field") end -mt.disconnect(conn) \ No newline at end of file +mt.disconnect(conn)