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

fix SMTP output duplicate headers #528

Merged

Conversation

apsega
Copy link
Contributor

@apsega apsega commented Jun 21, 2023

Currently, SMTP output will duplicate To:, From:, Subject: headers and due to that services like Gmail are blocking incoming emails. For example:

image (39)

/kind bug
/area outputs

Copy link
Member

@Issif Issif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a remainder of the previous version of the lib I used for SMTP. I missed to change that thanks.
The Subject is not there anymore, are you sure it works as expected?

@Issif Issif added this to the 2.28.0 milestone Jun 21, 2023
@apsega
Copy link
Contributor Author

apsega commented Jun 22, 2023

I've just built from the master branch and checked locally, there are still duplicate headers (To: and From:) and email didn't went through. Added additional debug log and it shows (deducted some parts for privacy):

2023/06/22 08:18:37 [DEBUG] : body :
To: <...>@gmail.com
Subject: [Warning] 06:54:15.354304000: Warning Attach/Exec to pod (user=<...>@gmail.com pod=<...>-7fbf9995b-nvcfz ns=namespace action=exec command=/bin/bash)
From: falco@email
From: falco@email
To: <...>@gmail.com
Date: Wed Jun 14 06:54:15 +0000 2023
MIME-version: 1.0
Content-Type: text/plain; charset="UTF-8"

@Issif
Copy link
Member

Issif commented Jun 22, 2023

I've just built from the master branch and checked locally, there are still duplicate headers (To: and From:) and email didn't went through. Added additional debug log and it shows (deducted some parts for privacy):

2023/06/22 08:18:37 [DEBUG] : body :
To: <...>@gmail.com
Subject: [Warning] 06:54:15.354304000: Warning Attach/Exec to pod (user=<...>@gmail.com pod=<...>-7fbf9995b-nvcfz ns=namespace action=exec command=/bin/bash)
From: falco@email
From: falco@email
To: <...>@gmail.com
Date: Wed Jun 14 06:54:15 +0000 2023
MIME-version: 1.0
Content-Type: text/plain; charset="UTF-8"

I agree your change, but you also remove the Subject field, are you sure it's OK? Removing to and from, it's good to me.

Signed-off-by: Edgaras <edgaras@apsega.lt>
@apsega apsega force-pushed the fix/smtp_output_duplicate_headers branch from 9a36f5e to 2bfa2bf Compare June 26, 2023 06:08
@apsega
Copy link
Contributor Author

apsega commented Jun 26, 2023

@Issif you were right. Adding back Subject field.

@poiana
Copy link

poiana commented Jun 26, 2023

LGTM label has been added.

Git tree hash: ebe91c33f7b58496572c50327d1b30760a757c81

@poiana
Copy link

poiana commented Jun 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apsega, Issif

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Issif Issif merged commit 976ca31 into falcosecurity:master Jul 5, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants