[smokeping-users] emails recipients

G.W. Haywood ged at jubileegroup.co.uk
Sun Mar 29 17:34:21 CEST 2009


Hi there,

On Mon, 23 Mar 2009, Martin Lipka wrote:

> I'm currently working on setting up a small number of smokeping emails
> recipients, but smokeping accepts only one email address.
> ...
> I tried:
> numberone at test.com,numbertwo at test.com
> numberone at test.com;numbertwo at test.com
> No success.
> Any suggestion?

This is the section of Smokeping.pm which you're interested in:

8<----------------------------------------------------------------------
sub sendmail ($$$){
    my $from = shift;
    my $to = shift;
    $to = $1 if $to =~ /<(.*?)>/;
    my $body = shift;
    if ($cfg->{General}{mailhost} and
        my $smtp = Net::SMTP->new([split /\s*,\s*/, $cfg->{General}{mailhost}],Timeout=>5) ){
        $smtp->mail($from);
        $smtp->to(split(/\s*,\s*/, $to));
        $smtp->data();
        $smtp->datasend($body);
        $smtp->dataend();
        $smtp->quit;
    } elsif ($cfg->{General}{sendmail} or -x "/usr/lib/sendmail"){
        open (M, "|-") || exec (($cfg->{General}{sendmail} || "/usr/lib/sendmail"),"-f",$from,$to);
        print M $body;
        close M;
    } else {
        warn "ERROR: not sending mail to $to, as all methodes failed\n";
    }
}
8<----------------------------------------------------------------------

I haven't tested this, but just reading it appears either to split a
list of addresses on the comma or pass the list directly to the MTA.
So in either case your first attempt:

numberone at test.com,numbertwo at test.com

should be fine.

Can we see your smokeping configuration?

Of course TMTOWTDI.  An alternative would be to set up a mailing list. :)

--

73,
Ged.



More information about the smokeping-users mailing list