Bug#990832: Updates

2021-07-19 Thread Don Armstrong


Thanks for all of the work and the patching.

The debug output that you're showing looks a lot like some of the
necessary macros aren't enabled in the postfix config; can you compare
what you have to what is listed in README.Debian?

I'll try to take another look at the code that you have which is working
and see what is going on there.


-- 
Don Armstrong  https://www.donarmstrong.com

I learned really early the difference between knowing the name of
something and knowing something
 -- Richard Feynman "What is Science" Phys. Teach. 7(6) 1969



Bug#990832: Updates

2021-07-16 Thread William Haller
Applied fixes from here to fedora 34 base for spamass-milter: 
https://bz.apache.org/SpamAssassin/attachment.cgi?id=5745=diff


With the exception of setting a default macro_r based on whether or not 
there was a cipher since r doesn't seem to be a postfix thing.


macro_cipher = smfi_getsymval(ctx, const_cast("{cipher}"));
if (!macro_cipher)
{
  macro_cipher = "";
  /* Protocol used to receive the message */
  macro_r = smfi_getsymval(ctx, const_cast("r"));
  if (!macro_r)
  {
    macro_r = "ESMTP";
    warnmacro("r", "ENVRCPT");
  }
}
else {
  /* Protocol used to receive the message */
  macro_r = smfi_getsymval(ctx, const_cast("r"));
  if (!macro_r)
  {
    macro_r = "ESMTPS";
    warnmacro("r", "ENVRCPT");
  }
}

and including the changes to append so the lines aren't dropped (setting 
the connected flag after a successful connect, moving the dump of the 
buffer to be after if (!connected) in ::output before the output of 
desired line).


Then corrected the fedora 34 base to include the -I option in the debian 
code.


Then made the final output for computed last hop to be

rec_header = (string) "Received: from " + macro_s + " (" + macro__ + 
")\r\n\t";

if (strlen(macro_tls_version)!=0)
{
  rec_header += (string) "(using ";
  if (strlen(macro_tls_version)!=0) {
    rec_header+=macro_tls_version;
  }
  if (strlen(macro_cipher)!=0) {
    rec_header+=(string) " cipher="+macro_cipher;
  }
  if (strlen(macro_auth_ssf))
  {
    rec_header += (string) " ("+macro_auth_ssf+"/"+macro_auth_ssf+" bits)";
  }
  rec_header += (string) ")\r\n\t";
}
if (strlen(macro_auth_authen)!=0) {
  rec_header += (string) "(Authenticated sender: 
"+macro_auth_authen+")\r\n\t";

}
rec_header += (string) "by " + macro_j + " (Postfix) with " +
  macro_r + " id " + macro_i + ";\r\n\t" +
  "for "+envrcpt[0]+"; "+macro_b + "\r\n";

Which gets rid of unparseable relays and dropped lines. I'm not sure 
what the best fix would or should be - adding a postfix flag so it would 
generate postfix worthy lines for spamassassin or making spamassassin 
recognize the lines put out by spamass-milter as "sendmail" lines. But 
getting the client ip address for the sender seems to be the big thing.


Bill