From ae31730593d78e3c1fef9cf77b680fe83798957a Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 18 Feb 2019 23:33:51 -0500 Subject: [PATCH] check for actions claimed by the filter --- tests/01_connect.miltertest | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/01_connect.miltertest b/tests/01_connect.miltertest index bd4c730..4d20bd2 100755 --- a/tests/01_connect.miltertest +++ b/tests/01_connect.miltertest @@ -10,5 +10,27 @@ end if mt.getreply(conn) ~= SMFIR_CONTINUE then error "mt.conninfo() unexpected reply" end + +if mt.test_action(conn, SMFIF_ADDHDRS) then + print "could add headers" +else + error "mt.test_action() says could not add headers" +end + +if mt.test_action(conn, SMFIF_CHGHDRS) then + print "could change headers" +else + error "mt.test_action() says could not change headers" +end + +-- -- FIXME: this part of the test fails, as apparently the +-- -- dkimpy-milter claims the right to change the body of a message, +-- -- even though it shouldn't. How can we fix the negotiation? +-- if mt.test_action(conn, SMFIF_CHGBODY) then +-- error "mt.test_action() says could change body" +-- else +-- print "could not change body" +-- end + mt.disconnect(conn) mt.echo("test complete")