1 /* @(#) $Id: maild.h,v 1.23 2009/06/24 17:06:30 dcid Exp $ */
3 /* Copyright (C) 2009 Trend Micro Inc.
6 * This program is a free software; you can redistribute it
7 * and/or modify it under the terms of the GNU General Public
8 * License (version 3) as published by the FSF - Free Software
11 * License details at the LICENSE file included with OSSEC or
12 * online at: http://www.ossec.net/en/licensing.html
19 #define MAIL_LIST_SIZE 96 /* Max number of emails to be saved */
20 #define MAXCHILDPROCESS 6 /* Maximum simultaneos childs */
22 /* Each timeout is x * 5 */
23 #define NEXTMAIL_TIMEOUT 2 /* Time to check for next msg - 5 */
24 #define DEFAULT_TIMEOUT 18 /* socket read timeout - 18 (*5)*/
25 #define SUBJECT_SIZE 128 /* Maximum subject size */
27 /* Maximum body size */
28 #define BODY_SIZE OS_MAXSTR + OS_SIZE_1024
30 #define SMS_SUBJECT "OSSEC %d - %d - %s"
31 #define MAIL_SUBJECT "OSSEC Notification - %s - Alert level %d"
32 #define MAIL_SUBJECT_FULL "OSSEC Alert - %s - Level %d - %s"
34 /* Full subject without ossec in the name */
36 #define MAIL_SUBJECT_FULL2 "%d - %s - %s"
39 #define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \
41 "Received From: %s\r\n" \
42 "Rule: %d fired (level %d) -> \"%s\"\r\n" \
43 "Portion of the log(s):\r\n\r\n%s\r\n" \
44 "\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n"
47 /* Mail msg structure */
48 typedef struct _MailMsg
55 #include "config/mail-config.h"
59 int MailConf(int test_config, char *cfgfile, MailConfig *Mail);
62 /* Receive the e-mail message */
63 MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, MailConfig *mail,
67 int OS_Sendmail(MailConfig *mail, struct tm *p);
68 int OS_Sendsms(MailConfig *mail, struct tm *p, MailMsg *sms_msg);
71 /* Mail timeout used by the file-queue */
75 /* Global var for highest level on mail subjects */
77 char _g_subject[SUBJECT_SIZE +2];