comparison src/accept.c @ 102:f4719cffc48c

removed the ACC_NO_RECVD_HDR because it is never set I do not see a reason why we should need it
author meillo@marmaro.de
date Wed, 23 Jun 2010 13:54:28 +0200
parents d04fbd5ce16e
children 47ee3fbcecd2
comparison
equal deleted inserted replaced
101:82416aaacd31 102:f4719cffc48c
373 } 373 }
374 } 374 }
375 375
376 /* Received header: */ 376 /* Received header: */
377 /* At this point because we have to know the rcpts for the 'for' part */ 377 /* At this point because we have to know the rcpts for the 'for' part */
378 if (!(flags & ACC_NO_RECVD_HDR)) { 378 gchar *for_string = NULL;
379 gchar *for_string = NULL; 379 header *hdr = NULL;
380 header *hdr = NULL; 380
381 381 DEBUG(3) debugf("adding 'Received:' header\n");
382 DEBUG(3) debugf("adding 'Received:' header\n"); 382
383 383 if (g_list_length(msg->rcpt_list) == 1) {
384 if (g_list_length(msg->rcpt_list) == 1) { 384 address *addr = (address *) (g_list_first(msg->rcpt_list)->data);
385 address *addr = (address *) (g_list_first(msg->rcpt_list)->data); 385 for_string = g_strdup_printf(" for %s", addr_string(addr));
386 for_string = g_strdup_printf(" for %s", addr_string(addr)); 386 }
387 } 387
388 388 if (msg->received_host == NULL) {
389 if (msg->received_host == NULL) { 389 /* received locally */
390 hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n", 390 hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
391 passwd->pw_name, conf.host_name, prot_names[msg->received_prot], 391 passwd->pw_name, conf.host_name, prot_names[msg->received_prot],
392 PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp()); 392 PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp());
393 } else { 393 } else {
394 /* received from remote */
394 #ifdef ENABLE_IDENT 395 #ifdef ENABLE_IDENT
395 DEBUG(5) debugf("adding 'Received:' header (5)\n"); 396 DEBUG(5) debugf("adding 'Received:' header (5)\n");
396 hdr = create_header(HEAD_RECEIVED, "Received: from %s (ident=%s) by %s with %s (%s %s) id %s%s; %s\n", 397 hdr = create_header(HEAD_RECEIVED, "Received: from %s (ident=%s) by %s with %s (%s %s) id %s%s; %s\n",
397 msg->received_host, msg->ident ? msg->ident : "unknown", conf.host_name, 398 msg->received_host, msg->ident ? msg->ident : "unknown", conf.host_name,
398 prot_names[msg->received_prot], PACKAGE, VERSION, msg->uid, for_string ? for_string : "", 399 prot_names[msg->received_prot], PACKAGE, VERSION, msg->uid, for_string ? for_string : "",
399 rec_timestamp()); 400 rec_timestamp());
400 #else 401 #else
401 hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n", 402 hdr = create_header(HEAD_RECEIVED, "Received: from %s by %s with %s (%s %s) id %s%s; %s\n",
402 msg->received_host, conf.host_name, prot_names[msg->received_prot], 403 msg->received_host, conf.host_name, prot_names[msg->received_prot],
403 PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp()); 404 PACKAGE, VERSION, msg->uid, for_string ? for_string : "", rec_timestamp());
404 #endif 405 #endif
405 } 406 }
406 header_fold(hdr); 407 header_fold(hdr);
407 msg->hdr_list = g_list_prepend(msg->hdr_list, hdr); 408 msg->hdr_list = g_list_prepend(msg->hdr_list, hdr);
408 409
409 if (for_string) 410 if (for_string)
410 g_free(for_string); 411 g_free(for_string);
411 }
412 412
413 /* write message to spool: */ 413 /* write message to spool: */
414 /* accept is no longer responsible for this 414 /* accept is no longer responsible for this
415 if (!spool_write(msg, TRUE)) 415 if (!spool_write(msg, TRUE))
416 return AERR_NOSPOOL; 416 return AERR_NOSPOOL;