Specifically, this is what I have in mind, only with the filter API so
I don't have to patch this myself. It ensures that my laptop's current
IP address does not leak through mail headers.


diff --git a/smtpd/smtp_session.c b/smtpd/smtp_session.c
index f53c83f..e39f03f 100644
--- a/smtpd/smtp_session.c
+++ b/smtpd/smtp_session.c
@@ -368,18 +368,28 @@ smtp_session_imsg(struct mproc *p, struct imsg *imsg)
                        return;
                }

-               fprintf(s->ofile,
-                   "Received: from %s (%s [%s]);\n"
-                   "\tby %s (%s) with %sSMTP%s%s id %08x;\n",
-                   s->evp.helo,
-                   s->hostname,
-                   ss_to_text(&s->ss),
-                   s->listener->helo[0] ? s->listener->helo : env->sc_hostname,
-                   SMTPD_NAME,
-                   s->flags & SF_EHLO ? "E" : "",
-                   s->flags & SF_SECURE ? "S" : "",
-                   s->flags & SF_AUTHENTICATED ? "A" : "",
-                   evpid_to_msgid(s->evp.id));
+               if (s->flags & SF_AUTHENTICATED)
+                       fprintf(s->ofile,
+                           "Received: by %s (%s) with %sSMTP%s%s id %08x;\n",
+                           s->listener->helo[0] ? s->listener->helo : 
env->sc_hostname,
+                           SMTPD_NAME,
+                           s->flags & SF_EHLO ? "E" : "",
+                           s->flags & SF_SECURE ? "S" : "",
+                           s->flags & SF_AUTHENTICATED ? "A" : "",
+                           evpid_to_msgid(s->evp.id));
+               else
+                       fprintf(s->ofile,
+                           "Received: from %s (%s [%s]);\n"
+                           "\tby %s (%s) with %sSMTP%s%s id %08x;\n",
+                           s->evp.helo,
+                           s->hostname,
+                           ss_to_text(&s->ss),
+                           s->listener->helo[0] ? s->listener->helo : 
env->sc_hostname,
+                           SMTPD_NAME,
+                           s->flags & SF_EHLO ? "E" : "",
+                           s->flags & SF_SECURE ? "S" : "",
+                           s->flags & SF_AUTHENTICATED ? "A" : "",
+                           evpid_to_msgid(s->evp.id));

                if (s->flags & SF_SECURE) {
                        fprintf(s->ofile,

-- 
You received this email because you are subscribed to mailing list: 
[email protected]
To unsubscribe, send mail with subject:
        [[email protected]] unregister

Reply via email to