-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from jcbf/jcbf/refuse-spf-none
Configurable refuse when SPF is none
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,13 @@ WhitelistIP 192.168.0.0/16 | |
#WhitelistTo @yourspamloverdomain.tld | ||
#WhitelistTo [email protected] | ||
|
||
# Refuse e-Mail messages at SPF None results | ||
# On empty senders this restriction will not be applied | ||
# | ||
# Default: off | ||
# | ||
#RefuseSPFNone off # (on|off) | ||
|
||
# Refuse e-Mail messages at SPF Fail results (RFC-4408) | ||
# | ||
# Default: on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- Copyright (c) 2009-2013, The Trusted Domain Project. All rights reserved. | ||
mt.echo("SPF pass test") | ||
|
||
-- try to start the filter | ||
mt.startfilter("./smf-spf", "-f", "-c","./smf-spf-tests-refuse.conf") | ||
|
||
-- try to connect to it | ||
conn = mt.connect("inet:[email protected]", 40, 0.25) | ||
if conn == nil then | ||
error("mt.connect() failed") | ||
end | ||
|
||
-- send connection information | ||
-- mt.negotiate() is called implicitly | ||
mt.macro(conn, SMFIC_CONNECT, "j", "mta.name.local") | ||
if mt.conninfo(conn, "localhost", "195.22.26.194") ~= nil then | ||
error("mt.conninfo() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_CONTINUE then | ||
error("mt.conninfo() unexpected reply") | ||
end | ||
|
||
-- send envelope macros and sender data | ||
-- mt.helo() is called implicitly | ||
mt.macro(conn, SMFIC_MAIL, "i", "t-verify-spfnone") | ||
if mt.mailfrom(conn, "<[email protected]>") ~= nil then | ||
error("mt.mailfrom() failed") | ||
end | ||
|
||
if mt.getreply(conn) ~= SMFIR_REPLYCODE then | ||
error("mt.mailfrom() unexpected reply") | ||
end | ||
|
||
print ("received SMFIR_REJECT ") | ||
|
||
mt.disconnect(conn) |