[syslog-ng] [PATCH]: Experimental SMTP destination

Alexander Clouter alex at digriz.org.uk
Sat Feb 12 20:06:10 CET 2011


Gergely Nagy <algernon at balabit.hu> wrote:
> 
> The usage is something like this:
> 
>        destination d_smtp {
>          smtp(
>            host("localhost")
>            port(25)
>            mail_from("syslog-ng alert service <noreply at example.com>")
>            rcpt_to("Admin #1 <admin at example.com>")
>            rcpt_to("Admin #2 <admin2 at 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 at example.com admin at example.com admin2 at example.com"
		template("From: syslog-ng alert service <noreply at 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.



More information about the syslog-ng mailing list