A
Adam
Hi,
I am using Version 3.12c1 of NMS FormMail.
I am unable to get the script to post to mulitple email accounts.
The mail will only get sent to the first email account
in the '@allow_mail_to' array.
How can I have the mail forward on to multiple accounts ?
The script is standard apart from some formatting changes to the
generated html.
[snip]
$max_recipients = 5;
$mailprog = '/usr/lib/sendmail -oi -t';
$postmaster = '';
@referers = qw(mydomain.com);
@allow_mail_to = qw([email protected] (e-mail address removed));
@recipients = ();
[snip]
The init_allowed_address_list function is unchanged.
[snip]
sub init_allowed_address_list {
my ($self) = @_;
my @allow_mail = ();
my @allow_domain = ();
foreach my $m (@{ $self->{CFG}{allow_mail_to} }) {
if ($m =~ /\@/) {
push @allow_mail, $m;
}
else {
push @allow_domain, $m;
}
}
my @alias_targets = split /\s*,\s*/, join ',', values %{
$self->{CFG}{recipient_alias} };
push @allow_mail, grep /\@/, @alias_targets;
# The username part of email addresses should be case sensitive, but
the
# domain name part should not. Map all domain names to lower case
for
# comparison.
my (%allow_mail, %allow_domain);
foreach my $m (@allow_mail) {
$m =~ /^([^@]+)\@([^@]+)$/ or die "internal failure [$m]";
$m = $1 . '@' . lc $2;
$allow_mail{$m} = 1;
}
foreach my $m (@allow_domain) {
$m = lc $m;
$allow_domain{$m} = 1;
}
$self->{Allow_Mail} = \%allow_mail;
$self->{Allow_Domain} = \%allow_domain;
}
[snip]
Thanks in advance,
Adam
I am using Version 3.12c1 of NMS FormMail.
I am unable to get the script to post to mulitple email accounts.
The mail will only get sent to the first email account
in the '@allow_mail_to' array.
How can I have the mail forward on to multiple accounts ?
The script is standard apart from some formatting changes to the
generated html.
[snip]
$max_recipients = 5;
$mailprog = '/usr/lib/sendmail -oi -t';
$postmaster = '';
@referers = qw(mydomain.com);
@allow_mail_to = qw([email protected] (e-mail address removed));
@recipients = ();
[snip]
The init_allowed_address_list function is unchanged.
[snip]
sub init_allowed_address_list {
my ($self) = @_;
my @allow_mail = ();
my @allow_domain = ();
foreach my $m (@{ $self->{CFG}{allow_mail_to} }) {
if ($m =~ /\@/) {
push @allow_mail, $m;
}
else {
push @allow_domain, $m;
}
}
my @alias_targets = split /\s*,\s*/, join ',', values %{
$self->{CFG}{recipient_alias} };
push @allow_mail, grep /\@/, @alias_targets;
# The username part of email addresses should be case sensitive, but
the
# domain name part should not. Map all domain names to lower case
for
# comparison.
my (%allow_mail, %allow_domain);
foreach my $m (@allow_mail) {
$m =~ /^([^@]+)\@([^@]+)$/ or die "internal failure [$m]";
$m = $1 . '@' . lc $2;
$allow_mail{$m} = 1;
}
foreach my $m (@allow_domain) {
$m = lc $m;
$allow_domain{$m} = 1;
}
$self->{Allow_Mail} = \%allow_mail;
$self->{Allow_Domain} = \%allow_domain;
}
[snip]
Thanks in advance,
Adam