Gergely Nagy <algernon@balabit.hu> wrote:
The usage is something like this:
destination d_smtp { smtp( host("localhost") port(25) mail_from("syslog-ng alert service <noreply@example.com>") rcpt_to("Admin #1 <admin@example.com>") rcpt_to("Admin #2 <admin2@example.com>") subject("[ALERT] $LEVEL condition in $PROGRAM!") header("X-Program" "$PROGRAM") header("X-Facility" "$FACILITY") body("Hi!\nThe syslog-ng alerting service thinks you might be interested in the following message:\n $MSG\n-- \nsyslog-ng\n") ); };
The sysadmin in me does say a pipe to 'sendmail' is probably more straight forward, flexible and reliable: ---- destination d_mail { program("sendmail -f noreply@example.com admin@example.com admin2@example.com" template("From: syslog-ng alert service <noreply@example.com>\nSubject: [ALERT] $LEVEL condition in $PROGRAM!\nX-Program: $PROGRAM\nX-Facility: $FACILITY\n\nHi!\nThe syslog-ng alerting service thinks you might be interested in the following message:\n $MSG\n-- \nsyslog-ng\n.\n")); } ---- The closing '\n.\n' does the EOF.
Further plans include authentication & starttls support. libesmtp supports both, I just didn't have time to write the neccessary glue code yet.
A task that should be left surely to the local MSA (mail submission agent)? Cheers -- Alexander Clouter .sigmonster says: Drilling for oil is boring.