-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Unable to read attachment, no EOF found #2043
Comments
Without actually gisting your code, this is like asking how long a piece of string is. It should work, provided you're doing it right. The attachment stuff is tricky though. |
Thought so - go and look at the attachment plugin, in particular the wait_for_attachment_hooks function. You need to prevent Haraka from continuing to process the message until your attachment hooks are finished, so that means creating a data_post hook that stores the callback which your attachment hooks run once all processing is complete. Otherwise the connection could terminate before you're received all of the data and handled it. |
In fact - if you're only interested in the filenames inside the zip file, why don't you just use the stock attachment plugin which already provides this (using bsdtar - which supports more archive formats than yauzl)?? |
I'm not, I want to know if the zip contains any encrypted files. |
I take it you have an example zip then? Run it through bsdtar and I suspect you'll get an error returned saying that encryption isn't supported. |
My issue here is that I can't save the file to the fs because of our clients, I feel that I should be able to do it with the stream or with the buffer I've made at the end. I'm going to test right now that at the very least my buffer is good by trying to read a text file but if I need to save it to the fs, then I'll try with using bsdtar on the saved zip. Sorry for the late reply. |
I fixed this, was unrelated to Haraka. I left a TODO which was flipping my is_enc var somewhere else. Thank you! |
system info
Expected behavior
Collect all the buffers of an attached zip file and Buffer.concat, then read its entries, then log byteSize and if it's encrypted.
Observed behavior
In attempting to collect all the buffers of a zip file and Buffer.concat, then read its entries. I keep getting an error that no
End of File is found
, this could either be the way Haraka gets the attachments, the way I'm trying to read them, or the library I'm trying to use which isyauzl
.Steps to reproduce
Create attachment hook to push chunk of data to array, on end Buffer.concat then pass into yauzl.fromBuffer.
Notes
I'm going to try piping instead but I'd like to just know why I'm facing this issue.
The text was updated successfully, but these errors were encountered: