annotate src/masqmail.h @ 392:c5fd796ea06e

Heavy refactoring in parts of conf.c. init_conf() parse_boolean() parse_list_file() Re-arrangement of code. parse_address_glob_list() Removed unneccessary parameter. parse_list() parse_interface(): Use strtok()/strchr() instead of doing is all by hand. Removed limitation of fixed size buffer. eat_comments() Use a state machine. eat_line_trailing() eat_spaces() read_lval() Better structured code. read_conf() read_route() Removed magic numbers. Made all list type in the config files accept pathname entries, except for `permanent_routes' and `query_routes.' for which this is impossible.
author markus schnalke <meillo@marmaro.de>
date Sat, 18 Feb 2012 18:07:55 +0100
parents a408411ff8df
children 5f0829f8e6c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
367
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
1 /*
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
2 ** MasqMail
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
3 ** Copyright (C) 1999-2001 Oliver Kurth
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
4 ** Copyright (C) 2010 markus schnalke <meillo@marmaro.de>
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
5 **
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
6 ** This program is free software; you can redistribute it and/or modify
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
7 ** it under the terms of the GNU General Public License as published by
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
8 ** the Free Software Foundation; either version 2 of the License, or
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
9 ** (at your option) any later version.
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
10 **
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
11 ** This program is distributed in the hope that it will be useful,
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
14 ** GNU General Public License for more details.
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
15 **
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
16 ** You should have received a copy of the GNU General Public License
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
17 ** along with this program; if not, write to the Free Software
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
18 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
19 */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
20 #include <config.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
21
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
22 #include <stdio.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
23 #include <stdarg.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
24 #include <errno.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
25 #include <stdlib.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
26 #include <string.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
27 #include <ctype.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
28 #include <unistd.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
29 #include <pwd.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
30 #include <sys/types.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
31 #include <sys/socket.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
32 #include <netinet/in.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
33 #include <time.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
34 #include <sys/time.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
35 #include <netinet/in.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
36 #include <arpa/inet.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
37 #include <netdb.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
38 #include <syslog.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
39 #include <signal.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
40 #include <fcntl.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
41
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
42 #include <glib.h>
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
43
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
44 #include "lookup.h"
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
45
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
46 typedef struct _interface {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
47 gchar *address;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
48 gint port;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
49 } interface;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
50
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
51 #define ADDR_FLAG_DELIVERED 0x01
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
52 #define ADDR_FLAG_DEFERED 0x02
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
53 #define ADDR_FLAG_FAILED 0x04
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
54 #define ADDR_FLAG_LAST_ROUTE 0x40
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
55
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
56 typedef struct _address {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
57 gchar *address;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
58 gchar *local_part;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
59 gchar *domain;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
60 gint flags;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
61 GList *children;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
62 struct _address *parent;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
63 } address;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
64
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
65 #define addr_mark_delivered(addr) { addr->flags |= ADDR_FLAG_DELIVERED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
66 #define addr_unmark_delivered(addr) { addr->flags &= ~ADDR_FLAG_DELIVERED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
67 #define addr_is_delivered(addr) ((addr->flags & ADDR_FLAG_DELIVERED) != 0 )
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
68
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
69 #define addr_mark_defered(addr) { addr->flags |= ADDR_FLAG_DEFERED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
70 #define addr_unmark_defered(addr) { addr->flags &= ~ADDR_FLAG_DEFERED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
71 #define addr_is_defered(addr) ((addr->flags & ADDR_FLAG_DEFERED) != 0 )
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
72
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
73 #define addr_mark_failed(addr) { addr->flags |= ADDR_FLAG_FAILED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
74 #define addr_unmark_failed(addr) { addr->flags &= ~ADDR_FLAG_FAILED; }
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
75 #define addr_is_failed(addr) ((addr->flags & ADDR_FLAG_FAILED) != 0 )
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
76
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
77 typedef struct _connect_route {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
78 gchar *name;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
79 gchar *filename;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
80
354
08932c629849 reworked the route concept; removed the idea of the localnet
markus schnalke <meillo@marmaro.de>
parents: 350
diff changeset
81 gboolean is_perma;
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
82 gboolean last_route;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
83
317
55b7bde95d37 reworked allowed and denied addrs for routes
meillo@marmaro.de
parents: 311
diff changeset
84 GList *allowed_senders;
55b7bde95d37 reworked allowed and denied addrs for routes
meillo@marmaro.de
parents: 311
diff changeset
85 GList *denied_senders;
55b7bde95d37 reworked allowed and denied addrs for routes
meillo@marmaro.de
parents: 311
diff changeset
86 GList *allowed_recipients;
55b7bde95d37 reworked allowed and denied addrs for routes
meillo@marmaro.de
parents: 311
diff changeset
87 GList *denied_recipients;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
88
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
89 interface *mail_host;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
90 gboolean connect_error_fail;
320
4c705c34182f cosmetic changes
meillo@marmaro.de
parents: 317
diff changeset
91 GList *resolve_list;
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
92 gchar *helo_name;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
93 gboolean do_correct_helo;
222
8cddc65765bd added support for STARTTLS wrappers
meillo@marmaro.de
parents: 205
diff changeset
94 gboolean instant_helo;
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
95 gboolean do_pipelining;
320
4c705c34182f cosmetic changes
meillo@marmaro.de
parents: 317
diff changeset
96 gchar *auth_name;
4c705c34182f cosmetic changes
meillo@marmaro.de
parents: 317
diff changeset
97 gchar *auth_login;
4c705c34182f cosmetic changes
meillo@marmaro.de
parents: 317
diff changeset
98 gchar *auth_secret;
4c705c34182f cosmetic changes
meillo@marmaro.de
parents: 317
diff changeset
99 gchar *wrapper;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
100
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
101 gchar *set_h_from_domain;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
102 gchar *set_h_reply_to_domain;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
103 gchar *set_return_path_domain;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
104 GList *map_h_from_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
105 GList *map_h_reply_to_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
106 GList *map_h_mail_followup_to_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
107 GList *map_return_path_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
108 gboolean expand_h_sender_domain;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
109 gboolean expand_h_sender_address;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
110
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
111 gchar *pipe;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
112 gboolean pipe_fromline;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
113 gboolean pipe_fromhack;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
114 } connect_route;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
115
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
116 typedef struct _masqmail_conf {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
117 gint mail_uid;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
118 gint mail_gid;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
119
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
120 gint orig_uid;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
121 gint orig_gid;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
122
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
123 gboolean run_as_user;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
124
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
125 gchar *mail_dir;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
126 gchar *lock_dir;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
127 gchar *spool_dir;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
128 gchar *log_dir;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
129
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
130 gint debug_level;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
131 gboolean use_syslog;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
132 guint log_max_pri;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
133
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
134 gchar *host_name;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
135 GList *local_hosts;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
136 GList *local_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
137 GList *not_local_addresses;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
138 GList *listen_addresses;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
139
367
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
140 /*
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
141 ** ANSI C defines unsigned long to be at least 32bit
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
142 ** i.e. ca. 4GB max; that should be enough.
b27f66555ba8 Reformated multiline comments to have leading asterisks on each line
markus schnalke <meillo@marmaro.de>
parents: 366
diff changeset
143 */
117
5ec5e6637049 added server-side SMTP SIZE support (patch by Paolo)
meillo@marmaro.de
parents: 110
diff changeset
144 gulong max_msg_size;
5ec5e6637049 added server-side SMTP SIZE support (patch by Paolo)
meillo@marmaro.de
parents: 110
diff changeset
145
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
146 gboolean do_save_envelope_to;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
147
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
148 gboolean defer_all;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
149 gboolean do_relay;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
150
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
151 gboolean do_queue;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
152
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
153 gboolean do_verbose;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
154
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
155 gchar *mbox_default;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
156 GList *mbox_users;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
157 GList *mda_users;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
158
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
159 gchar *mda;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
160 gboolean mda_fromline;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
161 gboolean mda_fromhack;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
162
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
163 gboolean pipe_fromline;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
164 gboolean pipe_fromhack;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
165
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
166 gchar *alias_file;
244
7082044c05c6 renamed `alias_local_cmp' to `localpartcmp'
markus schnalke <meillo@marmaro.de>
parents: 242
diff changeset
167 int (*localpartcmp) (const char *, const char *);
387
a408411ff8df Added a glob-pattern aliasing facility.
markus schnalke <meillo@marmaro.de>
parents: 378
diff changeset
168 gchar *globalias_file;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
169
354
08932c629849 reworked the route concept; removed the idea of the localnet
markus schnalke <meillo@marmaro.de>
parents: 350
diff changeset
170 GList *perma_routes;
08932c629849 reworked the route concept; removed the idea of the localnet
markus schnalke <meillo@marmaro.de>
parents: 350
diff changeset
171 GList *query_routes; /* list of pairs which point to lists */
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
172
310
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 303
diff changeset
173 gchar *online_query;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
174
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
175 gchar *errmsg_file;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
176 gchar *warnmsg_file;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
177 GList *warn_intervals;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
178 gint max_defer_time;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
179
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
180 gchar *log_user;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
181 } masqmail_conf;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
182
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
183 extern masqmail_conf conf;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
184
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
185 typedef struct _table_pair {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
186 gchar *key;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
187 gpointer *value;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
188 } table_pair;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
189
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
190
299
ca2d11aec2a3 fixed compile error; removed PROT_BSMTP; made protocol names ucase
markus schnalke <meillo@marmaro.de>
parents: 268
diff changeset
191 /* must match the contents of prot_names[] in accept.c */
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
192 typedef enum _prot_id {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
193 PROT_LOCAL = 0,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
194 PROT_SMTP,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
195 PROT_ESMTP,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
196 PROT_NUM
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
197 } prot_id;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
198
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
199 extern gchar *prot_names[];
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
200
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
201 typedef enum _header_id {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
202 HEAD_FROM = 0,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
203 HEAD_SENDER,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
204 HEAD_TO,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
205 HEAD_CC,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
206 HEAD_BCC,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
207 HEAD_DATE,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
208 HEAD_MESSAGE_ID,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
209 HEAD_REPLY_TO,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
210 HEAD_SUBJECT,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
211 HEAD_RETURN_PATH,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
212 HEAD_ENVELOPE_TO,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
213 HEAD_RECEIVED,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
214 HEAD_NUM_IDS,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
215 HEAD_STATUS,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
216 HEAD_UNKNOWN = HEAD_NUM_IDS,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
217 HEAD_NONE = -1,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
218 } header_id;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
219
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
220 typedef struct _header_name {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
221 gchar *header;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
222 header_id id;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
223 } header_name;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
224
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
225 typedef struct _header {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
226 header_id id;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
227 gchar *header;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
228 gchar *value;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
229 } header;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
230
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
231
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
232 typedef struct _message {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
233 gchar *uid;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
234
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
235 gchar *received_host;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
236 prot_id received_prot;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
237 gchar *ident;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
238 gint transfer_id; /* for multiple messages per transfer */
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
239
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
240 address *return_path;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
241 GList *rcpt_list;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
242 GList *non_rcpt_list;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
243
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
244 GList *hdr_list;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
245 GList *data_list;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
246
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
247 gint data_size;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
248 time_t received_time;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
249 time_t warned_time;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
250
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
251 gchar *full_sender_name;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
252 } message;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
253
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
254 typedef struct _msg_out {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
255 message *msg;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
256
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
257 address *return_path;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
258 GList *rcpt_list;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
259
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
260 GList *hdr_list;
354
08932c629849 reworked the route concept; removed the idea of the localnet
markus schnalke <meillo@marmaro.de>
parents: 350
diff changeset
261 GList *xtra_hdr_list; /* rewritten headers */
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
262 } msg_out;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
263
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
264 typedef struct _msgout_perhost {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
265 gchar *host;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
266 GList *msgout_list;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
267 } msgout_perhost;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
268
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
269 /* flags for accept() */
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
270 #define ACC_RCPT_FROM_HEAD 0x08 /* -t option, get rcpts from headers */
110
c678d0342451 changed name ACC_NODOT_TERM to ACC_DOT_IGNORE for better understanding
meillo@marmaro.de
parents: 109
diff changeset
271 #define ACC_DOT_IGNORE 0x10 /* a dot on a line itself does not end the message (-oi option) */
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
272 #define ACC_MAIL_FROM_HEAD 0x40 /* get return path from header */
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
273 #define ACC_NODOT_RELAX 0x80 /* do not be picky if message ist not terminated by a dot on a line */
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
274 #define ACC_SAVE_ENVELOPE_TO 0x0100 /* save an existent Envelope-to header as X-Orig-Envelope-to */
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
275
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
276 #define DLVR_LOCAL 0x01
356
f4ba4ed28848 removed DLVR_LAN which is now unused
markus schnalke <meillo@marmaro.de>
parents: 354
diff changeset
277 #define DLVR_ONLINE 0x02
f4ba4ed28848 removed DLVR_LAN which is now unused
markus schnalke <meillo@marmaro.de>
parents: 354
diff changeset
278 #define DLVR_ALL (DLVR_LOCAL|DLVR_ONLINE)
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
279
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
280 /* transport flags */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
281 #define MSGSTR_FROMLINE 0x01
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
282 #define MSGSTR_FROMHACK 0x02
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
283
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
284 typedef enum _accept_error {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
285 AERR_OK = 0,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
286 AERR_TIMEOUT,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
287 AERR_EOF,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
288 AERR_OVERFLOW,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
289 AERR_SYNTAX,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
290 AERR_NOSPOOL,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
291 AERR_NORCPT,
117
5ec5e6637049 added server-side SMTP SIZE support (patch by Paolo)
meillo@marmaro.de
parents: 110
diff changeset
292 AERR_SIZE, /* max msg size exeeded (SMTP SIZE) */
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
293 AERR_UNKNOWN
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
294 } accept_error;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
295
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
296 #define BUF_LEN 1024
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
297 #define MAX_ADDRESS 256
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
298 #define MAX_DATALINE 4096
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
299
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
300 typedef enum _smtp_cmd_id {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
301 SMTP_HELO = 0,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
302 SMTP_EHLO,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
303 SMTP_MAIL_FROM,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
304 SMTP_RCPT_TO,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
305 SMTP_DATA,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
306 SMTP_QUIT,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
307 SMTP_RSET,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
308 SMTP_NOOP,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
309 SMTP_HELP,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
310 SMTP_NUM_IDS,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
311 SMTP_EOF = -1,
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
312 SMTP_ERROR = -2,
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
313 } smtp_cmd_id;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
314
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
315 typedef struct _smtp_cmd {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
316 smtp_cmd_id id;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
317 gchar *cmd;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
318 } smtp_cmd;
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
319
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
320 typedef struct _smtp_connection {
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
321 gchar *remote_host;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
322
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
323 prot_id prot;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
324 gint next_id;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
325
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
326 gboolean helo_seen;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
327 gboolean from_seen;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
328 gboolean rcpt_seen;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
329
10
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
330 message *msg;
26e34ae9a3e3 changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents: 0
diff changeset
331 } smtp_connection;
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
332
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
333 /* alias.c*/
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
334 gboolean addr_is_local(address *addr);
387
a408411ff8df Added a glob-pattern aliasing facility.
markus schnalke <meillo@marmaro.de>
parents: 378
diff changeset
335 GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list,
a408411ff8df Added a glob-pattern aliasing facility.
markus schnalke <meillo@marmaro.de>
parents: 378
diff changeset
336 int doglob);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
337
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
338 /* child.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
339 int child(const char *command);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
340
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
341 /* conf.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
342 void init_conf();
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
343 gboolean read_conf(gchar *filename);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
344 connect_route *read_route(gchar *filename, gboolean is_perma);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
345 GList *read_route_list(GList *rf_list, gboolean is_perma);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
346 void destroy_route(connect_route *r);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
347 void destroy_route_list(GList *list);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
348
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
349 /* expand.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
350 GList *var_table_rcpt(GList *var_table, address *rcpt);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
351 GList *var_table_msg(GList *var_table, message *msg);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
352 GList *var_table_conf(GList *var_table);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
353 gint expand(GList *var_list, gchar *format, gchar *result, gint result_len);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
354
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
355 /* message.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
356 message *create_message(void);
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
357 void destroy_message(message *msg);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
358 void destroy_msg_list(GList *msg_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
359 void msg_free_data(message *msg);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
360 gint msg_calc_size(message *msg, gboolean is_smtp);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
361
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
362 msg_out *create_msg_out(message *msg);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
363 msg_out *clone_msg_out(msg_out *msgout_orig);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
364 void destroy_msg_out(msg_out *msgout);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
365 void destroy_msg_out_list(GList *msgout_list);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
366
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
367 /* address.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
368 address *create_address(gchar *path, gboolean is_rfc821);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
369 address *create_address_qualified(gchar *path, gboolean is_rfc821, gchar *domain);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
370 address *create_address_pipe(gchar *path);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
371 void destroy_address(address *addr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
372 address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
373 #define copy_address(addr) copy_modify_address(addr, NULL, NULL)
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
374 gboolean addr_isequal(address *addr1, address *addr2, int (*cmpfunc) (const char*, const char*));
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
375 gboolean addr_isequal_parent(address *addr1, address *addr2, int (*cmpfunc) (const char*, const char*));
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
376 address *addr_find_ancestor(address *addr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
377 gboolean addr_is_delivered_children(address *addr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
378 gboolean addr_is_finished_children(address *addr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
379 gchar *addr_string(address *addr);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
380
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
381 /* accept.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
382 accept_error accept_message(FILE *in, message *msg, guint flags);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
383 accept_error accept_message_prepare(message *msg, guint flags);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
384
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
385 /* header.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
386 gchar *rec_timestamp();
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
387 GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
388 void header_unfold(header *hdr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
389 void header_fold(header *hdr, unsigned int maxlen);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
390 header *create_header(header_id id, gchar *fmt, ...);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
391 void destroy_header(header *hdr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
392 header *copy_header(header *hdr);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
393 header *get_header(gchar *line);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
394
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
395 /* smtp_in.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
396 void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
397
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
398 /* listen.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
399 void listen_port(GList *addr_list, gint qival, char *argv[]);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
400
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
401 /* parse.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
402 gboolean split_address(const gchar *path, gchar **local_part, gchar **domain, gboolean is_rfc821);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
403 gboolean parse_address_rfc822(gchar *string, gchar **local_begin, gchar **local_end, gchar **domain_begin, gchar **domain_end, gchar **address_end);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
404 gboolean parse_address_rfc821(gchar *string, gchar **local_begin, gchar **local_end, gchar **domain_begin, gchar **domain_end, gchar **address_end);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
405 address *_create_address(gchar *string, gchar **end, gboolean is_rfc821);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
406 address *create_address_rfc821(gchar *string, gchar **end);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
407 address *create_address_rfc822(gchar *string, gchar **end);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
408 GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
409
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
410 /* connect.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
411 mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port, GList *addr_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
412 mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port, GList *res_funcs);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
413
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
414 /* deliver.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
415 void msg_rcptlist_local(GList *rcpt_list, GList **, GList **);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
416 gboolean deliver_local(msg_out *msgout);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
417 gboolean deliver_msglist_host(connect_route *route, GList *msg_list, gchar *host, GList *res_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
418 gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
419 gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
420 gboolean deliver_finish(msg_out *msgout);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
421 gboolean deliver_msg_list(GList *msg_list, guint flags);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
422 gboolean deliver(message *msg);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
423
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
424 /* fail_msg.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
425 gboolean fail_msg(message *msg, gchar *template, GList *failed_rcpts, gchar *err_fmt, va_list args);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
426 gboolean warn_msg(message *msg, gchar *template, GList *failed_rcpts, gchar *err_fmt, va_list args);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
427
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
428 /* interface.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
429 gboolean init_sockaddr(struct sockaddr_in *name, interface *iface);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
430 int make_server_socket(interface *iface);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
431
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
432 /* local.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
433 gboolean append_file(message *msg, GList *hdr_list, gchar *user);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
434 gboolean pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
435
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
436 /* log.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
437 gchar *ext_strerror(int err);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
438 gboolean logopen(void);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
439 void logclose(void);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
440 void vlogwrite(int pri, const char *fmt, va_list args);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
441 void logwrite(int pri, const char *fmt, ...);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
442 void debugf(const char *fmt, ...);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
443 void vdebugf(const char *fmt, va_list args);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
444 void maillog(const char *fmt, ...);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
445
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
446 /* spool.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
447 gboolean spool_read_data(message *msg);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
448 message *msg_spool_read(gchar *uid);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
449 gboolean spool_write(message *msg, gboolean do_writedata);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
450 gboolean spool_lock(gchar *uid);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
451 gboolean spool_unlock(gchar *uid);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
452 gboolean spool_delete_all(message *msg);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
453
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
454 /* queue.c */
348
a7a387253b2f Argument of read_queue() was unused, thus removed
markus schnalke <meillo@marmaro.de>
parents: 345
diff changeset
455 GList *read_queue(void);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
456 gboolean queue_run(void);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
457 gboolean queue_run_online(void);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
458 void queue_list(void);
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
459 gboolean queue_delete(gchar *uid);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
460
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
461 /* online.c */
310
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 303
diff changeset
462 gchar *online_query();
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
463
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
464 /* permissions.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
465 gboolean is_ingroup(uid_t uid, gid_t gid);
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
466 void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
467 void set_identity(uid_t old_uid, gchar *task_name);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
468
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
469 /* rewrite.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
470 gboolean set_address_header_domain(header *hdr, gchar *domain);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
471 gboolean map_address_header(header *hdr, GList *table);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
472
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
473 /* route.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
474 msgout_perhost *create_msgout_perhost(gchar *host);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
475 void destroy_msgout_perhost(msgout_perhost *mo_ph);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
476 void rewrite_headers(msg_out *msgout, connect_route *route);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
477 void split_rcpts(GList *rcpt_list, GList *localnets, GList **rl_local, GList **rl_localnet, GList **rl_others);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
478 GList *local_rcpts(GList *rcpt_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
479 GList *remote_rcpts(GList *rcpt_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
480 gboolean route_strip_msgout(connect_route *route, msg_out *msgout);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
481 msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
482 GList *route_msgout_list(connect_route *route, GList *msgout_list);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
483 gboolean route_sender_is_allowed(connect_route *route, address *ret_path);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
484 void route_split_rcpts(connect_route *route, GList *rcpt_list, GList **p_rcpt_list, GList **p_non_rcpt_list);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
485
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
486 /* tables.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
487 table_pair *create_pair(gchar *key, gpointer value);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
488 table_pair *create_pair_string(gchar *key, gpointer value);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
489 table_pair *parse_table_pair(gchar *line, char delim);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
490 gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func) (const char *, const char *));
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
491 gpointer *table_find(GList *table_list, gchar *key);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
492 gpointer *table_find_case(GList *table_list, gchar *key);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
493 gpointer *table_find_fnmatch(GList *table_list, gchar *key);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
494 GList *table_read(gchar *fname, gchar delim);
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
495 void destroy_table(GList *table);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
496
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
497 /* timeival.c */
366
41958685480d Switched to `type *name' style
markus schnalke <meillo@marmaro.de>
parents: 356
diff changeset
498 gint time_interval(gchar *str);
0
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
499
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
500 /* permissions.c */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
501 gboolean is_privileged_user(uid_t uid);
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
502
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
503 /* other things */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
504
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
505 #define foreach(list, node)\
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
506 for((node) = g_list_first(list);\
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
507 (node);\
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
508 (node) = g_list_next(node))
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
509
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
510 #ifdef ENABLE_DEBUG
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
511 #define DEBUG(level) if(level <= conf.debug_level)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
512 #else
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
513 /* hopefully the compiler optmizes this away... */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
514 #define DEBUG(level) if(0)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
515 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
516
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
517 #define LOG_VERBOSE 0x100
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
518
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
519 #ifndef HAVE_GETLINE
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
520 #define getline(buf, size, file) getdelim(buf, size, '\n', file)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
521 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
522
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
523 #ifndef HAVE_FDATASYNC
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
524 #define fdatasync(fd) fsync(fd)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
525 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
526
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
527 #ifndef CONF_DIR
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
528 #define CONF_DIR "/etc/masqmail"
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
529 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
530
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
531 #define CONF_FILE CONF_DIR"/masqmail.conf"
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
532
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
533 #define PIDFILEDIR "/var/run/masqmail/"
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
534
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
535 #ifndef va_copy
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
536 #ifdef __va_copy
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
537 #define va_copy(ap1, ap2) __va_copy(ap1, ap2)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
538 #else
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
539 #define va_copy(ap1, ap2) G_VA_COPY(ap1, ap2)
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
540 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
541 #endif
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
542
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
543 /* *BSD needs this: */
08114f7dcc23 this is masqmail-0.2.21 from oliver kurth
meillo@marmaro.de
parents:
diff changeset
544 extern char **environ;