If the group 'mail' does not exist (as on some *BSD systems),
test 0001 fails. We now use a randomly choosen group, if necessary.
The group name isn't used for anything else than testing the config
file parser.
system_filter = /home/exim/test/filter
system_filter_directory_transport =
system_filter_file_transport =
system_filter = /home/exim/test/filter
system_filter_directory_transport =
system_filter_file_transport =
-system_filter_group = mail
+system_filter_group = MAILGROUP
system_filter_pipe_transport =
system_filter_reply_transport =
system_filter_user = 99
system_filter_pipe_transport =
system_filter_reply_transport =
system_filter_user = 99
no_fail_verify_recipient
no_fail_verify_sender
fallback_hosts = localhost
no_fail_verify_recipient
no_fail_verify_sender
fallback_hosts = localhost
headers_add =
headers_remove =
host_find_failed = freeze
headers_add =
headers_remove =
host_find_failed = freeze
forbid_filter_run
no_forbid_include
no_forbid_pipe
forbid_filter_run
no_forbid_include
no_forbid_pipe
headers_add =
headers_remove =
hide_child_in_errmsg
headers_add =
headers_remove =
hide_child_in_errmsg
more
no_one_time
owners = root
more
no_one_time
owners = root
pipe_transport = dummy
no_qualify_preserve_domain
redirect_router = aliasfile2
pipe_transport = dummy
no_qualify_preserve_domain
redirect_router = aliasfile2
no_fail_verify_recipient
no_fail_verify_sender
fallback_hosts =
no_fail_verify_recipient
no_fail_verify_sender
fallback_hosts =
headers_add = X-added: by localuser
headers_remove =
no_initgroups
headers_add = X-added: by localuser
headers_remove =
no_initgroups
file_transport = dummy
forbid_file
forbid_pipe
file_transport = dummy
forbid_file
forbid_pipe
headers_add =
headers_remove =
hide_child_in_errmsg
headers_add =
headers_remove =
hide_child_in_errmsg
file = /home/$local_part/inbox
file_format = "From : appendfile"
no_file_must_exist
file = /home/$local_part/inbox
file_format = "From : appendfile"
no_file_must_exist
headers_add = X-original-domain: $original_domain\nX-original-localp: $original_local_part
headers_remove =
headers_rewrite = a@b c@d
headers_add = X-original-domain: $original_domain\nX-original-localp: $original_local_part
headers_remove =
headers_rewrite = a@b c@d
--- /dev/null
+package Exim::Runtest;
+use strict;
+use warnings;
+use Carp;
+
+use List::Util qw'shuffle';
+
+
+# find a group name, preferrable 'mail', but
+# use some other random name if 'mail' isn't a valid group
+# name
+sub mailgroup {
+ my $group = shift;
+
+ croak "Need a group *name*, not a numeric group id."
+ if $group =~ /^\d+$/;
+
+ return $group if getgrnam $group;
+
+ my @groups;
+ setgrent or die "setgrent: $!\n";
+ push @groups, $_ while defined($_ = getgrent);
+ endgrent;
+ return (shuffle @groups)[0];
+};
+
+
+1;
use Time::Local;
use Cwd;
use File::Basename;
use Time::Local;
use Cwd;
use File::Basename;
+use FindBin qw'$Bin';
+
+use lib "$Bin/lib";
+use Exim::Runtest;
+
use if $ENV{DEBUG} && $ENV{DEBUG} =~ /\bruntest\b/ => ('Smart::Comments' => '####');
use if $ENV{DEBUG} && $ENV{DEBUG} =~ /\bruntest\b/ => ('Smart::Comments' => '####');
$parm_port_d4 = 1228; # Additional for daemon
my $dynamic_socket; # allocated later for PORT_DYNAMIC
$parm_port_d4 = 1228; # Additional for daemon
my $dynamic_socket; # allocated later for PORT_DYNAMIC
+# Find a suiteable group name for test (currently only 0001
+# uses a group name. A numeric group id would do
+my $parm_mailgroup = Exim::Runtest::mailgroup('mail');
+
# Manually set locale
$ENV{LC_ALL} = 'C';
# Manually set locale
$ENV{LC_ALL} = 'C';
s?(\b|_)V4NET([\._])?$1$parm_ipv4_test_net$2?g;
s?\bV6NET:?$parm_ipv6_test_net:?g;
s?\bPORT_DYNAMIC\b?$dynamic_socket->sockport()?eg;
s?(\b|_)V4NET([\._])?$1$parm_ipv4_test_net$2?g;
s?\bV6NET:?$parm_ipv6_test_net:?g;
s?\bPORT_DYNAMIC\b?$dynamic_socket->sockport()?eg;
+s?\bMAILGROUP\b?$parm_mailgroup?g;