X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Freceive.c;h=73675bee209f44a37f7fc045a3f8788737200013;hb=48c7f9e2e3b50cd5548447de62c77c7ddfe21519;hp=e11c96df1134ce7a942a026ba2eff5ae0867d22f;hpb=2cbb4081528ed0f71b474f88cf36a55fb0717863;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/receive.c b/src/src/receive.c index e11c96df1..73675bee2 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/receive.c,v 1.26 2006/02/14 15:11:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/receive.c,v 1.30 2006/10/10 15:36:50 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -899,10 +899,10 @@ add_acl_headers(uschar *acl_name) header_line *h, *next; header_line *last_received = NULL; -if (acl_warn_headers == NULL) return; +if (acl_added_headers == NULL) return; DEBUG(D_receive|D_acl) debug_printf(">>Headers added by %s ACL:\n", acl_name); -for (h = acl_warn_headers; h != NULL; h = next) +for (h = acl_added_headers; h != NULL; h = next) { next = h->next; @@ -964,7 +964,7 @@ for (h = acl_warn_headers; h != NULL; h = next) DEBUG(D_receive|D_acl) debug_printf(" %s", header_last->text); } -acl_warn_headers = NULL; +acl_added_headers = NULL; DEBUG(D_receive|D_acl) debug_printf(">>\n"); } @@ -1067,7 +1067,7 @@ if (mbox_file == NULL) { "acl_smtp_mime: error while creating mbox spool file, message temporarily rejected."); Uunlink(spool_name); unspool_mbox(); - smtp_respond(451, TRUE, US"temporary local problem"); + smtp_respond(US"451", 3, TRUE, US"temporary local problem"); message_id[0] = 0; /* Indicate no message accepted */ *smtp_reply_ptr = US""; /* Indicate reply already sent */ return FALSE; /* Indicate skip to end of receive function */ @@ -2051,8 +2051,6 @@ if (extract_recip) recipients_count = recipients_list_max = 0; } - parse_allow_group = TRUE; /* Allow address group syntax */ - /* Now scan the headers */ for (h = header_list->next; h != NULL; h = h->next) @@ -2063,6 +2061,8 @@ if (extract_recip) uschar *s = Ustrchr(h->text, ':') + 1; while (isspace(*s)) s++; + parse_allow_group = TRUE; /* Allow address group syntax */ + while (*s != 0) { uschar *ss = parse_find_address_end(s, FALSE); @@ -2127,7 +2127,10 @@ if (extract_recip) s = ss + (*ss? 1:0); while (isspace(*s)) s++; - } + } /* Next address */ + + parse_allow_group = FALSE; /* Reset group syntax flags */ + parse_found_group = FALSE; /* If this was the bcc: header, mark it "old", which means it will be kept on the spool, but not transmitted as part of the @@ -2137,8 +2140,6 @@ if (extract_recip) } /* For appropriate header line */ } /* For each header line */ - parse_allow_group = FALSE; /* Reset group syntax flags */ - parse_found_group = FALSE; } /* Now build the unique message id. This has changed several times over the @@ -2985,8 +2986,13 @@ else #ifdef WITH_CONTENT_SCAN unspool_mbox(); #endif - log_write(0, LOG_MAIN|LOG_REJECT, "F=<%s> rejected by non-SMTP ACL: %s", - sender_address, log_msg); + /* The ACL can specify where rejections are to be logged, possibly + nowhere. The default is main and reject logs. */ + + if (log_reject_target != 0) + log_write(0, log_reject_target, "F=<%s> rejected by non-SMTP ACL: %s", + sender_address, log_msg); + if (user_msg == NULL) user_msg = US"local configuration problem"; if (smtp_batched_input) { @@ -3110,9 +3116,9 @@ else { uschar *istemp = US""; uschar *s = NULL; + uschar *smtp_code; int size = 0; int sptr = 0; - int code; errmsg = local_scan_data; @@ -3129,7 +3135,7 @@ else /* Fall through */ case LOCAL_SCAN_REJECT: - code = 550; + smtp_code = US"550"; if (errmsg == NULL) errmsg = US"Administrative prohibition"; break; @@ -3139,7 +3145,7 @@ else case LOCAL_SCAN_TEMPREJECT: TEMPREJECT: - code = 451; + smtp_code = US"451"; if (errmsg == NULL) errmsg = US"Temporary local problem"; istemp = US"temporarily "; break; @@ -3157,14 +3163,14 @@ else { if (!smtp_batched_input) { - smtp_respond(code, TRUE, errmsg); + smtp_respond(smtp_code, 3, TRUE, errmsg); message_id[0] = 0; /* Indicate no message accepted */ smtp_reply = US""; /* Indicate reply already sent */ goto TIDYUP; /* Skip to end of function */ } else { - moan_smtp_batch(NULL, "%d %s", code, errmsg); + moan_smtp_batch(NULL, "%s %s", smtp_code, errmsg); /* Does not return */ } } @@ -3483,8 +3489,8 @@ if (smtp_input) if (smtp_reply == NULL) { if (fake_response != OK) - smtp_respond(fake_response == DEFER ? 450 : 550, - TRUE, fake_response_text); + smtp_respond((fake_response == DEFER)? US"450" : US"550", 3, TRUE, + fake_response_text); else smtp_printf("250 OK id=%s\r\n", message_id); if (host_checking) @@ -3494,8 +3500,8 @@ if (smtp_input) else if (smtp_reply[0] != 0) { if (fake_response != OK && (smtp_reply[0] == '2')) - smtp_respond(fake_response == DEFER ? 450 : 550, - TRUE, fake_response_text); + smtp_respond((fake_response == DEFER)? US"450" : US"550", 3, TRUE, + fake_response_text); else smtp_printf("%.1024s\r\n", smtp_reply); }