procmail
[Top] [All Lists]

X-Envelope-To

1996-12-04 21:48:39



I have produced a patch for adding X-Envelope-To as attached below. 
The patch is produced for sendmail-8.8.4/src/conf.c:

In addition to applying the patch, 
sendmail must be configured to send local emails 
without the "m" mailer flag.

--
yeoak(_at_)iscs(_dot_)nus(_dot_)sg




WARNING: The following patch is not tested vigorously. Use it at your own risks.



*** conf.c.orig Thu Dec  5 03:13:40 1996
--- conf.c      Thu Dec  5 10:13:58 1996
***************
*** 1032,1037 ****
--- 1032,1042 ----
        register ADDRESS *to;
        register ENVELOPE *e;
  {
+ #ifdef  X_ENVELOPE_TO
+       register HDR *h;
+       ADDRESS *volatile ca;
+ #endif
+ 
  # ifdef lint
        if (to == NULL)
                to++;
***************
*** 1040,1045 ****
--- 1045,1075 ----
        if (tTd(49, 1))
                printf("checkcompat(to=%s, from=%s)\n",
                        to->q_paddr, e->e_from.q_paddr);
+ 
+ #ifdef X_ENVELOPE_TO
+ 
+ /* modified by YeoAnnKian (yeoak(_at_)iscs(_dot_)nus(_dot_)sg) 05/12/96
+    if X-Envelope-To is not found, addheader;
+    else replace the value of X-Envelope-To
+ */
+       ca = getctladdr(to);
+       if (ca == NULL) ca=to;
+       for (h=e->e_header; h != NULL; h=h->h_link)
+       {
+               if (strcasecmp(h->h_field, "X-Envelope-To") == 0)
+               {
+                       free(h->h_value);
+                       h->h_value=newstr(ca->q_user);
+                       break;
+               }
+       }
+       /* if not found, insert the header */
+       if ( h == NULL )  
+       {
+               addheader("X-Envelope-To", ca->q_user, &e->e_header);
+       }
+ 
+ #endif /* X_ENVELOPE_TO */
  
  # ifdef EXAMPLE_CODE
        /* this code is intended as an example only */

<Prev in Thread] Current Thread [Next in Thread>
  • X-Envelope-To, Yeo Ann Kian <=