Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Authentication-Results to transaction #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move Authentication-Results to transaction
The authentication results from SPF/DKIM/etc. are part of a single
message transaction, not the whole SMTP connection.  Without this
change, when multiple messages are received during a single SMTP
connection, the SPF/DKIM/etc. results just keep getting appended to an
Authentication-Results header.
  • Loading branch information
cmadamsgit committed Apr 17, 2024
commit a51aa469f3647b90d83fc616be571f6f9e463678
6 changes: 3 additions & 3 deletions lib/Qpsmtpd/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ sub store_deferred_reject {

sub store_auth_results {
my ($self, $result) = @_;
my $auths = $self->qp->connection->notes('authentication_results') or do {
$self->qp->connection->notes('authentication_results', $result);
my $auths = $self->qp->transaction->notes('authentication_results') or do {
$self->qp->transaction->notes('authentication_results', $result);
return;
};
my $ar = join('; ', $auths, $result);
$self->log(LOGDEBUG, "auth-results: $ar");
$self->qp->connection->notes('authentication_results', $ar);
$self->qp->transaction->notes('authentication_results', $ar);
}

sub is_immune {
Expand Down
4 changes: 2 additions & 2 deletions lib/Qpsmtpd/SMTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ sub authentication_results {
}

# RFC 5451: used in AUTH, DKIM, DOMAINKEYS, SENDERID, SPF
if ($self->connection->notes('authentication_results')) {
push @auth_list, $self->connection->notes('authentication_results');
if ($self->transaction->notes('authentication_results')) {
push @auth_list, $self->transaction->notes('authentication_results');
}

$self->log(LOGDEBUG, "adding auth results header");
Expand Down