comparison src/accept.c @ 109:db52c64acaa2

improved comments related to -t option
author meillo@marmaro.de
date Tue, 29 Jun 2010 11:34:53 +0200
parents 1f0d63713a1c
children c678d0342451
comparison
equal deleted inserted replaced
108:46f407c0727a 109:db52c64acaa2
56 } 56 }
57 57
58 /* accept message from anywhere. 58 /* accept message from anywhere.
59 A locally originating message is indicated by msg->recieved_host == NULL 59 A locally originating message is indicated by msg->recieved_host == NULL
60 60
61 If the flags ACC_DEL_RCPTS is set, recipients in the msg->rcpt_list is 61 The -t option:
62 copied and items occuring in it will be removed from the newly constructed 62 The ACC_RCPT_FROM_HEAD flag adds the recipients found in To/Cc/Bcc
63 (from To/Cc/Bcc headers if ACC_RCPT_TO is set) rcpt_list. 63 headers to the recipients list.
64 The ACC_DEL_RCPTS flag makes only sense if the ACC_RCPT_FROM_HEAD
65 flag is given too. With ACC_DEL_RCPTS the recipients given on the
66 command line are removed from the ones given in headers.
64 */ 67 */
65 68
66 accept_error 69 accept_error
67 accept_message_stream(FILE * in, message * msg, guint flags) 70 accept_message_stream(FILE * in, message * msg, guint flags)
68 { 71 {
200 DEBUG(3) debugf("setting return_path for local accept: %s\n", path); 203 DEBUG(3) debugf("setting return_path for local accept: %s\n", path);
201 msg->return_path = create_address(path, TRUE); 204 msg->return_path = create_address(path, TRUE);
202 g_free(path); 205 g_free(path);
203 } 206 }
204 207
205 /* -t option */ 208 /* -t option (see comment above) */
206 if (flags & ACC_DEL_RCPTS) { 209 if (flags & ACC_DEL_RCPTS) {
207 non_rcpt_list = msg->rcpt_list; 210 non_rcpt_list = msg->rcpt_list;
208 msg->rcpt_list = NULL; 211 msg->rcpt_list = NULL;
209 } 212 }
210 213
240 case HEAD_CC: 243 case HEAD_CC:
241 has_to_or_cc = TRUE; 244 has_to_or_cc = TRUE;
242 /* fall through */ 245 /* fall through */
243 case HEAD_BCC: 246 case HEAD_BCC:
244 if (flags & ACC_RCPT_FROM_HEAD) { 247 if (flags & ACC_RCPT_FROM_HEAD) {
248 /* -t option (see comment above) */
245 DEBUG(5) debugf("hdr->value = %s\n", hdr->value); 249 DEBUG(5) debugf("hdr->value = %s\n", hdr->value);
246 if (hdr->value) { 250 if (hdr->value) {
247 msg->rcpt_list = addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name); 251 msg->rcpt_list = addr_list_append_rfc822(msg->rcpt_list, hdr->value, conf.host_name);
248 } 252 }
249 } 253 }
315 "X-Warning: real return path is unknown\n")); 319 "X-Warning: real return path is unknown\n"));
316 } 320 }
317 } 321 }
318 322
319 if (flags & ACC_DEL_RCPTS) { 323 if (flags & ACC_DEL_RCPTS) {
324 /* remove the recipients given on the command line from the ones given in headers
325 -t option (see comment above) */
320 GList *rcpt_node; 326 GList *rcpt_node;
321 foreach(non_rcpt_list, rcpt_node) { 327 foreach(non_rcpt_list, rcpt_node) {
322 address *rcpt = (address *) (rcpt_node->data); 328 address *rcpt = (address *) (rcpt_node->data);
323 GList *node; 329 GList *node;
324 if ((node = g_list_find_custom(msg->rcpt_list, rcpt, _g_list_addr_isequal))) { 330 if ((node = g_list_find_custom(msg->rcpt_list, rcpt, _g_list_addr_isequal))) {