180 |
const char *action) { |
const char *action) { |
181 |
|
|
182 |
char host[STRLEN]; |
char host[STRLEN]; |
183 |
char *now= get_RFC822date(NULL); |
char *now= Util_getRFC822Date(NULL); |
184 |
|
|
185 |
ASSERT(m && name && event && action); |
ASSERT(m && name && event && action); |
186 |
|
|
188 |
snprintf(host, STRLEN, "%s", LOCALHOST); |
snprintf(host, STRLEN, "%s", LOCALHOST); |
189 |
} |
} |
190 |
|
|
191 |
replace_string(&(*m)->from, "$HOST", host); |
Util_replaceString(&(*m)->from, "$HOST", host); |
192 |
replace_string(&(*m)->subject, "$DATE", now); |
Util_replaceString(&(*m)->subject, "$DATE", now); |
193 |
replace_string(&(*m)->message, "$DATE", now); |
Util_replaceString(&(*m)->message, "$DATE", now); |
194 |
replace_string(&(*m)->subject, "$HOST", host); |
Util_replaceString(&(*m)->subject, "$HOST", host); |
195 |
replace_string(&(*m)->message, "$HOST", host); |
Util_replaceString(&(*m)->message, "$HOST", host); |
196 |
replace_string(&(*m)->subject, "$PROGRAM", name); |
Util_replaceString(&(*m)->subject, "$PROGRAM", name); |
197 |
replace_string(&(*m)->message, "$PROGRAM", name); |
Util_replaceString(&(*m)->message, "$PROGRAM", name); |
198 |
replace_string(&(*m)->subject, "$SERVICE", name); |
Util_replaceString(&(*m)->subject, "$SERVICE", name); |
199 |
replace_string(&(*m)->message, "$SERVICE", name); |
Util_replaceString(&(*m)->message, "$SERVICE", name); |
200 |
replace_string(&(*m)->subject, "$EVENT", event); |
Util_replaceString(&(*m)->subject, "$EVENT", event); |
201 |
replace_string(&(*m)->message, "$EVENT", event); |
Util_replaceString(&(*m)->message, "$EVENT", event); |
202 |
replace_string(&(*m)->subject, "$ACTION", action); |
Util_replaceString(&(*m)->subject, "$ACTION", action); |
203 |
replace_string(&(*m)->message, "$ACTION", action); |
Util_replaceString(&(*m)->message, "$ACTION", action); |
204 |
|
|
205 |
FREE(now); |
FREE(now); |
206 |
|
|
236 |
|
|
237 |
|
|
238 |
static void replace_bare_linefeed(Mail_T *m) { |
static void replace_bare_linefeed(Mail_T *m) { |
239 |
|
|
240 |
replace_string(&(*m)->message, "\r\n", "\n"); |
Util_replaceString(&(*m)->message, "\r\n", "\n"); |
241 |
replace_string(&(*m)->message, "\n", "\r\n"); |
Util_replaceString(&(*m)->message, "\n", "\r\n"); |
242 |
if((*m)->opt_message) { |
if((*m)->opt_message) { |
243 |
replace_string(&(*m)->opt_message, "\r\n", "\n"); |
Util_replaceString(&(*m)->opt_message, "\r\n", "\n"); |
244 |
replace_string(&(*m)->opt_message, "\n", "\r\n"); |
Util_replaceString(&(*m)->opt_message, "\n", "\r\n"); |
245 |
} |
} |
246 |
|
|
247 |
} |
} |