[GH-ISSUE #1207] improve the sending of emails #855

Closed
opened 2026-03-03 02:04:02 +03:00 by kerem · 7 comments
Owner

Originally created by @Gurkengewuerz on GitHub (Oct 29, 2020).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1207

improve the sending of emails

I am using bitwarden_rs with my email server to send notification. Currently my rspamd adds the spam header because the mail had no message id. A value of 6 is marked as spam in the default rspamd configuration.
Is there a way to improve this behavior?

MISSING_MID (2.5)                         Message id is missing
HTML_SHORT_LINK_IMG_1 (2)                 Short html part (0..1K) with a link to an image
MIME_BASE64_TEXT_BOGUS (1)                Has text part encoded in base64 that does not contain any 8bit characters
URI_COUNT_ODD (1) [3]                     Odd number of URIs in multipart/alternative message
MIME_GOOD (-0.1) [multipart/alternative]  Known Content Type
MIME_BASE64_TEXT (0.1)                    Has Text Part encoded in base64
Originally created by @Gurkengewuerz on GitHub (Oct 29, 2020). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/1207 ### improve the sending of emails <!-- Describe your issue here.--> I am using bitwarden_rs with my email server to send notification. Currently my rspamd adds the spam header because the mail had no message id. A value of 6 is marked as spam in the default rspamd configuration. Is there a way to improve this behavior? ``` MISSING_MID (2.5) Message id is missing HTML_SHORT_LINK_IMG_1 (2) Short html part (0..1K) with a link to an image MIME_BASE64_TEXT_BOGUS (1) Has text part encoded in base64 that does not contain any 8bit characters URI_COUNT_ODD (1) [3] Odd number of URIs in multipart/alternative message MIME_GOOD (-0.1) [multipart/alternative] Known Content Type MIME_BASE64_TEXT (0.1) Has Text Part encoded in base64 ```
kerem 2026-03-03 02:04:02 +03:00
Author
Owner

@BlackDex commented on GitHub (Oct 29, 2020):

I noticed this to e few days back. I didn't had any troubles with this. But i know i can be a trigger.
I'll see if I can add this, shouldn't be too hard.

<!-- gh-comment-id:719089072 --> @BlackDex commented on GitHub (Oct 29, 2020): I noticed this to e few days back. I didn't had any troubles with this. But i know i can be a trigger. I'll see if I can add this, shouldn't be too hard.
Author
Owner

@Gurkengewuerz commented on GitHub (Oct 30, 2020):

@BlackDex thanks would be great! :)
I'm no into rust but maybe i've found something useful in lettre github.com/lettre/lettre@50d96ad8df

<!-- gh-comment-id:719527716 --> @Gurkengewuerz commented on GitHub (Oct 30, 2020): @BlackDex thanks would be great! :) I'm no into rust but maybe i've found something useful in lettre https://github.com/lettre/lettre/commit/50d96ad8dfd8295fca22d358dae1fae0fde7e19b
Author
Owner

@BlackDex commented on GitHub (Nov 18, 2020):

@Gurkengewuerz i have made some changes which helps preventing spam-triggers.
See #1229 for the changes.
I noticed it also triggered regarding odd uri counts because the plain/text version didn't contained the github link to this project.
So i added that also. And i noticed it also triggered on the plain/text and html/text not being similar, this was because some plain/text messages had HTML code, i removed that also, which removed that trigger.

I tested this by using https://www.mail-tester.com/ which started off giving a 7/10 score, and afterwards it reported a 10/10 score :).

We juist have to wait for the PR to be merged and the images to be build so that you can use the testing tagged image to use this.

<!-- gh-comment-id:729669591 --> @BlackDex commented on GitHub (Nov 18, 2020): @Gurkengewuerz i have made some changes which helps preventing spam-triggers. See #1229 for the changes. I noticed it also triggered regarding odd uri counts because the plain/text version didn't contained the github link to this project. So i added that also. And i noticed it also triggered on the plain/text and html/text not being similar, this was because some plain/text messages had HTML code, i removed that also, which removed that trigger. I tested this by using https://www.mail-tester.com/ which started off giving a 7/10 score, and afterwards it reported a 10/10 score :). We juist have to wait for the PR to be merged and the images to be build so that you can use the `testing` tagged image to use this.
Author
Owner

@Gurkengewuerz commented on GitHub (Nov 18, 2020):

wow this sounds awesome @BlackDex! Lets hope the PR get merged soon. Good work!

<!-- gh-comment-id:729701397 --> @Gurkengewuerz commented on GitHub (Nov 18, 2020): wow this sounds awesome @BlackDex! Lets hope the PR get merged soon. Good work!
Author
Owner

@rafi-fisker commented on GitHub (Dec 7, 2020):

So I tried using the testing image which is supposed to have this fix, but I am still having issues with emails getting marked as phishing/spam by our Microsoft 365 email system. Any ideas?

EDIT: nevermind, I figured it out, our 3rd party phishing detection plugin was marking it as spam/phishing and I was able to whitelist it. but probably still worth looking into...

<!-- gh-comment-id:739965835 --> @rafi-fisker commented on GitHub (Dec 7, 2020): So I tried using the `testing` image which is supposed to have this fix, but I am still having issues with emails getting marked as phishing/spam by our Microsoft 365 email system. Any ideas? EDIT: nevermind, I figured it out, our 3rd party phishing detection plugin was marking it as spam/phishing and I was able to whitelist it. but probably still worth looking into...
Author
Owner

@BlackDex commented on GitHub (Dec 19, 2020):

@rafi-fisker: It would be nice to know why it got marked as spam by the third-party email-filtering tool then. Else it will be impossible for us to even try to do something. I have fixed all the spamassassin checks which did actually were some sane RFC defaults which weren't used in the mail headers and some link counting.

It could very well still be something totally out of our control, like where you are sending the mail from for example, if that is untrusted by the filter for example. Or maybe if you have links to an internal accessible only server, it could mark it. There are a dozen reasons why.

<!-- gh-comment-id:748451988 --> @BlackDex commented on GitHub (Dec 19, 2020): @rafi-fisker: It would be nice to know why it got marked as spam by the third-party email-filtering tool then. Else it will be impossible for us to even try to do something. I have fixed all the spamassassin checks which did actually were some sane RFC defaults which weren't used in the mail headers and some link counting. It could very well still be something totally out of our control, like where you are sending the mail from for example, if that is untrusted by the filter for example. Or maybe if you have links to an internal accessible only server, it could mark it. There are a dozen reasons why.
Author
Owner

@rafi-fisker commented on GitHub (Dec 19, 2020):

@BlackDex The emails were sent via AWS SES SMTP server, with SPF/DKIM validated.
Unfortunately I don't have much visibility into the 3rd party email filtering tool, other than it's name: https://www.vadesecure.com/

<!-- gh-comment-id:748529268 --> @rafi-fisker commented on GitHub (Dec 19, 2020): @BlackDex The emails were sent via AWS SES SMTP server, with SPF/DKIM validated. Unfortunately I don't have much visibility into the 3rd party email filtering tool, other than it's name: https://www.vadesecure.com/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#855
No description provided.