masqmail

changeset 109:db52c64acaa2

improved comments related to -t option
author meillo@marmaro.de
date Tue, 29 Jun 2010 11:34:53 +0200
parents 46f407c0727a
children c678d0342451
files src/accept.c src/masqmail.h
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/src/accept.c	Tue Jun 29 11:00:33 2010 +0200
     1.2 +++ b/src/accept.c	Tue Jun 29 11:34:53 2010 +0200
     1.3 @@ -58,9 +58,12 @@
     1.4  /* accept message from anywhere.
     1.5     A locally originating message is indicated by msg->recieved_host == NULL
     1.6  
     1.7 -   If the flags ACC_DEL_RCPTS is set, recipients in the msg->rcpt_list is
     1.8 -   copied and items occuring in it will be removed from the newly constructed
     1.9 -   (from To/Cc/Bcc headers if ACC_RCPT_TO is set) rcpt_list.
    1.10 +   The -t option:
    1.11 +   The ACC_RCPT_FROM_HEAD flag adds the recipients found in To/Cc/Bcc
    1.12 +   headers to the recipients list.
    1.13 +   The ACC_DEL_RCPTS flag makes only sense if the ACC_RCPT_FROM_HEAD
    1.14 +   flag is given too. With ACC_DEL_RCPTS the recipients given on the
    1.15 +   command line are removed from the ones given in headers.
    1.16  */
    1.17  
    1.18  accept_error
    1.19 @@ -202,7 +205,7 @@
    1.20  		g_free(path);
    1.21  	}
    1.22  
    1.23 -	/* -t option */
    1.24 +	/* -t option (see comment above) */
    1.25  	if (flags & ACC_DEL_RCPTS) {
    1.26  		non_rcpt_list = msg->rcpt_list;
    1.27  		msg->rcpt_list = NULL;
    1.28 @@ -242,6 +245,7 @@
    1.29  				/* fall through */
    1.30  			case HEAD_BCC:
    1.31  				if (flags & ACC_RCPT_FROM_HEAD) {
    1.32 +					/* -t option (see comment above) */
    1.33  					DEBUG(5) debugf("hdr->value = %s\n", hdr->value);
    1.34  					if (hdr->value) {
    1.35  						msg->rcpt_list = addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name);
    1.36 @@ -317,6 +321,8 @@
    1.37  		}
    1.38  
    1.39  		if (flags & ACC_DEL_RCPTS) {
    1.40 +			/* remove the recipients given on the command line from the ones given in headers
    1.41 +			   -t option (see comment above) */
    1.42  			GList *rcpt_node;
    1.43  			foreach(non_rcpt_list, rcpt_node) {
    1.44  				address *rcpt = (address *) (rcpt_node->data);
     2.1 --- a/src/masqmail.h	Tue Jun 29 11:00:33 2010 +0200
     2.2 +++ b/src/masqmail.h	Tue Jun 29 11:34:53 2010 +0200
     2.3 @@ -308,8 +308,7 @@
     2.4  } msgout_perhost;
     2.5  
     2.6  /* flags for accept() */
     2.7 -/*#define ACC_LOCAL      0x01 (we better use received_host == NULL) */
     2.8 -#define ACC_DEL_RCPTS      0x02  /* -t option, delete rcpts */
     2.9 +#define ACC_DEL_RCPTS      0x02  /* -t option, delete rcpts that were given as cmd args */
    2.10  #define ACC_RCPT_FROM_HEAD 0x08  /* -t option, get rcpts from headers */
    2.11  #define ACC_NODOT_TERM     0x10  /* a dot on a line itself does not end the message (-oi option) */
    2.12  #define ACC_MAIL_FROM_HEAD 0x40  /* get return path from header */