[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[monit-dev] [monit] r270 committed - * Added the option to set the "Repl
From: |
monit |
Subject: |
[monit-dev] [monit] r270 committed - * Added the option to set the "Reply-To" mail header in mail-format. |
Date: |
Mon, 20 Sep 2010 21:19:31 +0000 |
Revision: 270
Author: janhenrik.haukeland
Date: Mon Sep 20 14:15:39 2010
Log: * Added the option to set the "Reply-To" mail header in mail-format.
http://code.google.com/p/monit/source/detail?r=270
Modified:
/trunk/CHANGES.txt
/trunk/alert.c
/trunk/gc.c
/trunk/l.l
/trunk/monit.pod
/trunk/monitor.h
/trunk/p.y
/trunk/sendmail.c
=======================================
--- /trunk/CHANGES.txt Mon Sep 20 07:43:42 2010
+++ /trunk/CHANGES.txt Mon Sep 20 14:15:39 2010
@@ -37,6 +37,8 @@
* The 'check system' can now use start/stop program statements too.
+* Added the option to set the "Reply-To" mail header in mail-format.
+
* Display backtrace on error if debug mode is enabled (requires backtrace
support in libc)
=======================================
--- /trunk/alert.c Fri Jan 8 03:20:43 2010
+++ /trunk/alert.c Mon Sep 20 14:15:39 2010
@@ -232,6 +232,12 @@
Run.MailFormat.from?
xstrdup(Run.MailFormat.from):
xstrdup(ALERT_FROM);
+ n->replyto =
+ o->replyto?
+ xstrdup(o->replyto):
+ Run.MailFormat.replyto?
+ xstrdup(Run.MailFormat.replyto):
+ NULL;
n->subject=
o->subject?
xstrdup(o->subject):
=======================================
--- /trunk/gc.c Mon Mar 29 09:24:30 2010
+++ /trunk/gc.c Mon Sep 20 14:15:39 2010
@@ -141,6 +141,7 @@
FREE((*m)->to);
FREE((*m)->from);
+ FREE((*m)->replyto);
FREE((*m)->subject);
FREE((*m)->message);
FREE(*m);
=======================================
--- /trunk/l.l Wed Aug 18 07:12:59 2010
+++ /trunk/l.l Mon Sep 20 14:15:39 2010
@@ -447,7 +447,13 @@
yylval.string = Util_trim(xstrdup(p));
save_arg(); return MAILFROM;
}
-
+
+"reply-to:"[ address@hidden {
+ char *p= yytext+strlen("reply-to:");
+ yylval.string = Util_trim(xstrdup(p));
+ save_arg(); return MAILREPLYTO;
+ }
+
"subject:"[^}\n]* {
char *p= yytext+strlen("subject:");
yylval.string = Util_trim(xstrdup(p));
=======================================
--- /trunk/monit.pod Tue Sep 7 01:25:20 2010
+++ /trunk/monit.pod Mon Sep 20 14:15:39 2010
@@ -730,6 +730,7 @@
mail-format {
from: address@hidden
+ reply-to: address@hidden
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.
Yours sincerely,
@@ -739,8 +740,9 @@
Where the keyword I<from:> is the email address Monit should
pretend it is sending from. It does not have to be a real mail
address, but it must be a proper formated mail address, on the
-form: address@hidden The keyword I<subject:> is for the email
-subject line. The subject must be on only I<one> line. The
+form: address@hidden The I<reply-to:> keyword can be used to set
+the reply-to mail header. The keyword I<subject:> is for the
+email subject line. The subject must be on only I<one> line. The
I<message:> keyword denotes the mail body. If used, this keyword
should always be the last in a mail-format statement. The mail
body can be as long as you want, but must B<not> contain the '}'
=======================================
--- /trunk/monitor.h Mon Sep 6 05:48:55 2010
+++ /trunk/monitor.h Mon Sep 20 14:15:39 2010
@@ -356,6 +356,7 @@
typedef struct mymail {
char *to; /**< Mail address for alert
notification */
char *from; /**< The mail from
address */
+ char *replyto; /**< Optional reply-to
address */
char *subject; /**< The mail
subject */
char *message; /**< The mail
message */
unsigned int events; /*< Events for which this mail object should be
sent */
@@ -858,6 +859,7 @@
/** User selected standard mail
format */
struct myformat {
char *from; /**< The standard mail from
address */
+ char *replyto; /**< Optional reply-to
header */
char *subject; /**< The standard mail
subject */
char *message; /**< The standard mail
message */
} MailFormat;
=======================================
--- /trunk/p.y Mon Sep 6 05:48:55 2010
+++ /trunk/p.y Mon Sep 20 14:15:39 2010
@@ -280,7 +280,7 @@
%token TIMEOUT RESTART CHECKSUM EVERY
%token DEFAULT HTTP APACHESTATUS FTP SMTP POP IMAP CLAMAV NNTP NTP3 MYSQL
DNS
%token SSH DWP LDAP2 LDAP3 RDATE RSYNC TNS PGSQL POSTFIXPOLICY SIP LMTP
GPS RADIUS MEMCACHE
-%token <string> STRING PATH MAILADDR MAILFROM MAILSUBJECT
+%token <string> STRING PATH MAILADDR MAILFROM MAILREPLYTO MAILSUBJECT
%token <string> MAILBODY SERVICENAME STRINGNAME
%token <number> NUMBER PERCENT LOGLIMIT CLOSELIMIT DNSLIMIT KEEPALIVELIMIT
%token <number> REPLYLIMIT REQUESTLIMIT STARTLIMIT WAITLIMIT GRACEFULLIMIT
@@ -600,6 +600,7 @@
setmailformat : SET MAILFORMAT '{' formatoptionlist '}' {
Run.MailFormat.from = mailset.from ?
mailset.from : xstrdup(ALERT_FROM);
+ Run.MailFormat.replyto = mailset.replyto ?
mailset.replyto : NULL;
Run.MailFormat.subject = mailset.subject ?
mailset.subject : xstrdup(ALERT_SUBJECT);
Run.MailFormat.message = mailset.message ?
mailset.message : xstrdup(ALERT_MESSAGE);
reset_mailset();
@@ -1285,6 +1286,7 @@
;
formatoption : MAILFROM { mailset.from = $1; }
+ | MAILREPLYTO { mailset.replyto = $1; }
| MAILSUBJECT { mailset.subject = $1; }
| MAILBODY { mailset.message = $1; }
;
@@ -1899,6 +1901,7 @@
Run.maillist = NULL;
Run.mailservers = NULL;
Run.MailFormat.from = NULL;
+ Run.MailFormat.replyto = NULL;
Run.MailFormat.subject = NULL;
Run.MailFormat.message = NULL;
Run.localhostname = xstrdup(localhost);
=======================================
--- /trunk/sendmail.c Thu May 6 09:52:57 2010
+++ /trunk/sendmail.c Mon Sep 20 14:15:39 2010
@@ -181,6 +181,8 @@
do_send(&S, "DATA\r\n");
do_status(&S);
do_send(&S, "From: %s\r\n", m->from);
+ if (m->replyto)
+ do_send(&S, "Reply-To: %s\r\n", m->replyto);
do_send(&S, "To: %s\r\n", m->to);
do_send(&S, "Subject: %s\r\n", m->subject);
do_send(&S, "Date: %s\r\n", now);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [monit-dev] [monit] r270 committed - * Added the option to set the "Reply-To" mail header in mail-format.,
monit <=