Mail-DKIM2

 view release on metacpan or  search on metacpan

t/guide-links.t  view on Meta::CPAN

use Test::More;
use FindBin;

# The operator guide names files in this repository and settings the rest
# of the repository implements; this keeps it from drifting.

my $root = "$FindBin::Bin/../..";
my $guide = "$root/docs/dkim2-postfix-list-host-guide.md";
plan skip_all => 'the operator guide is in the interop repository, not in this distribution'
    unless -f $guide;
my $text = do { local (@ARGV, $/) = $guide; <> };

my %seen;
for my $path ($text =~ /`((?:perl|deploy|mailman|sympa|util|docs)\/[A-Za-z0-9_.\/-]+)`/g) {
    next if $seen{$path}++;
    ok(-e "$root/$path", "guide path $path exists in the repo");
}
like($text, qr/^## .*Mailman/m, 'has a Mailman section');
like($text, qr/mailman\@dkim2-3\.3\.10/, 'recommends the 3.3.10 backport branch');
like($text, qr/git checkout v3\.3\.10/, '  ... and the release tag for the patch route');
like($text, qr/^## .*Sympa/m,   'has a Sympa section');

t/guide-links.t  view on Meta::CPAN

like($text, qr/mailman3 journal/, 'says Mailman DKIM2 logs go to the mailman3 journal');
unlike($text, qr/logging\.dkim2/, 'no [logging.dkim2] section (Mailman ignores it)');
like($text, qr/not (?:been )?tested end to end/i, 'the authentication_milter path is labelled as untested');
like($text, qr/wwsympa/, 'Sympa restart list includes wwsympa');
like($text, qr/git -c user\.name/, 'git am works on a host with no identity');
like($text, qr/i=1\.\.1 verified/, 'the plain-upstream example shows i=1..1');

# The stock-Mailman guide (milters and Postfix routing only, Mailman unpatched).
my $sguide = "$root/docs/dkim2-postfix-stock-mailman-guide.md";
ok(-f $sguide, 'the stock-Mailman guide exists');
my $stext = -f $sguide ? do { local (@ARGV, $/) = $sguide; <> } : '';
%seen = ();
for my $path ($stext =~ /`((?:perl|deploy|mailman|sympa|util|docs)\/[A-Za-z0-9_.\/-]+)`/g) {
    next if $seen{$path}++;
    ok(-e "$root/$path", "stock guide path $path exists in the repo");
}
like($stext, qr/max_recipients: 1/, 'stock guide: one recipient per transaction');
like($stext, qr/smtp_port: 10572/, 'stock guide: Mailman submits to the routing listener');
like($stext, qr/--wrap-single-part/, 'stock guide: the wrapping milter');
like($stext, qr/X-DKIM2-Snapshot/, 'stock guide: explains the snapshot token');
like($stext, qr/cleanup_service_name=cleanup-dkim2/, 'stock guide: port 25 keeps the hashed headers');
like($stext, qr/recast_multipart/, 'stock guide: says content filtering undoes the wrap');
like($stext, qr/disable_mime_output_conversion = yes/, 'stock guide: warns about transport conversion');
unlike($stext, qr{/root/interop|/opt/dkim2}, 'stock guide: no dkim2.com box paths');
unlike($stext, qr/^(?:smtp_port|max_recipients):[^\n#]*#/m, 'stock guide: no inline mailman.cfg comments');
like($text, qr{dkim2-postfix-stock-mailman-guide\.md}, 'the list-host guide points to the stock guide');

my $index = do { local (@ARGV, $/) = "$root/deploy/www/index.html"; <> };
like($index, qr{docs/dkim2-postfix-list-host-guide\.md}, 'dkim2.com links to the guide');
like($index, qr{docs/dkim2-postfix-stock-mailman-guide\.md}, 'dkim2.com links to the stock-Mailman guide');
my $opguide = do { local (@ARGV, $/) = "$root/docs/dkim2-operator-guide.md"; <> };
like($opguide, qr{dkim2-postfix-list-host-guide\.md}, 'the operator guide links to it');
like($opguide, qr{dkim2-postfix-stock-mailman-guide\.md}, 'the operator guide links to the stock guide');
done_testing;



( run in 2.341 seconds using v1.01-cache-2.11-cpan-145b269f2f3 )