masqmail

changeset 264:1e5e457dea18

comments and a small refactoring
author markus schnalke <meillo@marmaro.de>
date Fri, 03 Dec 2010 10:43:38 -0300
parents e9e73505ab2c
children 409552c5647f
files src/masqmail.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/src/masqmail.c	Thu Dec 02 17:13:03 2010 -0300
     1.2 +++ b/src/masqmail.c	Fri Dec 03 10:43:38 2010 -0300
     1.3 @@ -129,6 +129,7 @@
     1.4  	return FALSE;
     1.5  }
     1.6  
     1.7 +/* on -bd or if -q has an argument */
     1.8  static void
     1.9  mode_daemon(gboolean do_listen, gint queue_interval, char *argv[])
    1.10  {
    1.11 @@ -171,6 +172,7 @@
    1.12  	listen_port(do_listen ? conf.listen_addresses : NULL, queue_interval, argv);
    1.13  }
    1.14  
    1.15 +/* -bs or called as smtpd or in.smtpd */
    1.16  static void
    1.17  mode_smtp()
    1.18  {
    1.19 @@ -198,6 +200,7 @@
    1.20  	smtp_in(stdin, stderr, peername, NULL);
    1.21  }
    1.22  
    1.23 +/* default mode if address args or -t is specified, or called as rmail */
    1.24  static void
    1.25  mode_accept(address * return_path, gchar * full_sender_name, guint accept_flags, char **addresses, int addr_cnt)
    1.26  {
    1.27 @@ -220,12 +223,11 @@
    1.28  
    1.29  	msg->received_prot = PROT_LOCAL;
    1.30  	for (i = 0; i < addr_cnt; i++) {
    1.31 -		if (addresses[i][0] != '|')
    1.32 -			msg->rcpt_list = g_list_append(msg->rcpt_list, create_address_qualified(addresses[i], TRUE, conf.host_name));
    1.33 -		else {
    1.34 +		if (addresses[i][0] == '|')
    1.35  			logwrite(LOG_ALERT, "no pipe allowed as recipient address: %s\n", addresses[i]);
    1.36  			exit(1);
    1.37  		}
    1.38 +		msg->rcpt_list = g_list_append(msg->rcpt_list, create_address_qualified(addresses[i], TRUE, conf.host_name));
    1.39  	}
    1.40  
    1.41  	/* -f option */
    1.42 @@ -278,6 +280,8 @@
    1.43  }
    1.44  
    1.45  /*
    1.46 +if -Mrm is given
    1.47 +
    1.48  currently only the `rm' command is supported
    1.49  until this changes, we don't need any facility for further commands
    1.50  return success if at least one message had been deleted
    1.51 @@ -341,6 +345,9 @@
    1.52  	return ok;
    1.53  }
    1.54  
    1.55 +/* -qo, -q (without argument), or called as runq */
    1.56 +/* TODO: are -qo and -q exclusively or not?
    1.57 +         And how is this related to being a daemon? */
    1.58  static int
    1.59  run_queue(gboolean do_runq, gboolean do_runq_online, char* route_name)
    1.60  {
    1.61 @@ -363,6 +370,7 @@
    1.62  	return ret;
    1.63  }
    1.64  
    1.65 +/* -bV or default mode if neither addr arg nor -t */
    1.66  static void
    1.67  mode_version(void)
    1.68  {