--- courieresmtpd.c.orig	2005-12-12 20:00:54.000000000 -0700
+++ courieresmtpd.c	2006-06-23 10:46:56.000000000 -0700
@@ -153,6 +153,10 @@
 				*p='_';
 	}
 
+        putenv(strcat(strcpy(courier_malloc(sizeof("ESMTPHELO=") +
+					    strlen(helobuf)),
+			     "ESMTPHELO="), helobuf));
+
 	if (!extended)
 	{
 		addiovec("250 ", 4);
@@ -314,6 +318,11 @@
                 {
                         if (*identbuf)  strcat(identbuf, ", ");
                         strcat(strcat(identbuf, "AUTH: "), authuserbuf);
+			putenv(strcat(
+				 strcpy(
+				   courier_malloc(sizeof("SENDERAUTH=") +
+						  strlen(authuserbuf)),
+				   "SENDERAUTH="), authuserbuf));
 		}
 
 		if (tls)
