<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">For my purposes I came up with a quick fix, a patch to Sendmail.pm that uses the header information to overwrite the "from" data from the envelope.<div><br></div><div><div># diff -u Sendmail.pm.0 Sendmail.pm</div><div>--- Sendmail.pm.0       2019-01-27 14:49:14.000000000 -0500</div><div>+++ Sendmail.pm 2025-04-06 10:17:35.280422217 -0400</div><div>@@ -313,6 +313,17 @@</div><div>         $from =~ s/\s*>$//; # trailing <></div><div>         $message->{from} = lc($from);</div><div>         $SFound = 1; # We have found the sender</div><div>+MailScanner::Log::NoticeLog("Envelope From: %s", $message->{from});</div><div>+      }</div><div>+      if ($Line =~ /^H\?\?[fF][rR][oO][mM]:\s/) {</div><div>+        $from = $Line;</div><div>+        #chomp $from;</div><div>+        $from =~ s/^H\?\?[fF][rR][oO][mM]:\s//;</div><div>+        $from =~ s/[^<]*<\s*//; # leading and</div><div>+        $from =~ s/\s*>$//; # trailing <></div><div>+        $message->{from} = lc($from);</div><div>+MailScanner::Log::NoticeLog("Header From: %s", $message->{from});</div><div>+        $SFound = 1; # We have found the sender</div><div>       }</div><div>       if ($Line =~ /^\$_/) {</div><div>         $ip = $Line;</div></div><div><br></div><div><br></div><div>Ideally this would save the header from to a different structure element, perhaps "$message->{hfrom}", with another patch so that rules could reference "HFrom:" vs "From:", but I couldn't figure out that part of the code in Message.pm</div></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, Apr 5, 2025 at 12:59 AM Ricky Boone <<a href="mailto:ricky.boone@gmail.com">ricky.boone@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I don't believe so.  Alternatively, depending on what you're<br>
ultimately trying to solve for, using SpamAssassin rules or other<br>
configuration statements may work instead.<br>
<br>
On Fri, Apr 4, 2025 at 5:05 PM Richard Bollinger (Richard A<br>
Bollinger)(ETCI) via MailScanner <<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.info</a>><br>
wrote:<br>
><br>
> Is there a way in a ruleset to match on a visible from address vs the envelope from address?<br>
><br>
><br>
> CONFIDENTIALITY NOTICE: This E-mail, along with any attachments, is considered confidential and may well be legally privileged. If you have received it in error, you are on notice of its status. Please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. Thank you for your cooperation.<br>
><br>
> --<br>
> MailScanner mailing list<br>
> <a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.info</a><br>
> <a href="https://urldefense.com/v3/__http://lists.mailscanner.info/mailman/listinfo/mailscanner__;!!JT12okTYBSM!ReEFHwXVe_Kikd8twNrjtKHSBqy_K9UmXrMPj5p6jvYY7mV7yf81os8W8yRyAh2gV1D3uCvvYx2n09J17EZqPybVtA$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__http://lists.mailscanner.info/mailman/listinfo/mailscanner__;!!JT12okTYBSM!ReEFHwXVe_Kikd8twNrjtKHSBqy_K9UmXrMPj5p6jvYY7mV7yf81os8W8yRyAh2gV1D3uCvvYx2n09J17EZqPybVtA$</a> [lists[.]mailscanner[.]info]<br>
><br>
</blockquote></div></div>
<br />
<br />CONFIDENTIALITY NOTICE: This E-mail, along with any attachments, is considered confidential and may well be legally privileged.  If you have received it in error, you are on notice of its status.  Please notify us immediately by reply e-mail and then delete this message from your system.  Please do not copy it or use it for any purposes, or disclose its contents to any other person. Thank you for your cooperation.