masqmail

diff src/accept.c @ 106:1f0d63713a1c

masqmail now *always* removes Bcc: headers this is the most simple way and taken by other MTAs (courier, postfix) too
author meillo@marmaro.de
date Tue, 29 Jun 2010 10:37:18 +0200
parents 47ee3fbcecd2
children db52c64acaa2
line diff
     1.1 --- a/src/accept.c	Tue Jun 29 10:20:09 2010 +0200
     1.2 +++ b/src/accept.c	Tue Jun 29 10:37:18 2010 +0200
     1.3 @@ -214,7 +214,6 @@
     1.4  		gboolean has_date = FALSE;
     1.5  		gboolean has_sender = FALSE;
     1.6  		gboolean has_from = FALSE;
     1.7 -		gboolean has_rcpt = FALSE;
     1.8  		gboolean has_to_or_cc = FALSE;
     1.9  		GList *hdr_node, *hdr_node_next;
    1.10  		header *hdr;
    1.11 @@ -239,21 +238,21 @@
    1.12  				break;
    1.13  			case HEAD_TO:
    1.14  			case HEAD_CC:
    1.15 +				has_to_or_cc = TRUE;
    1.16 +				/* fall through */
    1.17  			case HEAD_BCC:
    1.18 -				has_rcpt = TRUE;
    1.19  				if (flags & ACC_RCPT_FROM_HEAD) {
    1.20  					DEBUG(5) debugf("hdr->value = %s\n", hdr->value);
    1.21  					if (hdr->value) {
    1.22  						msg->rcpt_list = addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name);
    1.23  					}
    1.24  				}
    1.25 -				if ((flags & ACC_DEL_BCC) && (hdr->id == HEAD_BCC)) {
    1.26 +				if (hdr->id == HEAD_BCC) {
    1.27  					DEBUG(3) debugf("removing 'Bcc' header\n");
    1.28  					msg->hdr_list = g_list_remove_link(msg->hdr_list, hdr_node);
    1.29  					g_list_free_1(hdr_node);
    1.30  					destroy_header(hdr);
    1.31 -				} else
    1.32 -					has_to_or_cc = TRUE;
    1.33 +				}
    1.34  				break;
    1.35  			case HEAD_ENVELOPE_TO:
    1.36  				if (flags & ACC_SAVE_ENVELOPE_TO) {
    1.37 @@ -349,15 +348,10 @@
    1.38  			                                msg->return_path->local_part, msg->return_path->domain)
    1.39  			                );
    1.40  		}
    1.41 -		if ((flags & ACC_HEAD_FROM_RCPT) && !has_rcpt) {
    1.42 -			DEBUG(3) debugf("no To: or Cc: header, hence adding `undisclosed recipients' header\n");
    1.43 +		if (!has_to_or_cc) {
    1.44 +			DEBUG(3) debugf("no To: or Cc: header, hence adding `To: undisclosed recipients:;'\n");
    1.45  			msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_TO, "To: undisclosed-recipients:;\n"));
    1.46  		}
    1.47 -		if ((flags & ACC_DEL_BCC) && !has_to_or_cc) {
    1.48 -			/* Bcc headers have been removed, and there are no remaining rcpt headers */
    1.49 -			DEBUG(3) debugf("adding empty 'Bcc:' header\n");
    1.50 -			msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_BCC, "Bcc:\n"));
    1.51 -		}
    1.52  		if (!has_date) {
    1.53  			DEBUG(3) debugf("adding 'Date:' header\n");
    1.54  			msg->hdr_list = g_list_append(msg->hdr_list, create_header(HEAD_DATE, "Date: %s\n", rec_timestamp()));