- /* make the answer 0-terminated. only needed for debug_printf */
- DEBUG(D_acl)
- debug_printf("DCC: Length of the output buffer is: %d\nDCC: Output buffer is:\n"
- "DCC: -----------------------------------\n%.*s\n"
- "DCC: -----------------------------------\n", dcc_resplen, dcc_resplen, big_buffer);
-
- /* Now let's read each character and see what we've got */
- for(bufoffset = 0; bufoffset < dcc_resplen, line <= 2; bufoffset++) {
- /* First check if we reached the end of the line and
- * then increment the line counter */
- if(big_buffer[bufoffset] == '\n')
- line++;
- else {
- /* The first character of the first line is the
- * overall response. If there's another character
- * on that line it is not correct. */
- if(line == 1) {
- if(bufoffset == 0) {
- /* Now get the value and set the
- * return value accordingly */
- switch(big_buffer[bufoffset]) {
- case 'A':
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = A\treturning OK\n");
- dcc_return_text = US"Mail accepted by DCC";
- dcc_result = US"A";
- retval = OK;
- break;
- case 'R':
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = R\treturning FAIL\n");
- dcc_return_text = US"Rejected by DCC";
- dcc_result = US"R";
- retval = FAIL;
- if(sender_host_name)
- log_write(0, LOG_MAIN, "H=%s [%s] F=<%s>: rejected by DCC",
- sender_host_name, sender_host_address, sender_address);
- else
- log_write(0, LOG_MAIN, "H=[%s] F=<%s>: rejected by DCC",
- sender_host_address, sender_address);
- break;
- case 'S':
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = S\treturning OK\n");
- dcc_return_text = US"Not all recipients accepted by DCC";
- /* Since we're in an ACL we want a global result
- * so we accept for all */
- dcc_result = US"A";
- retval = OK;
- break;
- case 'G':
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = G\treturning FAIL\n");
- dcc_return_text = US"Greylisted by DCC";
- dcc_result = US"G";
- retval = FAIL;
- break;
- case 'T':
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = T\treturning DEFER\n");
- dcc_return_text = US"Temporary error with DCC";
- dcc_result = US"T";
- retval = DEFER;
- log_write(0,LOG_MAIN,"Temporary error with DCC: %s\n", big_buffer);
- break;
- default:
- DEBUG(D_acl)
- debug_printf("DCC: Overall result = something else\treturning DEFER\n");
- dcc_return_text = US"Unknown DCC response";
- dcc_result = US"T";
- retval = DEFER;
- log_write(0,LOG_MAIN,"Unknown DCC response: %s\n", big_buffer);
- break;
- }
- }
- else {
- /* We're on the first line but not on the first character,
- * there must be something wrong. */
- DEBUG(D_acl) debug_printf("DCC: Line = %d but bufoffset = %d != 0"
- " character is %c - This is wrong!\n", line, bufoffset, big_buffer[bufoffset]);
- log_write(0,LOG_MAIN,"Wrong header from DCC, output is %s\n", big_buffer);
- }
- }
- else if(line == 2) {
- /* On the second line we get a list of
- * answers for each recipient. We don't care about
- * it because we're in an acl and take the
- * global result. */
- }
+ /* make the answer 0-terminated. only needed for debug_printf */
+ DEBUG(D_acl)
+ debug_printf("DCC: Length of the output buffer is: %d\nDCC: Output buffer is:\n"
+ "DCC: -----------------------------------\n%.*s\n"
+ "DCC: -----------------------------------\n", dcc_resplen, dcc_resplen, big_buffer);
+
+ /* Now let's read each character and see what we've got */
+ for(bufoffset = 0; bufoffset < dcc_resplen, line <= 2; bufoffset++)
+ {
+ /* First check if we reached the end of the line and
+ then increment the line counter */
+ if(big_buffer[bufoffset] == '\n')
+ line++;
+ else
+ {
+ /* The first character of the first line is the overall response. If
+ there's another character on that line it is not correct. */
+ if(line == 1)
+ {
+ if(bufoffset == 0)
+ {
+ /* Now get the value and set the return value accordingly */
+ switch (big_buffer[bufoffset])
+ {
+ case 'A':
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = A\treturning OK\n");
+ dcc_return_text = US"Mail accepted by DCC";
+ dcc_result = US"A";
+ retval = OK;
+ break;
+ case 'R':
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = R\treturning FAIL\n");
+ dcc_return_text = US"Rejected by DCC";
+ dcc_result = US"R";
+ retval = FAIL;
+ if(sender_host_name)
+ log_write(0, LOG_MAIN, "H=%s [%s] F=<%s>: rejected by DCC",
+ sender_host_name, sender_host_address, sender_address);
+ else
+ log_write(0, LOG_MAIN, "H=[%s] F=<%s>: rejected by DCC",
+ sender_host_address, sender_address);
+ break;
+ case 'S':
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = S\treturning OK\n");
+ dcc_return_text = US"Not all recipients accepted by DCC";
+ /* Since we're in an ACL we want a global result so we accept for all */
+ dcc_result = US"A";
+ retval = OK;
+ break;
+ case 'G':
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = G\treturning FAIL\n");
+ dcc_return_text = US"Greylisted by DCC";
+ dcc_result = US"G";
+ retval = FAIL;
+ break;
+ case 'T':
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = T\treturning DEFER\n");
+ dcc_return_text = US"Temporary error with DCC";
+ dcc_result = US"T";
+ retval = DEFER;
+ log_write(0,LOG_MAIN,"Temporary error with DCC: %s\n", big_buffer);
+ break;
+ default:
+ DEBUG(D_acl)
+ debug_printf("DCC: Overall result = something else\treturning DEFER\n");
+ dcc_return_text = US"Unknown DCC response";
+ dcc_result = US"T";
+ retval = DEFER;
+ log_write(0,LOG_MAIN,"Unknown DCC response: %s\n", big_buffer);
+ break;
+ }
+ }
+ else
+ {
+ /* We're on the first line but not on the first character,
+ * there must be something wrong. */
+ DEBUG(D_acl) debug_printf("DCC: Line = %d but bufoffset = %d != 0"
+ " character is %c - This is wrong!\n", line, bufoffset, big_buffer[bufoffset]);
+ log_write(0,LOG_MAIN,"Wrong header from DCC, output is %s\n", big_buffer);
+ }
+ }
+ else if(line == 2)
+ {
+ /* On the second line we get a list of answers for each recipient. We
+ don't care about it because we're in an acl and take the global result. */
+ }