<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Mark-<div class=""><br class=""></div><div class="">Since you're working on 2.11.0, would you take a look at this and see if it is indeed a bug that could be fixed in 2.11.0 or if I've missed something?</div><div class=""><br class=""></div><div class="">Thanks-</div><div class=""><br class=""></div><div class="">Tom</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Tom Johnson <<a href="mailto:tj@terramar.net" class="">tj@terramar.net</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">null sender in releasing email from sql quarantine</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">January 22, 2016 at 11:29:56 AM PST<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Amavis-users <<a href="mailto:amavis-users@amavis.org" class="">amavis-users@amavis.org</a>><br class=""></span></div><br class=""><div class=""><div class="">We're using a sql quarantine. <br class=""><br class="">We'd like to release emails from the quarantine and have the SMTP envelope MAIL FROM reflect the original sender.<br class=""><br class="">So we set  mailfrom_to_quarantine to undef.<br class=""><br class="">But, since the email is quarantined without a Return-Path or X-Envelope-From header.<br class=""><br class="">Postfix doesn't add those - because it's handling the email only via a relay to amavisd-new.<br class=""><br class="">Amavisd-new doesn't add them - the check for whether to add the X-Envelope-From header looks like this:<br class=""><br class="">    my $mftq = c('mailfrom_to_quarantine');<br class="">    if (!defined $mftq || $quar_m_protocol =~ /^(?:bsmtp|sql)\z/) {<br class="">      # we keep the original envelope sender address if replacement sender<br class="">      # is not provided, or with quarantine methods which store to fixed<br class="">      # locations which do not depend on envelope<br class="">      $quar_msg->sender($msginfo->sender);  # original sender<br class="">      $quar_msg->sender_smtp($msginfo->sender_smtp);<br class="">      $orig_env_sender_retained = 1;<br class="">    }.....<br class="">    ...<br class="">    ...<br class="">    if (!$orig_env_sender_retained) { # unless X-Envelope-* would be redundant<br class="">      $hdr_edits->prepend_header('X-Envelope-From', $msginfo->sender_smtp);<br class="">    }<br class=""><br class=""><br class="">And when you use amavisd-release to release a message, it's checked only for those two headers for the sender.<br class=""><br class="">So it's always sent from a null sender.  The releasing code only checks the headers of the message for an Return-Path or X-Envelope-From header.  It doesn't even default to using mailfrom_to_quarantine, so setting that doesn't do any good either.<br class=""><br class="">This looks like a bug to me.  Or am I missing something?<br class=""><br class=""><br class="">Tom<br class=""><br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>