-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathmaild.h
More file actions
76 lines (61 loc) · 2.64 KB
/
Copy pathmaild.h
File metadata and controls
76 lines (61 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License (version 2) as published by the FSF - Free Software
* Foundation.
*/
#ifndef _MAILD_H
#define _MAILD_H
#define MAIL_LIST_SIZE 96 /* Max number of emails to be saved */
#define MAXCHILDPROCESS 6 /* Maximum simultaneous children */
/* Each timeout is x * 5 */
#define NEXTMAIL_TIMEOUT 2 /* Time to check for next msg - 5 */
#define DEFAULT_TIMEOUT 18 /* socket read timeout - 18 (*5)*/
#define SUBJECT_SIZE 128 /* Maximum subject size */
/* Maximum body size */
#define BODY_SIZE OS_MAXSTR + OS_SIZE_1024
#define SMS_SUBJECT "OSSEC %d - %d - %s"
/* Full subject without ossec in the name */
#define MAIL_SUBJECT_FULL2 "%d - %s - %s"
#ifdef LIBGEOIP_ENABLED
#define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \
"%s\r\n\r\n" \
"Received From: %s\r\n" \
"Rule: %d fired (level %d) -> \"%s\"\r\n" \
"%s" \
"%s" \
"%s" \
"Portion of the log(s):\r\n\r\n%s\r\n" \
"\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n"
#else
#define MAIL_BODY "\r\nOSSEC HIDS Notification.\r\n" \
"%s\r\n\r\n" \
"Received From: %s\r\n" \
"Rule: %d fired (level %d) -> \"%s\"\r\n" \
"%s" \
"Portion of the log(s):\r\n\r\n%s\r\n" \
"\r\n\r\n --END OF NOTIFICATION\r\n\r\n\r\n"
#endif
/* Mail msg structure */
typedef struct _MailMsg {
char *subject;
char *body;
} MailMsg;
#include "shared.h"
#include "config/mail-config.h"
/* Config function */
int MailConf(int test_config, const char *cfgfile, MailConfig *Mail) __attribute__((nonnull));
/* Receive the e-mail message */
MailMsg *OS_RecvMailQ(file_queue *fileq, struct tm *p, MailConfig *mail,
MailMsg **msg_sms) __attribute__((nonnull));
/* Send an email */
int OS_Sendmail(MailConfig *mail, struct tm *p) __attribute__((nonnull));
int OS_SendCustomEmail(char **to, char *subject, char *smtpserver, char *from, char *idsname, char *fname, const struct tm *p);
/* Mail timeout used by the file-queue */
extern unsigned int mail_timeout;
/* Global var for highest level on mail subjects */
extern unsigned int _g_subject_level;
extern char _g_subject[SUBJECT_SIZE + 2];
#endif