-
Notifications
You must be signed in to change notification settings - Fork 43
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
Ensure Content-Transfer-Encoding binary as the default for MDN's #43
Comments
Thanks for the very detailed analysis. Let me try to sum it up: |
You are welcome. I help out a lot on Stackoverflow and need to put my foot where my mouth is when stating to people there that 'debugging' with opensource is not that hard (and I'm fairly into protocols so that helps too)
Not specifically. If the current behaviour of AS2-Lib is good according to the specs (cannot find it myself, already checked), I'm fine with that. Just need a reference to the spec then (or the Drummond interoperability tests, since they sometimes (often?) deviate from the spec if all agree) just to 'convince' others current behaviour is officially good. But since the default is, for outgoing messages, already 'binary' (explicitly leaving the CTE out would be fine too!!!) and can be configured on the partnership, I'd say that having the same on outgoing MDN's would not be wrong. |
I cross-checked my code and found, that I already have the possibility to define a "sending Content-Transfer-Encoding" and a "receiving Content-Transfer-Encoding". |
Re-using these is fine, I already noticed them. But having a global one would be great as well. Or a feature to NOT have them set by javax.mail if not set by the application. |
I was investigating and "NOT have them set" in javax.mail is not an option. I found neither a system property nor a really reliable way to disable this. So setting the default CTE should do the trick. |
Theoretically it should now be impossible to have no CTE set, because the default ( |
Confirmed that this change makes signed MDN's work with our 'old' software. Now let's see how I can try to enable async MND's in the 'as2-peppol-server' |
Remarkable, you only set the CTE on the outer headers and the inner body parts are still 7bit. I (thought I) tried this too and did not get it to work, hence setting them on the inner bodyparts. Weird but it works |
|
async MDN outgoing ;-), traffic the other way around is the next step. Where do you 'discuss' things btw? Cannot imagine you use github for this? |
I have a Slack for discussion, but it's not used too heavily... will send you and invite. Outgoing async MDN: |
@kukel as I couldn't find your email address, I sent you an invitation on LinkedIn... |
This is fixed for 4.1.1 - new issues as new issues pls. Feel free to reference this one. Thx |
I'm currently investigating if our home build AS2 software (written in C, not well maintained but which used to be Drummond Certified) can be replaced by some other piece of java based software. AS2-lib being one of the options (running/changing OpenAS2 into running on a servlet container instead of monolithic being the other)
I tried to setup a partnership with our existing AS2 environment to see if at least that would work. Exchanging messages without MDN's works, with non-signed MDN's too, but when sending signed MDN's from AS2-lib to our server, I got "Integrity check failed" errors, after due investigation, I came to the conclusion that there is a very close relation to #13.
The signed MDN contains a Content-Transfer-Encoding of "7bit" which is a difference with the MDN's I got from our production environment, where in most cases the CTE is just absent.
Since the specs only menion a CTE being absent or set to 8bit or binary, I tried finding where the 7bit was set. The bodyparts are created and added to the parent MimePart in
Both do not have a Content-Transfer-Encoding set at that time, but in the resulting signed bodypart, they do, with a value of "7bit". Debugging where this came from I found that java-mail is adding the CTE based on the actual content
In
javax.mail.internet.MimeBodyPart
the DataHandler is passed on and used to retrieve the enconding from it.And in
MimeUtility.getEncoding(...)
I expected the
DispositionDataContentHandler
to be used here but it is not a DataHandler (the default java mail DataHandler is used) and then "7bit" is set due to the content all being ASCII characters.The only way I got things quickly working is by explicitly setting
and
in
AS2Helper.java
Yes, using the 'AS2 default' would be better and maybe even retrieve it from the partnership if declared there, but I want to be sure it is something that needs to be 'fixed' on hte AS2-Lib side or that it is a bug in our software that was never noticed since everybody participating in the expesive (both in cost and time) Drummond certifications did not send MDN in this format.
The text was updated successfully, but these errors were encountered: