1 /* @(#) $Id: ./src/os_maild/maild.h, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
12 * License details at the LICENSE file included with OSSEC or
13 * online at: http://www.ossec.net/en/licensing.html
20 #define MAIL_LIST_SIZE 96 /* Max number of emails to be saved */
21 #define MAXCHILDPROCESS 6 /* Maximum simultaneos childs */
23 /* Each timeout is x * 5 */
24 #define NEXTMAIL_TIMEOUT 2 /* Time to check for next msg - 5 */
25 #define DEFAULT_TIMEOUT 18 /* socket read timeout - 18 (*5)*/
26 #define SUBJECT_SIZE 128 /* Maximum subject size */
28 /* Maximum body size */
29 #define BODY_SIZE OS_MAXSTR + OS_SIZE_1024
31 #define SMS_SUBJECT "OSSEC %d - %d - %s"
32 #define MAIL_SUBJECT "OSSEC Notification - %s - Alert level %d"
33 #define MAIL_SUBJECT_FULL "OSSEC Alert - %s - Level %d - %s"
35 /* Full subject without ossec in the name */
37 #define MAIL_SUBJECT_FULL2 "%d - %s - %s"
41 #define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \
43 "Received From: %s\r\n" \
44 "Rule: %d fired (level %d) -> \"%s\"\r\n" \
47 "Portion of the log(s):\r\n\r\n%s\r\n" \
48 "\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n"
50 #define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \
52 "Received From: %s\r\n" \
53 "Rule: %d fired (level %d) -> \"%s\"\r\n" \
54 "Portion of the log(s):\r\n\r\n%s\r\n" \
55 "\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n"
58 /* Mail msg structure */
59 typedef struct _MailMsg
66 #include "config/mail-config.h"
70 int MailConf(int test_config, char *cfgfile, MailConfig *Mail);
73 /* Receive the e-mail message */
74 MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, MailConfig *mail,
78 int OS_Sendmail(MailConfig *mail, struct tm *p);
79 int OS_Sendsms(MailConfig *mail, struct tm *p, MailMsg *sms_msg);
80 int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, char *idsname, FILE *fp, struct tm *p);
83 /* Mail timeout used by the file-queue */
87 /* Global var for highest level on mail subjects */
89 char _g_subject[SUBJECT_SIZE +2];