-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.473 2007/02/06 14:49:13 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.474 2007/02/07 11:24:56 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/20 Added hosts_avoid_pipelining to the smtp transport.
+PH/21 Long custom messages for fakedefer and fakereject are now split up
+ into multiline reponses in the same way that messages for "deny" and
+ other ACL rejections are.
+
Exim version 4.66
-----------------
-/* $Cambridge: exim/src/src/acl.c,v 1.72 2007/02/06 12:19:27 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.73 2007/02/07 11:24:56 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Before giving a response, take a look at the length of any user message, and
split it up into multiple lines if possible. */
-if (*user_msgptr != NULL && Ustrlen(*user_msgptr) > 75)
- {
- uschar *s = *user_msgptr = string_copy(*user_msgptr);
- uschar *ss = s;
-
- for (;;)
- {
- int i = 0;
- while (i < 75 && *ss != 0 && *ss != '\n') ss++, i++;
- if (*ss == 0) break;
- if (*ss == '\n')
- s = ++ss;
- else
- {
- uschar *t = ss + 1;
- uschar *tt = NULL;
- while (--t > s + 35)
- {
- if (*t == ' ')
- {
- if (t[-1] == ':') { tt = t; break; }
- if (tt == NULL) tt = t;
- }
- }
-
- if (tt == NULL) /* Can't split behind - try ahead */
- {
- t = ss + 1;
- while (*t != 0)
- {
- if (*t == ' ' || *t == '\n')
- { tt = t; break; }
- t++;
- }
- }
-
- if (tt == NULL) break; /* Can't find anywhere to split */
- *tt = '\n';
- s = ss = tt+1;
- }
- }
- }
+*user_msgptr = string_split_message(*user_msgptr);
+if (fake_response != OK)
+ fake_response_text = string_split_message(fake_response_text);
return rc;
}
-/* $Cambridge: exim/src/src/functions.h,v 1.35 2007/02/06 11:11:40 ph10 Exp $ */
+/* $Cambridge: exim/src/src/functions.h,v 1.36 2007/02/07 11:24:56 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extern uschar *string_nextinlist(uschar **, int *, uschar *, int);
extern uschar *string_open_failed(int, char *, ...);
extern uschar *string_printing2(uschar *, BOOL);
+extern uschar *string_split_message(uschar *);
extern BOOL string_vformat(uschar *, int, char *, va_list);
extern int strcmpic(uschar *, uschar *);
extern int strncmpic(uschar *, uschar *, int);
-/* $Cambridge: exim/src/src/string.c,v 1.11 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/string.c,v 1.12 2007/02/07 11:24:56 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
+/*************************************************
+* Copy string if long, inserting newlines *
+*************************************************/
+
+/* If the given string is longer than 75 characters, it is copied, and within
+the copy, certain space characters are converted into newlines.
+
+Argument: pointer to the string
+Returns: pointer to the possibly altered string
+*/
+
+uschar *
+string_split_message(uschar *msg)
+{
+uschar *s, *ss;
+
+if (msg == NULL || Ustrlen(msg) <= 75) return msg;
+s = ss = msg = string_copy(msg);
+
+for (;;)
+ {
+ int i = 0;
+ while (i < 75 && *ss != 0 && *ss != '\n') ss++, i++;
+ if (*ss == 0) break;
+ if (*ss == '\n')
+ s = ++ss;
+ else
+ {
+ uschar *t = ss + 1;
+ uschar *tt = NULL;
+ while (--t > s + 35)
+ {
+ if (*t == ' ')
+ {
+ if (t[-1] == ':') { tt = t; break; }
+ if (tt == NULL) tt = t;
+ }
+ }
+
+ if (tt == NULL) /* Can't split behind - try ahead */
+ {
+ t = ss + 1;
+ while (*t != 0)
+ {
+ if (*t == ' ' || *t == '\n')
+ { tt = t; break; }
+ t++;
+ }
+ }
+
+ if (tt == NULL) break; /* Can't find anywhere to split */
+ *tt = '\n';
+ s = ss = tt+1;
+ }
+ }
+
+return msg;
+}
+
+
+
/*************************************************
* Copy returned DNS domain name, de-escaping *
*************************************************/
--- /dev/null
+# Exim test configuration 0555
+
+FAKE=fakereject
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+rfc1413_query_timeout = 0s
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+# ----- Main settings -----
+
+acl_smtp_rcpt = check_rcpt
+queue_only
+
+
+# ----- ACLs -----
+
+begin acl
+
+check_rcpt:
+ accept control = FAKE
+
+
+# End
--- /dev/null
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-smtp S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-smtp S=sss
--- /dev/null
+# Long lines for fakedefer/fakereject
+exim -bs
+mail from:<>
+rcpt to:<userx@test.ex>
+data
+Message 1
+.
+quit
+****
+exim -bs -DFAKE='fakedefer/This is a rather long customised message that \
+ should get automatically split up into more than one \
+ response line.'
+mail from:<>
+rcpt to:<userx@test.ex>
+data
+Message 2
+.
+quit
+****
+no_msglog_check
--- /dev/null
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+550-Your message has been rejected but is being kept for evaluation.\r
+550-If it was a legitimate message, it may still be delivered to the target\r
+550 recipient(s).\r
+221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+450-This is a rather long customised message that should get automatically\r
+450 split up into more than one response line.\r
+221 myhost.test.ex closing connection\r
250 Accepted\r
354 Enter message, ending with "." on a line by itself\r
550-Your message has been rejected but is being kept for evaluation.\r
-550 If it was a legitimate message, it may still be delivered to the target recipient(s).\r
+550-If it was a legitimate message, it may still be delivered to the target\r
+550 recipient(s).\r
221 myhost.test.ex closing connection\r
220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
250-myhost.test.ex Hello CALLER at test.ex\r
250 Accepted\r
354 Enter message, ending with "." on a line by itself\r
450-Your message has been rejected but is being kept for evaluation.\r
-450 If it was a legitimate message, it may still be delivered to the target recipient(s).\r
+450-If it was a legitimate message, it may still be delivered to the target\r
+450 recipient(s).\r
221 myhost.test.ex closing connection\r
220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
250 OK\r