diff --git a/src/notify_email.c b/src/notify_email.c
index 6b4678a7882a22baa010a569ba06cf1e7993ab6b..76d48d445825c83834d93095ed35420ce288b7d1 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
user_data_t __attribute__((unused)) *user_data)
{
user_data_t __attribute__((unused)) *user_data)
{
+ time_t tt;
struct tm timestamp_tm;
char timestamp_str[64];
struct tm timestamp_tm;
char timestamp_str[64];
(email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
severity, n->host);
(email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
severity, n->host);
- localtime_r (&n->time, ×tamp_tm);
+ tt = CDTIME_T_TO_TIME_T (n->time);
+ localtime_r (&tt, ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
timestamp_str[sizeof (timestamp_str) - 1] = '\0';
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
timestamp_str[sizeof (timestamp_str) - 1] = '\0';
/* Let's make RFC822 message text with \r\n EOLs */
ssnprintf (buf, buf_len,
"MIME-Version: 1.0\r\n"
/* Let's make RFC822 message text with \r\n EOLs */
ssnprintf (buf, buf_len,
"MIME-Version: 1.0\r\n"
- "Content-Type: text/plain;\r\n"
+ "Content-Type: text/plain; charset=\"US-ASCII\"\r\n"
"Content-Transfer-Encoding: 8bit\r\n"
"Subject: %s\r\n"
"\r\n"
"Content-Transfer-Encoding: 8bit\r\n"
"Subject: %s\r\n"
"\r\n"
/* Initiate a connection to the SMTP server and transfer the message. */
if (!smtp_start_session (session)) {
/* Initiate a connection to the SMTP server and transfer the message. */
if (!smtp_start_session (session)) {
- char buf[MAXSTRING];
ERROR ("notify_email plugin: SMTP server problem: %s",
smtp_strerror (smtp_errno (), buf, sizeof buf));
pthread_mutex_unlock (&session_lock);
ERROR ("notify_email plugin: SMTP server problem: %s",
smtp_strerror (smtp_errno (), buf, sizeof buf));
pthread_mutex_unlock (&session_lock);