Comments (5)
Seems like a server policy to disallow from addresses that don't match the username. I'm not sure what I can do about this.
from simple-java-mail.
I did some research and I found that even though we can't force the server to ignore its policy, but we can try to appease it by setting the "Sender" header on the envelope.
Before I add this as a nice API, could you please try using the following example:
currentMailerBuilder
.withHeader("Sender", "[email protected]")
from simple-java-mail.
Hi, thanks for replying!
I tried your suggestion and sadly the result is the same. I can send the mail succesfully only if I set the sender
header to be the [email protected] and leave from
as [email protected] , but of course this does not result in the desired behavior from my example screenshot above.
In the quarkus mailer case I achieve it like this:
Mail.withHtml(to, subject, html)
.addHeader("From", fromHeader)
.addHeader("Reply-To", fromHeader);
Given that it is the exact same case (same domain, SMTP server, user, "from" address and recipient, etc)
So basically I add a "from" header manually which differs from the domain of my SMTP. It seems like somehow the quarkus mailer gets around this server policy (it could be a security issue on the SMTP server side as far as I know).
I tried adding a "from" header manually in simple-java-mail too, but I cannot build a valid email without specifiying a value for from()
in the EmailBuilder
, and of course if I add both from()
and then add manually a "from" header - gmail refuses to deliver the message with this:
host gmail-smtp-in.l.google.com
said: 550-5.7.1 Our system has detected that this message
is not RFC 550-5.7.1 5322 compliant: 550-5.7.1 Multiple 'From' headers
found. 550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has been 550-5.7.1 blocked.
If you have any ideas - they will would be highly aprreciated, meanwhile if I find out what's the difference between the outputs of the quarkus mailer and simple-java-mail - I will let you know.
Thank you!
from simple-java-mail.
I would be interested in the two EML outputs of the MimeMessage object from both Quarkus and Simple Java Mail and see how the headers differ.
from simple-java-mail.
Closed as inactionable.
from simple-java-mail.
Related Issues (20)
- [bug] Attachment body parts should separately parse Content-Disposition and ContentID, possible resulting in an downloadable attachment that is also embedded HOT 9
- [bug] don't require smime-module when adding collection of headers (also used when copying email) HOT 2
- [question from newbie] sjm cli does not return HOT 1
- Add config support for 'verifyingServerIdentity' with SMTP, also: since Angus 1.1.0 (8.6.0) server identity checks are on by default and can be countered by `mailerBuilder.verifyingServerIdentity(false)` HOT 12
- Cannot send an email. HOT 3
- Order of attachments is lost when converting a MimeMessage to an Email HOT 4
- Make S/MIME algorithms configurable (signature algorithm for signing, key encapsulation and cipher algorithms for encryption) HOT 4
- [Enhancement] Expose finer-grained DKIM configuration through the builder api and disable 'l-param' by default HOT 12
- [bug] Fix parsing addresses from headers in EML files, like a Disposition-Notification-To with umlaut HOT 1
- Update outlook-message-parser dependency, which has improved support for X500 addresses
- [Bug] Message headers not treated with case insensitivity as per RFC, causing deviating headers to slip through the filters HOT 1
- Maxing out SMTP server concurrent connections HOT 1
- outlookMsgToEmail duplicates recipients if same name used for To and Cc HOT 1
- java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_c13123e/Offline HOT 2
- [security] Update 3rd party dependencies to get rid of all currently known CVE issues HOT 2
- [enhancement+bug] Make EmailConverter API more consistent regarding Session parameter, don't use `Session.getDefaultInstance` anymore and fix bug where `emlToEmailBuilder` used `emlToMimeMessage` HOT 3
- How to create jakarta.mail.internet.MimeMessage without accessing the mailer session? HOT 3
- Update upstream dependency generic-object-pool, which solves a critical bug when there are exceptions during allocation HOT 1
- How to esclude embedded image in email HOT 2
- When reading .msg files the RTF converted to HTML is garbled in some cases where the appropriate charset is not detected properly HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-java-mail.