masqmail-0.2

diff src/masqmail.h @ 10:26e34ae9a3e3

changed indention and line wrapping to a more consistent style
author meillo@marmaro.de
date Mon, 27 Oct 2008 16:23:10 +0100
parents 08114f7dcc23
children f4719cffc48c
line diff
     1.1 --- a/src/masqmail.h	Mon Oct 27 16:21:27 2008 +0100
     1.2 +++ b/src/masqmail.h	Mon Oct 27 16:23:10 2008 +0100
     1.3 @@ -45,11 +45,9 @@
     1.4  
     1.5  #include "lookup.h"
     1.6  
     1.7 -typedef
     1.8 -struct _interface
     1.9 -{
    1.10 -  gchar *address;
    1.11 -  gint port;
    1.12 +typedef struct _interface {
    1.13 +	gchar *address;
    1.14 +	gint port;
    1.15  } interface;
    1.16  
    1.17  #define ADDR_FLAG_DELIVERED 0x01
    1.18 @@ -58,14 +56,13 @@
    1.19  #define ADDR_FLAG_LAST_ROUTE 0x40
    1.20  #define ADDR_FLAG_NOEXPAND 0x80
    1.21  
    1.22 -typedef struct _address
    1.23 -{
    1.24 -  gchar *address;
    1.25 -  gchar *local_part;
    1.26 -  gchar *domain;
    1.27 -  gint flags;
    1.28 -  GList *children;
    1.29 -  struct _address *parent;
    1.30 +typedef struct _address {
    1.31 +	gchar *address;
    1.32 +	gchar *local_part;
    1.33 +	gchar *domain;
    1.34 +	gint flags;
    1.35 +	GList *children;
    1.36 +	struct _address *parent;
    1.37  } address;
    1.38  
    1.39  #define addr_mark_delivered(addr) { addr->flags |= ADDR_FLAG_DELIVERED; }
    1.40 @@ -80,269 +77,247 @@
    1.41  #define addr_unmark_failed(addr) { addr->flags &= ~ADDR_FLAG_FAILED; }
    1.42  #define addr_is_failed(addr) ((addr->flags & ADDR_FLAG_FAILED) != 0 )
    1.43  
    1.44 -typedef
    1.45 -struct _connect_route
    1.46 -{
    1.47 -  gchar *name;
    1.48 -  gchar *filename;
    1.49 +typedef struct _connect_route {
    1.50 +	gchar *name;
    1.51 +	gchar *filename;
    1.52  
    1.53 -  gchar *protocol;
    1.54 +	gchar *protocol;
    1.55  
    1.56 -  gboolean is_local_net;
    1.57 -  gboolean last_route;
    1.58 +	gboolean is_local_net;
    1.59 +	gboolean last_route;
    1.60  
    1.61 -  GList *allowed_return_paths;
    1.62 -  GList *not_allowed_return_paths;
    1.63 -  GList *allowed_mail_locals;
    1.64 -  GList *not_allowed_mail_locals;
    1.65 -  GList *allowed_rcpt_domains;
    1.66 -  GList *not_allowed_rcpt_domains;
    1.67 +	GList *allowed_return_paths;
    1.68 +	GList *not_allowed_return_paths;
    1.69 +	GList *allowed_mail_locals;
    1.70 +	GList *not_allowed_mail_locals;
    1.71 +	GList *allowed_rcpt_domains;
    1.72 +	GList *not_allowed_rcpt_domains;
    1.73  
    1.74 -  interface *mail_host;
    1.75 -  gchar *wrapper;
    1.76 -  gboolean connect_error_fail;
    1.77 +	interface *mail_host;
    1.78 +	gchar *wrapper;
    1.79 +	gboolean connect_error_fail;
    1.80  
    1.81 -  gchar *helo_name;
    1.82 -  gboolean do_correct_helo;
    1.83 -  gboolean do_pipelining;
    1.84 +	gchar *helo_name;
    1.85 +	gboolean do_correct_helo;
    1.86 +	gboolean do_pipelining;
    1.87  
    1.88 -  gchar *set_h_from_domain;
    1.89 -  gchar *set_h_reply_to_domain;
    1.90 -  gchar *set_return_path_domain;
    1.91 +	gchar *set_h_from_domain;
    1.92 +	gchar *set_h_reply_to_domain;
    1.93 +	gchar *set_return_path_domain;
    1.94  
    1.95 -  GList *map_h_from_addresses;
    1.96 -  GList *map_h_reply_to_addresses;
    1.97 -  GList *map_h_mail_followup_to_addresses;
    1.98 -  GList *map_return_path_addresses;
    1.99 +	GList *map_h_from_addresses;
   1.100 +	GList *map_h_reply_to_addresses;
   1.101 +	GList *map_h_mail_followup_to_addresses;
   1.102 +	GList *map_return_path_addresses;
   1.103  
   1.104 -  gboolean expand_h_sender_domain;
   1.105 -  gboolean expand_h_sender_address;
   1.106 +	gboolean expand_h_sender_domain;
   1.107 +	gboolean expand_h_sender_address;
   1.108  
   1.109 -  GList *resolve_list;
   1.110 +	GList *resolve_list;
   1.111  
   1.112 -  gchar *auth_name;
   1.113 -  gchar *auth_login;
   1.114 -  gchar *auth_secret;
   1.115 +	gchar *auth_name;
   1.116 +	gchar *auth_login;
   1.117 +	gchar *auth_secret;
   1.118  
   1.119 -  gchar *pop3_login;
   1.120 +	gchar *pop3_login;
   1.121  
   1.122 -  gchar *pipe;
   1.123 -  
   1.124 -  gboolean pipe_fromline;
   1.125 -  gboolean pipe_fromhack;
   1.126 +	gchar *pipe;
   1.127 +
   1.128 +	gboolean pipe_fromline;
   1.129 +	gboolean pipe_fromhack;
   1.130  } connect_route;
   1.131  
   1.132 -typedef struct _get_conf
   1.133 -{
   1.134 -  gchar *protocol;
   1.135 -  gchar *server_name;
   1.136 -  guint server_port;
   1.137 -  gchar *wrapper;
   1.138 -  gchar *login_user;
   1.139 -  gchar *login_pass;
   1.140 -  address *address;
   1.141 -  address *return_path;
   1.142 -  gboolean do_keep;
   1.143 -  gboolean do_uidl;
   1.144 -  gboolean do_uidl_dele;
   1.145 -  gint max_size;
   1.146 -  gboolean max_size_delete;
   1.147 -  gint max_count;
   1.148 +typedef struct _get_conf {
   1.149 +	gchar *protocol;
   1.150 +	gchar *server_name;
   1.151 +	guint server_port;
   1.152 +	gchar *wrapper;
   1.153 +	gchar *login_user;
   1.154 +	gchar *login_pass;
   1.155 +	address *address;
   1.156 +	address *return_path;
   1.157 +	gboolean do_keep;
   1.158 +	gboolean do_uidl;
   1.159 +	gboolean do_uidl_dele;
   1.160 +	gint max_size;
   1.161 +	gboolean max_size_delete;
   1.162 +	gint max_count;
   1.163  
   1.164 -  GList *resolve_list;
   1.165 +	GList *resolve_list;
   1.166  
   1.167  } get_conf;
   1.168  
   1.169 -typedef
   1.170 -struct _masqmail_conf
   1.171 -{
   1.172 -  gint mail_uid;
   1.173 -  gint mail_gid;
   1.174 +typedef struct _masqmail_conf {
   1.175 +	gint mail_uid;
   1.176 +	gint mail_gid;
   1.177  
   1.178 -  gint orig_uid;
   1.179 -  gint orig_gid;
   1.180 +	gint orig_uid;
   1.181 +	gint orig_gid;
   1.182  
   1.183 -  gboolean run_as_user;
   1.184 +	gboolean run_as_user;
   1.185  
   1.186 -  gchar *mail_dir;
   1.187 -  gchar *lock_dir;
   1.188 -  gchar *spool_dir;
   1.189 -  gchar *log_dir;
   1.190 +	gchar *mail_dir;
   1.191 +	gchar *lock_dir;
   1.192 +	gchar *spool_dir;
   1.193 +	gchar *log_dir;
   1.194  
   1.195 -  gint debug_level;
   1.196 -  gboolean use_syslog;
   1.197 -  guint log_max_pri;
   1.198 +	gint debug_level;
   1.199 +	gboolean use_syslog;
   1.200 +	guint log_max_pri;
   1.201  
   1.202 -  gchar *host_name;
   1.203 -  GList *local_hosts;
   1.204 -  GList *local_addresses;
   1.205 -  GList *not_local_addresses;
   1.206 -  GList *local_nets;
   1.207 -  GList *listen_addresses;
   1.208 +	gchar *host_name;
   1.209 +	GList *local_hosts;
   1.210 +	GList *local_addresses;
   1.211 +	GList *not_local_addresses;
   1.212 +	GList *local_nets;
   1.213 +	GList *listen_addresses;
   1.214  
   1.215 -  guint remote_port;
   1.216 +	guint remote_port;
   1.217  
   1.218 -  gboolean do_save_envelope_to;
   1.219 +	gboolean do_save_envelope_to;
   1.220  
   1.221 -  gboolean defer_all;
   1.222 -  gboolean do_relay;
   1.223 +	gboolean defer_all;
   1.224 +	gboolean do_relay;
   1.225  
   1.226 -  GList *ident_trusted_nets;
   1.227 +	GList *ident_trusted_nets;
   1.228  
   1.229 -  gboolean do_queue;
   1.230 +	gboolean do_queue;
   1.231  
   1.232 -  gboolean do_verbose;
   1.233 +	gboolean do_verbose;
   1.234  
   1.235 -  gchar *mbox_default;
   1.236 -  GList *mbox_users;
   1.237 -  GList *mda_users;
   1.238 -  GList *maildir_users;
   1.239 +	gchar *mbox_default;
   1.240 +	GList *mbox_users;
   1.241 +	GList *mda_users;
   1.242 +	GList *maildir_users;
   1.243  
   1.244 -  gchar *mda;
   1.245 -  gboolean mda_fromline;
   1.246 -  gboolean mda_fromhack;
   1.247 +	gchar *mda;
   1.248 +	gboolean mda_fromline;
   1.249 +	gboolean mda_fromhack;
   1.250  
   1.251 -  gboolean pipe_fromline;
   1.252 -  gboolean pipe_fromhack;
   1.253 +	gboolean pipe_fromline;
   1.254 +	gboolean pipe_fromhack;
   1.255  
   1.256 -  gchar *alias_file;
   1.257 -  int (*alias_local_cmp)(const char *, const char *);
   1.258 +	gchar *alias_file;
   1.259 +	int (*alias_local_cmp) (const char *, const char *);
   1.260  
   1.261 -  GList *local_net_routes;
   1.262 -  GList *connect_routes; /* list of pairs which point to lists */
   1.263 +	GList *local_net_routes;
   1.264 +	GList *connect_routes;  /* list of pairs which point to lists */
   1.265  
   1.266 -  gchar *online_detect;
   1.267 -  gchar *online_file;
   1.268 -  gchar *online_pipe;
   1.269 -  interface *mserver_iface;
   1.270 +	gchar *online_detect;
   1.271 +	gchar *online_file;
   1.272 +	gchar *online_pipe;
   1.273 +	interface *mserver_iface;
   1.274  
   1.275 -  GList *get_names;
   1.276 -  GList *online_gets; /* list of pairs which point to lists */
   1.277 +	GList *get_names;
   1.278 +	GList *online_gets;  /* list of pairs which point to lists */
   1.279  
   1.280 -  gchar *errmsg_file;
   1.281 -  gchar *warnmsg_file;
   1.282 -  GList *warn_intervals;
   1.283 -  gint max_defer_time;
   1.284 +	gchar *errmsg_file;
   1.285 +	gchar *warnmsg_file;
   1.286 +	GList *warn_intervals;
   1.287 +	gint max_defer_time;
   1.288  
   1.289 -  gchar *log_user;
   1.290 +	gchar *log_user;
   1.291  } masqmail_conf;
   1.292  
   1.293  extern masqmail_conf conf;
   1.294  
   1.295 -typedef
   1.296 -struct _table_pair
   1.297 -{
   1.298 -  gchar *key;
   1.299 -  gpointer *value;
   1.300 +typedef struct _table_pair {
   1.301 +	gchar *key;
   1.302 +	gpointer *value;
   1.303  } table_pair;
   1.304  
   1.305  
   1.306 -typedef
   1.307 -enum _prot_id
   1.308 -{
   1.309 -  PROT_LOCAL = 0,
   1.310 -  PROT_BSMTP,
   1.311 -  PROT_SMTP,
   1.312 -  PROT_ESMTP,
   1.313 -  PROT_POP3,
   1.314 -  PROT_APOP,
   1.315 -  PROT_NUM
   1.316 -}prot_id;
   1.317 +typedef enum _prot_id {
   1.318 +	PROT_LOCAL = 0,
   1.319 +	PROT_BSMTP,
   1.320 +	PROT_SMTP,
   1.321 +	PROT_ESMTP,
   1.322 +	PROT_POP3,
   1.323 +	PROT_APOP,
   1.324 +	PROT_NUM
   1.325 +} prot_id;
   1.326  
   1.327  extern gchar *prot_names[];
   1.328  
   1.329 -typedef
   1.330 -enum _header_id
   1.331 -{
   1.332 -  HEAD_FROM = 0,
   1.333 -  HEAD_SENDER,
   1.334 -  HEAD_TO,
   1.335 -  HEAD_CC,
   1.336 -  HEAD_BCC,
   1.337 -  HEAD_DATE,
   1.338 -  HEAD_MESSAGE_ID,
   1.339 -  HEAD_REPLY_TO,
   1.340 -  HEAD_SUBJECT,
   1.341 -  HEAD_RETURN_PATH,
   1.342 -  HEAD_ENVELOPE_TO,
   1.343 -  HEAD_RECEIVED,
   1.344 -  HEAD_NUM_IDS,
   1.345 -  HEAD_STATUS,
   1.346 -  HEAD_UNKNOWN = HEAD_NUM_IDS,
   1.347 -  HEAD_NONE = -1,
   1.348 -}header_id;
   1.349 +typedef enum _header_id {
   1.350 +	HEAD_FROM = 0,
   1.351 +	HEAD_SENDER,
   1.352 +	HEAD_TO,
   1.353 +	HEAD_CC,
   1.354 +	HEAD_BCC,
   1.355 +	HEAD_DATE,
   1.356 +	HEAD_MESSAGE_ID,
   1.357 +	HEAD_REPLY_TO,
   1.358 +	HEAD_SUBJECT,
   1.359 +	HEAD_RETURN_PATH,
   1.360 +	HEAD_ENVELOPE_TO,
   1.361 +	HEAD_RECEIVED,
   1.362 +	HEAD_NUM_IDS,
   1.363 +	HEAD_STATUS,
   1.364 +	HEAD_UNKNOWN = HEAD_NUM_IDS,
   1.365 +	HEAD_NONE = -1,
   1.366 +} header_id;
   1.367  
   1.368 -typedef
   1.369 -struct _header_name
   1.370 -{
   1.371 -  gchar *header;
   1.372 -  header_id id;
   1.373 -}header_name;
   1.374 +typedef struct _header_name {
   1.375 +	gchar *header;
   1.376 +	header_id id;
   1.377 +} header_name;
   1.378  
   1.379 -typedef
   1.380 -struct _header
   1.381 -{
   1.382 -  header_id id;
   1.383 -  gchar *header;
   1.384 -  gchar *value;
   1.385 -}header;
   1.386 +typedef struct _header {
   1.387 +	header_id id;
   1.388 +	gchar *header;
   1.389 +	gchar *value;
   1.390 +} header;
   1.391  
   1.392  
   1.393 -typedef
   1.394 -struct _message
   1.395 -{
   1.396 -  gchar *uid;
   1.397 +typedef struct _message {
   1.398 +	gchar *uid;
   1.399  
   1.400 -  gchar *received_host;
   1.401 -  prot_id received_prot;
   1.402 -  gchar *ident;
   1.403 -  gint transfer_id; /* for multiple messages per transfer */
   1.404 +	gchar *received_host;
   1.405 +	prot_id received_prot;
   1.406 +	gchar *ident;
   1.407 +	gint transfer_id;  /* for multiple messages per transfer */
   1.408  
   1.409 -  address *return_path;
   1.410 -  GList *rcpt_list;
   1.411 -  GList *non_rcpt_list;
   1.412 +	address *return_path;
   1.413 +	GList *rcpt_list;
   1.414 +	GList *non_rcpt_list;
   1.415  
   1.416 -  GList *hdr_list;
   1.417 -  GList *data_list;
   1.418 +	GList *hdr_list;
   1.419 +	GList *data_list;
   1.420  
   1.421 -  gint data_size;
   1.422 -  time_t received_time;
   1.423 -  time_t warned_time;
   1.424 +	gint data_size;
   1.425 +	time_t received_time;
   1.426 +	time_t warned_time;
   1.427  
   1.428 -  gchar *full_sender_name;
   1.429 -}message;
   1.430 +	gchar *full_sender_name;
   1.431 +} message;
   1.432  
   1.433 -typedef
   1.434 -struct _msg_out
   1.435 -{
   1.436 -  message *msg;
   1.437 -  
   1.438 -  address *return_path;
   1.439 -  GList *rcpt_list;
   1.440 +typedef struct _msg_out {
   1.441 +	message *msg;
   1.442  
   1.443 -  GList *hdr_list;
   1.444 -  GList *xtra_hdr_list;
   1.445 -}msg_out;
   1.446 +	address *return_path;
   1.447 +	GList *rcpt_list;
   1.448  
   1.449 -typedef
   1.450 -struct _msgout_perhost
   1.451 -{
   1.452 -  gchar *host;
   1.453 -  GList *msgout_list;
   1.454 +	GList *hdr_list;
   1.455 +	GList *xtra_hdr_list;
   1.456 +} msg_out;
   1.457 +
   1.458 +typedef struct _msgout_perhost {
   1.459 +	gchar *host;
   1.460 +	GList *msgout_list;
   1.461  } msgout_perhost;
   1.462  
   1.463  /* flags for accept() */
   1.464  /*#define ACC_LOCAL      0x01 (we better use received_host == NULL) */
   1.465 -#define ACC_HEAD_FROM_RCPT 0x01 /* create To: Header from rcpt_list (cmd line) */
   1.466 -#define ACC_DEL_RCPTS      0x02 /* -t option, delete rcpts */
   1.467 -#define ACC_DEL_BCC        0x04 /* -t option, delete Bcc header */
   1.468 -#define ACC_RCPT_FROM_HEAD 0x08 /* -t option, get rcpts from headers */
   1.469 -#define ACC_NODOT_TERM     0x10 /* a dot on a line itself does not end
   1.470 -				   the message (-oi option) */
   1.471 -#define ACC_NO_RECVD_HDR   0x20 /* do not create a Received: header */
   1.472 -#define ACC_MAIL_FROM_HEAD 0x40 /* get return path from header */
   1.473 -#define ACC_NODOT_RELAX    0x80 /* do not be picky if message ist not terminated by a dot on a line */
   1.474 -#define ACC_SAVE_ENVELOPE_TO 0x0100 /* save an existent Envelope-to header as X-Orig-Envelope-to */
   1.475 +#define ACC_HEAD_FROM_RCPT 0x01  /* create To: Header from rcpt_list (cmd line) */
   1.476 +#define ACC_DEL_RCPTS      0x02  /* -t option, delete rcpts */
   1.477 +#define ACC_DEL_BCC        0x04  /* -t option, delete Bcc header */
   1.478 +#define ACC_RCPT_FROM_HEAD 0x08  /* -t option, get rcpts from headers */
   1.479 +#define ACC_NODOT_TERM     0x10  /* a dot on a line itself does not end the message (-oi option) */
   1.480 +#define ACC_NO_RECVD_HDR   0x20  /* do not create a Received: header */
   1.481 +#define ACC_MAIL_FROM_HEAD 0x40  /* get return path from header */
   1.482 +#define ACC_NODOT_RELAX    0x80  /* do not be picky if message ist not terminated by a dot on a line */
   1.483 +#define ACC_SAVE_ENVELOPE_TO 0x0100  /* save an existent Envelope-to header as X-Orig-Envelope-to */
   1.484  
   1.485  #define DLVR_LOCAL 0x01
   1.486  #define DLVR_LAN 0x02
   1.487 @@ -353,192 +328,171 @@
   1.488  #define MSGSTR_FROMLINE 0x01
   1.489  #define MSGSTR_FROMHACK 0x02
   1.490  
   1.491 -typedef
   1.492 -enum _accept_error
   1.493 -{
   1.494 -  AERR_OK = 0,
   1.495 -  AERR_TIMEOUT,
   1.496 -  AERR_EOF,
   1.497 -  AERR_OVERFLOW,
   1.498 -  AERR_SYNTAX,
   1.499 -  AERR_NOSPOOL,
   1.500 -  AERR_NORCPT,
   1.501 -  AERR_UNKNOWN
   1.502 -}accept_error;
   1.503 +typedef enum _accept_error {
   1.504 +	AERR_OK = 0,
   1.505 +	AERR_TIMEOUT,
   1.506 +	AERR_EOF,
   1.507 +	AERR_OVERFLOW,
   1.508 +	AERR_SYNTAX,
   1.509 +	AERR_NOSPOOL,
   1.510 +	AERR_NORCPT,
   1.511 +	AERR_UNKNOWN
   1.512 +} accept_error;
   1.513  
   1.514  #define BUF_LEN 1024
   1.515  #define MAX_ADDRESS 256
   1.516  #define MAX_DATALINE 4096
   1.517  
   1.518 -typedef
   1.519 -enum _smtp_cmd_id
   1.520 -{
   1.521 -  SMTP_HELO = 0,
   1.522 -  SMTP_EHLO,
   1.523 -  SMTP_MAIL_FROM,
   1.524 -  SMTP_RCPT_TO,
   1.525 -  SMTP_DATA,
   1.526 -  SMTP_QUIT,
   1.527 -  SMTP_RSET,
   1.528 -  SMTP_NOOP,
   1.529 -  SMTP_HELP,
   1.530 -  SMTP_NUM_IDS,
   1.531 -  SMTP_EOF = -1,
   1.532 -  SMTP_ERROR = -2,
   1.533 +typedef enum _smtp_cmd_id {
   1.534 +	SMTP_HELO = 0,
   1.535 +	SMTP_EHLO,
   1.536 +	SMTP_MAIL_FROM,
   1.537 +	SMTP_RCPT_TO,
   1.538 +	SMTP_DATA,
   1.539 +	SMTP_QUIT,
   1.540 +	SMTP_RSET,
   1.541 +	SMTP_NOOP,
   1.542 +	SMTP_HELP,
   1.543 +	SMTP_NUM_IDS,
   1.544 +	SMTP_EOF = -1,
   1.545 +	SMTP_ERROR = -2,
   1.546  } smtp_cmd_id;
   1.547  
   1.548 -typedef
   1.549 -struct _smtp_cmd
   1.550 -{
   1.551 -  smtp_cmd_id id;
   1.552 -  gchar *cmd;
   1.553 +typedef struct _smtp_cmd {
   1.554 +	smtp_cmd_id id;
   1.555 +	gchar *cmd;
   1.556  } smtp_cmd;
   1.557  
   1.558 -typedef
   1.559 -struct _smtp_connection
   1.560 -{
   1.561 -  gchar *remote_host;
   1.562 +typedef struct _smtp_connection {
   1.563 +	gchar *remote_host;
   1.564  
   1.565 -  prot_id prot;
   1.566 -  gint next_id;
   1.567 -  
   1.568 -  gboolean helo_seen;
   1.569 -  gboolean from_seen;
   1.570 -  gboolean rcpt_seen;
   1.571 +	prot_id prot;
   1.572 +	gint next_id;
   1.573  
   1.574 -  message *msg;
   1.575 -}smtp_connection;
   1.576 +	gboolean helo_seen;
   1.577 +	gboolean from_seen;
   1.578 +	gboolean rcpt_seen;
   1.579 +
   1.580 +	message *msg;
   1.581 +} smtp_connection;
   1.582  
   1.583  /* alias.c*/
   1.584 -gboolean addr_is_local(address *addr);
   1.585 -GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list);
   1.586 +gboolean addr_is_local(address * addr);
   1.587 +GList *alias_expand(GList * alias_table, GList * rcpt_list, GList * non_rcpt_list);
   1.588  
   1.589  /* child.c */
   1.590  int child(const char *command);
   1.591  
   1.592  /* conf.c */
   1.593  void init_conf();
   1.594 -gboolean read_conf(gchar *filename);
   1.595 -connect_route *read_route(gchar *filename, gboolean is_local_net);
   1.596 -GList *read_route_list(GList *rf_list, gboolean is_local_net);
   1.597 -void destroy_route(connect_route *r);
   1.598 -void destroy_route_list(GList *list);
   1.599 -get_conf *read_get_conf(gchar *filename);
   1.600 -void destroy_get_conf(get_conf *gc);
   1.601 +gboolean read_conf(gchar * filename);
   1.602 +connect_route *read_route(gchar * filename, gboolean is_local_net);
   1.603 +GList *read_route_list(GList * rf_list, gboolean is_local_net);
   1.604 +void destroy_route(connect_route * r);
   1.605 +void destroy_route_list(GList * list);
   1.606 +get_conf *read_get_conf(gchar * filename);
   1.607 +void destroy_get_conf(get_conf * gc);
   1.608  connect_route *create_local_route();
   1.609  
   1.610  /* expand.c */
   1.611 -GList *var_table_rcpt(GList *var_table, address *rcpt);
   1.612 -GList *var_table_msg(GList *var_table, message *msg);
   1.613 -GList *var_table_conf(GList *var_table);
   1.614 -gint expand(GList *var_list, gchar *format, gchar *result, gint result_len);
   1.615 +GList *var_table_rcpt(GList * var_table, address * rcpt);
   1.616 +GList *var_table_msg(GList * var_table, message * msg);
   1.617 +GList *var_table_conf(GList * var_table);
   1.618 +gint expand(GList * var_list, gchar * format, gchar * result, gint result_len);
   1.619  
   1.620  /* message.c */
   1.621  message *create_message(void);
   1.622 -void destroy_message(message *msg);
   1.623 -void destroy_msg_list(GList *msg_list);
   1.624 -void msg_free_data(message *msg);
   1.625 -gint msg_calc_size(message *msg, gboolean is_smtp);
   1.626 +void destroy_message(message * msg);
   1.627 +void destroy_msg_list(GList * msg_list);
   1.628 +void msg_free_data(message * msg);
   1.629 +gint msg_calc_size(message * msg, gboolean is_smtp);
   1.630  
   1.631 -msg_out *create_msg_out(message *msg);
   1.632 -msg_out *clone_msg_out(msg_out *msgout_orig);
   1.633 -GList *create_msg_out_list(GList *msg_list);
   1.634 -void destroy_msg_out(msg_out *msgout);
   1.635 -void destroy_msg_out_list(GList *msgout_list);
   1.636 +msg_out *create_msg_out(message * msg);
   1.637 +msg_out *clone_msg_out(msg_out * msgout_orig);
   1.638 +GList *create_msg_out_list(GList * msg_list);
   1.639 +void destroy_msg_out(msg_out * msgout);
   1.640 +void destroy_msg_out_list(GList * msgout_list);
   1.641  
   1.642  /* address.c */
   1.643 -address *create_address(gchar *path, gboolean is_rfc821);
   1.644 -address *create_address_qualified(gchar *path, gboolean is_rfc821,
   1.645 -				  gchar *domain);
   1.646 -address *create_address_pipe(gchar *path);
   1.647 -void destroy_address(address *addr);
   1.648 -address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom);
   1.649 +address *create_address(gchar * path, gboolean is_rfc821);
   1.650 +address *create_address_qualified(gchar * path, gboolean is_rfc821, gchar * domain);
   1.651 +address *create_address_pipe(gchar * path);
   1.652 +void destroy_address(address * addr);
   1.653 +address *copy_modify_address(const address * orig, gchar * l_part, gchar * dom);
   1.654  #define copy_address(addr) copy_modify_address(addr, NULL, NULL)
   1.655 -gboolean addr_isequal(address *addr1, address *addr2);
   1.656 -gboolean addr_isequal_parent(address *addr1, address *addr2);
   1.657 -address *addr_find_ancestor(address *addr);
   1.658 -gboolean addr_is_delivered_children(address *addr);
   1.659 -gboolean addr_is_finished_children(address *addr);
   1.660 -gchar *addr_string(address *addr);
   1.661 -gint addr_match(address *addr1, address *addr2);
   1.662 +gboolean addr_isequal(address * addr1, address * addr2);
   1.663 +gboolean addr_isequal_parent(address * addr1, address * addr2);
   1.664 +address *addr_find_ancestor(address * addr);
   1.665 +gboolean addr_is_delivered_children(address * addr);
   1.666 +gboolean addr_is_finished_children(address * addr);
   1.667 +gchar *addr_string(address * addr);
   1.668 +gint addr_match(address * addr1, address * addr2);
   1.669  
   1.670  /* accept.c */
   1.671 -accept_error accept_message(FILE *in, message *msg,
   1.672 -			    guint flags);
   1.673 -accept_error accept_message_prepare(message *msg, guint flags);
   1.674 +accept_error accept_message(FILE * in, message * msg, guint flags);
   1.675 +accept_error accept_message_prepare(message * msg, guint flags);
   1.676  
   1.677  /* header.c */
   1.678  gchar *rec_timestamp();
   1.679 -GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str);
   1.680 -void header_unfold(header *hdr);
   1.681 -void header_fold(header *hdr);
   1.682 -header *create_header(header_id id, gchar *fmt, ...);
   1.683 -void destroy_header(header *hdr);
   1.684 -header *copy_header(header *hdr);
   1.685 -header *get_header(gchar *line);
   1.686 +GList *find_header(GList * hdr_list, header_id id, gchar * hdr_str);
   1.687 +void header_unfold(header * hdr);
   1.688 +void header_fold(header * hdr);
   1.689 +header *create_header(header_id id, gchar * fmt, ...);
   1.690 +void destroy_header(header * hdr);
   1.691 +header *copy_header(header * hdr);
   1.692 +header *get_header(gchar * line);
   1.693  
   1.694  /* smtp_in.c */
   1.695 -void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident);
   1.696 +void smtp_in(FILE * in, FILE * out, gchar * remote_host, gchar * ident);
   1.697  
   1.698  /* listen.c */
   1.699 -void listen_port(GList *addr_list, gint qival, char *argv[]);
   1.700 +void listen_port(GList * addr_list, gint qival, char *argv[]);
   1.701  
   1.702  /* parse.c */
   1.703 -gboolean split_address(const gchar *path, gchar **local_part, gchar **domain,
   1.704 -		       gboolean is_rfc821);
   1.705 -gboolean parse_address_rfc822(gchar *string,
   1.706 -		       gchar **local_begin, gchar **local_end,
   1.707 -		       gchar **domain_begin, gchar **domain_end,
   1.708 -			      gchar **address_end);
   1.709 -gboolean parse_address_rfc821(gchar *string,
   1.710 -			      gchar **local_begin, gchar **local_end,
   1.711 -			      gchar **domain_begin, gchar **domain_end,
   1.712 -			      gchar **address_end);
   1.713 -address *_create_address(gchar *string, gchar **end, gboolean is_rfc821);
   1.714 -address *create_address_rfc821(gchar *string, gchar **end);
   1.715 -address *create_address_rfc822(gchar *string, gchar **end);
   1.716 -GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain);
   1.717 -gboolean addr_isequal(address *addr1, address *addr2);
   1.718 +gboolean split_address(const gchar * path, gchar ** local_part, gchar ** domain, gboolean is_rfc821);
   1.719 +gboolean parse_address_rfc822(gchar * string, gchar ** local_begin, gchar ** local_end, gchar ** domain_begin, gchar ** domain_end, gchar ** address_end);
   1.720 +gboolean parse_address_rfc821(gchar * string, gchar ** local_begin, gchar ** local_end, gchar ** domain_begin, gchar ** domain_end, gchar ** address_end);
   1.721 +address *_create_address(gchar * string, gchar ** end, gboolean is_rfc821);
   1.722 +address *create_address_rfc821(gchar * string, gchar ** end);
   1.723 +address *create_address_rfc822(gchar * string, gchar ** end);
   1.724 +GList *addr_list_append_rfc822(GList * addr_list, gchar * string, gchar * domain);
   1.725 +gboolean addr_isequal(address * addr1, address * addr2);
   1.726  
   1.727  /* connect.c */
   1.728 -mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port,
   1.729 -			  GList *addr_list);
   1.730 -mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port,
   1.731 -			     GList *res_funcs);
   1.732 +mxip_addr *connect_hostlist(int *psockfd, gchar * host, guint port, GList * addr_list);
   1.733 +mxip_addr *connect_resolvelist(int *psockfd, gchar * host, guint port, GList * res_funcs);
   1.734  
   1.735  /* deliver.c */
   1.736 -void msg_rcptlist_local(GList *rcpt_list, GList **, GList **);
   1.737 -gboolean deliver_local(msg_out *msgout);
   1.738 -gboolean deliver_msglist_host(connect_route *route, GList *msg_list, gchar *host, GList *res_list);
   1.739 -gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list);
   1.740 -gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list);
   1.741 -gboolean deliver_finish(msg_out *msgout);
   1.742 -gboolean deliver_finish_list(GList *msgout_list);
   1.743 -gboolean deliver_msg_list(GList *msg_list, guint flags);
   1.744 -gboolean deliver(message *msg);
   1.745 +void msg_rcptlist_local(GList * rcpt_list, GList **, GList **);
   1.746 +gboolean deliver_local(msg_out * msgout);
   1.747 +gboolean deliver_msglist_host(connect_route * route, GList * msg_list, gchar * host, GList * res_list);
   1.748 +gboolean deliver_route_msgout_list(connect_route * route, GList * msgout_list);
   1.749 +gboolean deliver_route_msg_list(connect_route * route, GList * msgout_list);
   1.750 +gboolean deliver_finish(msg_out * msgout);
   1.751 +gboolean deliver_finish_list(GList * msgout_list);
   1.752 +gboolean deliver_msg_list(GList * msg_list, guint flags);
   1.753 +gboolean deliver(message * msg);
   1.754  
   1.755  /* fail_msg.c */
   1.756 -gboolean fail_msg(message *msg, gchar *template,
   1.757 -		  GList *failed_rcpts, gchar *err_fmt, va_list args);
   1.758 -gboolean warn_msg(message *msg, gchar *template,
   1.759 -		  GList *failed_rcpts, gchar *err_fmt, va_list args);
   1.760 +gboolean fail_msg(message * msg, gchar * template, GList * failed_rcpts, gchar * err_fmt, va_list args);
   1.761 +gboolean warn_msg(message * msg, gchar * template, GList * failed_rcpts, gchar * err_fmt, va_list args);
   1.762  
   1.763  /* get.c */
   1.764 -gboolean get_from_file(gchar *fname);
   1.765 -gboolean get_from_name(gchar *name);
   1.766 +gboolean get_from_file(gchar * fname);
   1.767 +gboolean get_from_name(gchar * name);
   1.768  gboolean get_all(void);
   1.769  void get_online(void);
   1.770  void get_daemon(gint gival, char *argv[]);
   1.771 -gboolean pop_before_smtp(gchar *fname);
   1.772 +gboolean pop_before_smtp(gchar * fname);
   1.773  
   1.774  /* interface.c */
   1.775 -gboolean init_sockaddr(struct sockaddr_in *name, interface *iface);
   1.776 -int make_server_socket(interface *iface);
   1.777 +gboolean init_sockaddr(struct sockaddr_in *name, interface * iface);
   1.778 +int make_server_socket(interface * iface);
   1.779  
   1.780  /* local.c */
   1.781 -gboolean append_file(message *msg, GList *hdr_list, gchar *user);
   1.782 -gboolean maildir_out(message *msg, GList *hdr_list, gchar *user, guint flags);
   1.783 -gboolean pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags);
   1.784 +gboolean append_file(message * msg, GList * hdr_list, gchar * user);
   1.785 +gboolean maildir_out(message * msg, GList * hdr_list, gchar * user, guint flags);
   1.786 +gboolean pipe_out(message * msg, GList * hdr_list, address * rcpt, gchar * cmd, guint flags);
   1.787  
   1.788  /* log.c */
   1.789  gchar *ext_strerror(int err);
   1.790 @@ -551,63 +505,60 @@
   1.791  void maillog(const char *fmt, ...);
   1.792  
   1.793  /* spool.c */
   1.794 -gboolean spool_read_data(message *msg);
   1.795 -gboolean spool_read_data(message *msg);
   1.796 -message *msg_spool_read(gchar *uid, gboolean do_readdata);
   1.797 -gboolean spool_write(message *msg, gboolean do_writedata);
   1.798 -gboolean spool_lock(gchar *uid);
   1.799 -gboolean spool_unlock(gchar *uid);
   1.800 -gboolean spool_delete_all(message *msg);
   1.801 +gboolean spool_read_data(message * msg);
   1.802 +gboolean spool_read_data(message * msg);
   1.803 +message *msg_spool_read(gchar * uid, gboolean do_readdata);
   1.804 +gboolean spool_write(message * msg, gboolean do_writedata);
   1.805 +gboolean spool_lock(gchar * uid);
   1.806 +gboolean spool_unlock(gchar * uid);
   1.807 +gboolean spool_delete_all(message * msg);
   1.808  
   1.809  /* queue.c */
   1.810  GList *read_queue(gboolean do_readdata);
   1.811  gboolean queue_run(void);
   1.812  gboolean queue_run_online(void);
   1.813  void queue_list(void);
   1.814 -gboolean queue_delete(gchar *uid);
   1.815 +gboolean queue_delete(gchar * uid);
   1.816  
   1.817  /* online.c */
   1.818  gchar *detect_online();
   1.819 -void set_online_name(gchar *name);
   1.820 +void set_online_name(gchar * name);
   1.821  
   1.822  /* permissions.c */
   1.823  gboolean is_ingroup(uid_t uid, gid_t gid);
   1.824 -void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid);
   1.825 -void set_identity(uid_t old_uid, gchar *task_name);
   1.826 +void set_euidgid(gint uid, gint gid, uid_t * old_uid, gid_t * old_gid);
   1.827 +void set_identity(uid_t old_uid, gchar * task_name);
   1.828  
   1.829  /* rewrite.c */
   1.830 -gboolean set_address_header_domain(header *hdr, gchar *domain);
   1.831 -gboolean map_address_header(header *hdr, GList *table);
   1.832 +gboolean set_address_header_domain(header * hdr, gchar * domain);
   1.833 +gboolean map_address_header(header * hdr, GList * table);
   1.834  
   1.835  /* route.c */
   1.836 -msgout_perhost *create_msgout_perhost(gchar *host);
   1.837 -void destroy_msgout_perhost(msgout_perhost *mo_ph);
   1.838 -void rewrite_headers(msg_out *msgout, connect_route *route);
   1.839 -void rcptlist_with_one_of_hostlist(GList *rcpt_list, GList *host_list,
   1.840 -				     GList **, GList **);
   1.841 -void rcptlist_with_addr_is_local(GList *rcpt_list,
   1.842 -				   GList **p_rcpt_list, GList **p_non_rcpt_list);
   1.843 -gboolean route_strip_msgout(connect_route *route, msg_out *msgout);
   1.844 -msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout);
   1.845 -GList *route_msgout_list(connect_route *route, GList *msgout_list);
   1.846 -gboolean route_is_allowed_return_path(connect_route *route, address *ret_path);
   1.847 -gboolean route_is_allowed_mail_local(connect_route *route, address *ret_path);
   1.848 -void msg_rcptlist_route(connect_route *route, GList *rcpt_list,
   1.849 -			GList **p_rcpt_list, GList **p_non_rcpt_list);
   1.850 +msgout_perhost *create_msgout_perhost(gchar * host);
   1.851 +void destroy_msgout_perhost(msgout_perhost * mo_ph);
   1.852 +void rewrite_headers(msg_out * msgout, connect_route * route);
   1.853 +void rcptlist_with_one_of_hostlist(GList * rcpt_list, GList * host_list, GList **, GList **);
   1.854 +void rcptlist_with_addr_is_local(GList * rcpt_list, GList ** p_rcpt_list, GList ** p_non_rcpt_list);
   1.855 +gboolean route_strip_msgout(connect_route * route, msg_out * msgout);
   1.856 +msg_out *route_prepare_msgout(connect_route * route, msg_out * msgout);
   1.857 +GList *route_msgout_list(connect_route * route, GList * msgout_list);
   1.858 +gboolean route_is_allowed_return_path(connect_route * route, address * ret_path);
   1.859 +gboolean route_is_allowed_mail_local(connect_route * route, address * ret_path);
   1.860 +void msg_rcptlist_route(connect_route * route, GList * rcpt_list, GList ** p_rcpt_list, GList ** p_non_rcpt_list);
   1.861  
   1.862  /* tables.c */
   1.863 -table_pair *create_pair(gchar *key, gpointer value);
   1.864 -table_pair *create_pair_string(gchar *key, gpointer value);
   1.865 -table_pair *parse_table_pair(gchar *line, char delim);
   1.866 -gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func)(const char *, const char *));
   1.867 -gpointer *table_find(GList *table_list, gchar *key);
   1.868 -gpointer *table_find_case(GList *table_list, gchar *key);
   1.869 -gpointer *table_find_fnmatch(GList *table_list, gchar *key);
   1.870 -GList *table_read(gchar *fname, gchar delim);
   1.871 -void destroy_table(GList *table);
   1.872 +table_pair *create_pair(gchar * key, gpointer value);
   1.873 +table_pair *create_pair_string(gchar * key, gpointer value);
   1.874 +table_pair *parse_table_pair(gchar * line, char delim);
   1.875 +gpointer *table_find_func(GList * table_list, gchar * key, int (*cmp_func) (const char *, const char *));
   1.876 +gpointer *table_find(GList * table_list, gchar * key);
   1.877 +gpointer *table_find_case(GList * table_list, gchar * key);
   1.878 +gpointer *table_find_fnmatch(GList * table_list, gchar * key);
   1.879 +GList *table_read(gchar * fname, gchar delim);
   1.880 +void destroy_table(GList * table);
   1.881  
   1.882  /* timeival.c */
   1.883 -gint time_interval(gchar *str, gint *pos);
   1.884 +gint time_interval(gchar * str, gint * pos);
   1.885  
   1.886  /* permissions.c */
   1.887  gboolean is_privileged_user(uid_t uid);