1 /*
2  * include/types/mailer.h
3  * This file defines everything related to mailer.
4  *
5  * Copyright 2015 Horms Solutions Ltd., Simon Horman <horms@verge.net.au>
6  *
7  * Based on include/types/peers.h
8  *
9  * Copyright 2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation, version 2.1
14  * exclusively.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24  */
25 
26 #ifndef _TYPES_MAILERS_H
27 #define _TYPES_MAILERS_H
28 
29 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <netinet/in.h>
32 #include <arpa/inet.h>
33 
34 struct mailer {
35 	char *id;
36 	struct mailers *mailers;
37 	struct {
38 		const char *file;	/* file where the section appears */
39 		int line;		/* line where the section appears */
40 	} conf;				/* config information */
41 	struct sockaddr_storage addr;	/* SMTP server address */
42 	struct protocol *proto;		/* SMTP server address's protocol */
43 	struct xprt_ops *xprt;		/* SMTP server socket operations at transport layer */
44 	void *sock_init_arg;		/* socket operations's opaque init argument if needed */
45 	struct mailer *next;		/* next mailer in the list */
46 };
47 
48 
49 struct mailers {
50 	char *id;			/* mailers section name */
51 	struct mailer *mailer_list;	/* mailers in this mailers section */
52 	struct {
53 		const char *file;	/* file where the section appears */
54 		int line;		/* line where the section appears */
55 	} conf;				/* config information */
56 	struct mailers *next;	        /* next mailers section */
57 	int count;			/* total number of mailers in this mailers section */
58 	int users;			/* number of users of this mailers section */
59 	struct {			/* time to: */
60 		int mail;		/*   try connecting to mailserver and sending a email */
61 	} timeout;
62 };
63 
64 
65 extern struct mailers *mailers;
66 
67 #endif /* _TYPES_MAILERS_H */
68 
69