diff -ur postfix-2.5-20071111/src/global/mail_params.h postfix-2.5-20071111-patch/src/global/mail_params.h
--- postfix-2.5-20071111/src/global/mail_params.h	2007-11-08 00:35:40.000000000 +0000
+++ postfix-2.5-20071111-patch/src/global/mail_params.h	2007-11-22 14:46:02.000000000 +0000
@@ -2803,6 +2803,20 @@
 extern bool var_qmqpd_client_port_log;
 
  /*
+  * Store all the recipients of a mail for use by the access delegation daemon
+  */
+#define VAR_SMTPD_ACCESS_DELEGATION_RECIPIENTS	"access_delegation_recipients"
+#define DEF_SMTPD_ACCESS_DELEGATION_RECIPIENTS	0
+extern bool var_access_delegation_recipients;
+
+ /*
+  * The maximum amough of memory that the recipients list can use
+  */
+#define VAR_SMTPD_RECIPIENTS_LENGTH_LIMIT	"smtpd_recipients_lenght_limit"
+#define DEF_SMTPD_RECIPIENTS_LENGHT_LIMIT	0
+extern int var_smtpd_recipients_length_limit;
+
+ /*
   * Header/body checks in delivery agents.
   */
 #define VAR_SMTP_HEAD_CHKS	"smtp_header_checks"
diff -ur postfix-2.5-20071111/src/global/mail_proto.h postfix-2.5-20071111-patch/src/global/mail_proto.h
--- postfix-2.5-20071111/src/global/mail_proto.h	2007-10-03 22:35:04.000000000 +0100
+++ postfix-2.5-20071111-patch/src/global/mail_proto.h	2007-11-22 14:46:02.000000000 +0000
@@ -102,6 +102,7 @@
 #define MAIL_ATTR_RCPT_COUNT	"recipient_count"
 #define MAIL_ATTR_ORCPT		"original_recipient"
 #define MAIL_ATTR_RECIP		"recipient"
+#define MAIL_ATTR_RECIPS	"recipients"
 #define MAIL_ATTR_WHY		"reason"
 #define MAIL_ATTR_VERPDL	"verp_delimiters"
 #define MAIL_ATTR_SITE		"site"
diff -ur postfix-2.5-20071111/src/smtpd/smtpd.c postfix-2.5-20071111-patch/src/smtpd/smtpd.c
--- postfix-2.5-20071111/src/smtpd/smtpd.c	2007-10-17 16:17:36.000000000 +0100
+++ postfix-2.5-20071111-patch/src/smtpd/smtpd.c	2007-11-22 14:50:55.000000000 +0000
@@ -1130,6 +1130,8 @@
 char   *var_milt_eod_macros;
 char   *var_milt_unk_macros;
 bool    var_smtpd_client_port_log;
+bool    var_access_delegation_recipients;
+int     var_smtpd_recipients_length_limit;
 
  /*
   * Silly little macros.
@@ -2414,6 +2416,23 @@
     state->rcpt_count++;
     if (state->recipient == 0)
 	state->recipient = mystrdup(STR(state->addr_buf));
+    if (var_access_delegation_recipients) {
+        if (state->recipients == 0) {
+            if (var_smtpd_recipients_length_limit && var_smtpd_recipients_length_limit < var_line_limit) {
+                var_smtpd_recipients_length_limit = var_line_limit;
+            }
+            state->recipients = vstring_strcat(vstring_alloc(100),state->recipient);
+        } else {
+            if (var_smtpd_recipients_length_limit && (VSTRING_LEN(state->recipients) + strlen(state->recipient)) > var_smtpd_recipients_length_limit) {
+                vstring_free(state->recipients);
+                state->recipients = 0;
+                var_access_delegation_recipients = 0;
+            } else {
+                state->recipients = vstring_strcat(state->recipients,"\r");
+                state->recipients = vstring_strcat(state->recipients,mystrdup(STR(state->addr_buf)));
+            }
+        }
+    }
     if (state->cleanup) {
 	/* Note: RFC(2)821 externalized address! */
 	if (dsn_orcpt_addr == 0) {
@@ -2447,6 +2466,12 @@
 	myfree(state->recipient);
 	state->recipient = 0;
     }
+    if (var_access_delegation_recipients) {
+        if (state->recipients) {
+            vstring_free(state->recipients);
+            state->recipients = 0;
+        }
+    }
     state->rcpt_count = 0;
     /* XXX Must flush the command history. */
     state->rcpt_overshoot = 0;
@@ -4605,6 +4630,7 @@
 	VAR_SMTPD_TLS_LOGLEVEL, DEF_SMTPD_TLS_LOGLEVEL, &var_smtpd_tls_loglevel, 0, 0,
 	VAR_TLS_DAEMON_RAND_BYTES, DEF_TLS_DAEMON_RAND_BYTES, &var_tls_daemon_rand_bytes, 1, 0,
 #endif
+	VAR_SMTPD_RECIPIENTS_LENGTH_LIMIT, DEF_SMTPD_RECIPIENTS_LENGHT_LIMIT, &var_smtpd_recipients_length_limit, 0, 0,
 	0,
     };
     static CONFIG_TIME_TABLE time_table[] = {
@@ -4649,6 +4675,7 @@
 	VAR_SMTPD_PEERNAME_LOOKUP, DEF_SMTPD_PEERNAME_LOOKUP, &var_smtpd_peername_lookup,
 	VAR_SMTPD_DELAY_OPEN, DEF_SMTPD_DELAY_OPEN, &var_smtpd_delay_open,
 	VAR_SMTPD_CLIENT_PORT_LOG, DEF_SMTPD_CLIENT_PORT_LOG, &var_smtpd_client_port_log,
+	VAR_SMTPD_ACCESS_DELEGATION_RECIPIENTS, DEF_SMTPD_ACCESS_DELEGATION_RECIPIENTS, &var_access_delegation_recipients,
 	0,
     };
     static CONFIG_STR_TABLE str_table[] = {
@@ -4756,3 +4783,4 @@
 		       MAIL_SERVER_POST_INIT, post_jail_init,
 		       0);
 }
+
diff -ur postfix-2.5-20071111/src/smtpd/smtpd_check.c postfix-2.5-20071111-patch/src/smtpd/smtpd_check.c
--- postfix-2.5-20071111/src/smtpd/smtpd_check.c	2007-09-11 15:16:17.000000000 +0100
+++ postfix-2.5-20071111-patch/src/smtpd/smtpd_check.c	2007-11-22 14:46:02.000000000 +0000
@@ -3353,6 +3353,8 @@
 			  state->sender ? state->sender : "",
 			  ATTR_TYPE_STR, MAIL_ATTR_RECIP,
 			  state->recipient ? state->recipient : "",
+			  ATTR_TYPE_STR, MAIL_ATTR_RECIPS,
+			  state->recipients && (strcasecmp(state->where, SMTPD_CMD_DATA) == 0 || strcasecmp(state->where, SMTPD_CMD_EOD) == 0) ? STR(state->recipients) : "",
 			  ATTR_TYPE_INT, MAIL_ATTR_RCPT_COUNT,
 			  ((strcasecmp(state->where, SMTPD_CMD_DATA) == 0) ||
 			 (strcasecmp(state->where, SMTPD_AFTER_DOT) == 0)) ?
diff -ur postfix-2.5-20071111/src/smtpd/smtpd.h postfix-2.5-20071111-patch/src/smtpd/smtpd.h
--- postfix-2.5-20071111/src/smtpd/smtpd.h	2007-10-04 00:46:06.000000000 +0100
+++ postfix-2.5-20071111-patch/src/smtpd/smtpd.h	2007-11-22 14:46:02.000000000 +0000
@@ -99,6 +99,7 @@
     char   *encoding;			/* owned by mail_cmd() */
     char   *verp_delims;		/* owned by mail_cmd() */
     char   *recipient;			/* recipient address */
+    VSTRING *recipients;			/* all the recipients seen in the mail */
     char   *etrn_name;			/* client ETRN argument */
     char   *protocol;			/* SMTP or ESMTP */
     char   *where;			/* protocol stage */
diff -ur postfix-2.5-20071111/src/smtpd/smtpd_state.c postfix-2.5-20071111-patch/src/smtpd/smtpd_state.c
--- postfix-2.5-20071111/src/smtpd/smtpd_state.c	2007-04-05 17:57:43.000000000 +0100
+++ postfix-2.5-20071111-patch/src/smtpd/smtpd_state.c	2007-11-22 14:46:02.000000000 +0000
@@ -99,6 +99,7 @@
     state->sender = 0;
     state->verp_delims = 0;
     state->recipient = 0;
+    state->recipients = 0;
     state->etrn_name = 0;
     state->protocol = mystrdup(MAIL_PROTO_SMTP);
     state->where = SMTPD_AFTER_CONNECT;
