-
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 #80 from jcbf/#79_feature_skipauth
Add test for skipAuth feature
- Loading branch information
Showing
6 changed files
with
155 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
# To fully customize the contents of this image, use the following Dockerfile instead: | ||
# https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/ubuntu-18.04-git/.devcontainer/Dockerfile | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-ubuntu-18.04 | ||
|
||
# ** [Optional] Uncomment this section to install additional packages. ** | ||
# | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US.UTF-8 | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV NODE_TLS_REJECT_UNAUTHORIZED=0 | ||
RUN apt-get update \ | ||
&& apt-get -y upgrade \ | ||
&& apt-get -y install --no-install-recommends locales build-essential libmilter-dev libspf2-dev opendkim-tools lcov\ | ||
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV DEBIAN_FRONTEND=dialog | ||
|
||
|
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,29 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/ubuntu-18.04-git | ||
{ | ||
"name": "Ubuntu 18.04 mf-spf devel", | ||
"dockerFile": "Dockerfile", | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [] | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
|
||
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-in-docker. | ||
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], | ||
|
||
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust | ||
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. | ||
// "remoteUser": "vscode" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- Copyright (c) 2009-2013, The Trusted Domain Project. All rights reserved. | ||
mt.echo("SPF helo pass test") | ||
|
||
-- try to start the filter | ||
mt.startfilter("./smf-spf", "-f", "-c","tests/conf/smf-spf-tests-natip.conf") | ||
|
||
-- try to connect to it | ||
conn = mt.connect("inet:2424@127.0.0.1", 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, "helo.underspell.com","10.11.12.13") ~= nil then | ||
error("mt.conninfo() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_CONTINUE then | ||
error("mt.conninfo() unexpected reply") | ||
end | ||
|
||
if mt.helo(conn, "helo.underspell.com") ~= nil then | ||
error("mt.helo() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_CONTINUE then | ||
error("mt.helo() unexpected reply") | ||
end | ||
|
||
-- send envelope macros and sender data | ||
-- mt.helo() is called implicitly | ||
mt.macro(conn, SMFIC_MAIL, "i", "t-empty-sender") | ||
if mt.mailfrom(conn, "<>") ~= nil then | ||
error("mt.mailfrom() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_ACCEPT then | ||
error("mt.mailfrom() unexpected reply") | ||
else | ||
mt.echo ("Got ACCEPT") | ||
end | ||
mt.disconnect(conn) |
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,39 @@ | ||
-- Copyright (c) 2009-2013, The Trusted Domain Project. All rights reserved. | ||
mt.echo("SPF skip auth test") | ||
|
||
-- try to start the filter | ||
mt.startfilter("./smf-spf", "-f", "-c","tests/conf/smf-spf-tests-skipauth.conf") | ||
|
||
-- try to connect to it | ||
conn = mt.connect("inet:2424@127.0.0.1", 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", "192.0.0.194") ~= nil then | ||
error("mt.conninfo() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_CONTINUE then | ||
error("mt.conninfo() unexpected reply") | ||
end | ||
|
||
if mt.helo(conn, "underspell.com") ~= nil then | ||
error("mt.helo() failed") | ||
end | ||
if mt.getreply(conn) ~= SMFIR_CONTINUE then | ||
error("mt.helo() unexpected reply") | ||
end | ||
-- send envelope macros and sender data | ||
mt.macro(conn, SMFIC_MAIL, "{i}", "t-verify-malformed") | ||
mt.macro(conn, SMFIC_MAIL, "{auth_authen}", "username@example.net") | ||
if mt.mailfrom(conn, "<user@underspell.com>") ~= nil then | ||
error("mt.mailfrom() failed") | ||
end | ||
if mt.getreply(conn) == SMFIR_ACCEPT then | ||
error("mt.mailfrom() unexpected reply") | ||
end | ||
|
||
mt.disconnect(conn) |