smf_envelope.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 
29 #ifndef _SMF_ENVELOPE_H
30 #define _SMF_ENVELOPE_H
31 
32 #include "smf_list.h"
33 #include "smf_email_address.h"
34 #include "smf_message.h"
35 
40 typedef struct {
42  char *sender;
43  char *auth_user;
44  char *auth_pass;
45  char *nexthop;
48 
54 SMFEnvelope_T *smf_envelope_new(void);
55 
61 void smf_envelope_free(SMFEnvelope_T *envelope);
62 
69 void smf_envelope_set_sender(SMFEnvelope_T *envelope, char *sender);
70 
77 char *smf_envelope_get_sender(SMFEnvelope_T *envelope);
78 
86 int smf_envelope_add_rcpt(SMFEnvelope_T *envelope, char *rcpt);
87 
94 typedef void (*SMFRcptForeachFunc) (char *addr, void *user_data);
95 
103 void smf_envelope_foreach_rcpt(SMFEnvelope_T *envelope, SMFRcptForeachFunc callback, void *user_data);
104 
111 void smf_envelope_set_auth_user(SMFEnvelope_T *envelope,char *auth_user);
112 
119 char *smf_envelope_get_auth_user(SMFEnvelope_T *envelope);
120 
127 void smf_envelope_set_auth_pass(SMFEnvelope_T *envelope, char *auth_pass);
128 
135 char *smf_envelope_get_auth_pass(SMFEnvelope_T *envelope);
136 
143 void smf_envelope_set_nexthop(SMFEnvelope_T *envelope, char *nexthop);
144 
151 char *smf_envelope_get_nexthop(SMFEnvelope_T *nexthop);
152 
159 void smf_envelope_set_message(SMFEnvelope_T *envelope, SMFMessage_T *message);
160 
167 SMFMessage_T *smf_envelope_get_message(SMFEnvelope_T *envelope);
168 
169 #endif /* _SMF_ENVELOPE_H */