smf_session.h
Go to the documentation of this file.
1 /* spmfilter - mail filtering framework
2  * Copyright (C) 2009-2012 Axel Steiner and SpaceNet AG
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 3 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
32 #ifndef _SMF_SESSION_H
33 #define _SMF_SESSION_H
34 
35 #include "smf_envelope.h"
36 
41 typedef struct {
43  size_t message_size;
44  char *message_file;
45  char *helo;
46  char *xforward_addr;
47  char *response_msg;
48  int sock;
49  char *id;
50 } SMFSession_T;
51 
57 SMFSession_T *smf_session_new(void);
58 
64 void smf_session_free(SMFSession_T *session);
65 
72 void smf_session_set_helo(SMFSession_T *session, char *helo);
73 
80 char *smf_session_get_helo(SMFSession_T *session);
81 
88 void smf_session_set_xforward_addr(SMFSession_T *session, char *xfwd);
89 
96 char *smf_session_get_xforward_addr(SMFSession_T *session);
97 
104 void smf_session_set_response_msg(SMFSession_T *session, char *rmsg);
105 
112 char *smf_session_get_response_msg(SMFSession_T *session);
113 
121 SMFEnvelope_T *smf_session_get_envelope(SMFSession_T *session);
122 
129 void smf_session_set_message_file(SMFSession_T *session, char *fp);
130 
137 char *smf_session_get_message_file(SMFSession_T *session);
138 
145 char *smf_session_get_id(SMFSession_T *session);
146 
147 #endif /* _SMF_SESSION_H */