summaryrefslogtreecommitdiff
path: root/test/aux-fixed
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-11-29 01:12:38 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2015-11-29 22:56:04 +0000
commit6a11a9e618a72b8d96aecb2ad9aa300b98f8d991 (patch)
tree750abcaea755909d6e7fe315285d216080a0415d /test/aux-fixed
parentcc28be65e1c95a079b4288c30e15abf68faa45d4 (diff)
DKIM: relaxed body canonicalisation should ignore whitespace at EOL
and empty lines at EOM. Bug 1721
Diffstat (limited to 'test/aux-fixed')
-rw-r--r--test/aux-fixed/4500.msg1.txt7
-rw-r--r--test/aux-fixed/4501.msg1.txt11
-rw-r--r--test/aux-fixed/4502.msg1.txt22
-rw-r--r--test/aux-fixed/dkim/dkim.private15
-rw-r--r--test/aux-fixed/dkim/sign.pl38
5 files changed, 93 insertions, 0 deletions
diff --git a/test/aux-fixed/4500.msg1.txt b/test/aux-fixed/4500.msg1.txt
new file mode 100644
index 000000000..957ef430b
--- /dev/null
+++ b/test/aux-fixed/4500.msg1.txt
@@ -0,0 +1,7 @@
+From: mrgus@text.ex
+To: bakawolf@yahoo.com
+Date: Thu, 19 Nov 2015 17:00:07 -0700
+Message-ID: <qwerty1234@disco-zombie.net>
+Subject: simple test
+
+This is a simple test.
diff --git a/test/aux-fixed/4501.msg1.txt b/test/aux-fixed/4501.msg1.txt
new file mode 100644
index 000000000..93311ee81
--- /dev/null
+++ b/test/aux-fixed/4501.msg1.txt
@@ -0,0 +1,11 @@
+From: mrgus@test.ex
+To: bakawolf@yahoo.com
+Date: Thu, 19 Nov 2015 17:00:07 -0700
+Message-ID: <qwerty1234@disco-zombie.net>
+Subject: simple space test
+
+This is a test of simple with spaces.
+
+
+
+End of content (spaced line two lines down).
diff --git a/test/aux-fixed/4502.msg1.txt b/test/aux-fixed/4502.msg1.txt
new file mode 100644
index 000000000..6b45a4009
--- /dev/null
+++ b/test/aux-fixed/4502.msg1.txt
@@ -0,0 +1,22 @@
+Message-ID: <564CFC9B.1040905@yahoo.com>
+Date: Wed, 18 Nov 2015 14:32:59 -0800
+From: Joaquin Lopez <bakawolf@test.ex>
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.0
+MIME-Version: 1.0
+To: bakawolf@yahoo.com
+Subject: test
+Content-Type: text/plain; charset=ISO-8859-1; format=flowed
+Content-Transfer-Encoding: 7bit
+Content-Length: 13
+
+
+
+test
+
+
+
+
+
+
+
+
diff --git a/test/aux-fixed/dkim/dkim.private b/test/aux-fixed/dkim/dkim.private
new file mode 100644
index 000000000..e509ee027
--- /dev/null
+++ b/test/aux-fixed/dkim/dkim.private
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDXRFf+VhT+lCgFhhSkinZKcFNeRzjYdW8vT29Rbb3NadvTFwAd
++cVLPFwZL8H5tUD/7JbUPqNTCPxmpgIL+V5T4tEZMorHatvvUM2qfcpQ45IfsZ+Y
+dhbIiAslHCpy4xNxIR3zylgqRUF4+Dtsaqy3a5LhwMiKCLrnzhXk1F1hxwIDAQAB
+AoGAZPokJKQQmRK6a0zn5f8lWemy0airG66KhzDF0Pafb/nWKgDCB02gpJgdw5rJ
+bO7/HI3IeqsfRdYTP7tjfmZtPiPo1mnF7D1rSRspZjOF2yXY/ky7t7c5xChRcSxf
++69CknwjrfteY9Aj0j6o7N+2w2uvHO+AAq8BHDgXKmPo0SECQQDzQ/glyhNH9tlO
+x+3TTMwwyZUf2mYYosN3Q9NIl3Umz/3+13K5b6Ed6fZvS/XwU55Qf5IBUVj2Fujk
+Rv2lbGPpAkEA4okpnzYz5nm1X5WjpJPQPyo8nGEU1A5QfoDbkAvWYvVoYrpWPOx5
+HFpOAHkvSk1Y1vhCUa+zHwiQRBC8OMp6LwJBAOAUK/AjQ792UpWO9DM++pe2F/dP
+ZdwrkYG6qFSlrvQhgwXLz5GgkfjMGoRKpDDL1XixCfzMwfVtBPnBqsNGJIECQGYX
+SIGu7L7edMXJ60C9OKluwHf9LGTQuqf4LHsDSq+4Rz3PGhREwePsMqD1/EDxEKt4
+oHKtyvyeYF28aQbzARMCQQCRtJlR6vlKhxYL8+xoPrCu3MijKgVruRUcNstXkDZK
+fKQax6vhiMq+0qIiEwLA1wavyLVKZ7Mfag+/4NTcDUVC
+-----END RSA PRIVATE KEY-----
diff --git a/test/aux-fixed/dkim/sign.pl b/test/aux-fixed/dkim/sign.pl
new file mode 100644
index 000000000..1c2a87280
--- /dev/null
+++ b/test/aux-fixed/dkim/sign.pl
@@ -0,0 +1,38 @@
+use Mail::DKIM::Signer;
+use Mail::DKIM::TextWrap; #recommended
+use Getopt::Long;
+
+my $method = "simple/simple";
+
+GetOptions(
+ "method=s" => \$method,
+);
+
+# create a signer object
+my $dkim = Mail::DKIM::Signer->new(
+ Algorithm => "rsa-sha1",
+ Method => $method,
+ Domain => "test.ex",
+ Selector => "sel",
+ KeyFile => "aux-fixed/dkim/dkim.private",
+ );
+
+# read an email and pass it into the signer, one line at a time
+while (<STDIN>)
+{
+ # remove local line terminators
+ chomp;
+ s/\015$//;
+
+ # use SMTP line terminators
+ $dkim->PRINT("$_\015\012");
+}
+$dkim->CLOSE;
+
+# what is the signature result?
+my $signature = $dkim->signature;
+print $signature->as_string;
+print "\n";
+
+#print $dkim->headers;
+#print "\n";