mailsac icon indicating copy to clipboard operation
mailsac copied to clipboard

Is it possible to provide features like downloading attachments?

Open rahulmr opened this issue 9 years ago • 5 comments

Is it possible to provide features like downloading attachments?

Is it possible to configure my own server using mailsac open source with my own domain and then have some option to download or see attachments?

Thanks!

rahulmr avatar Jun 29 '15 07:06 rahulmr

@rahulmr mailpraser does the job, but this is something awaits for implementation, maybe v2?

lifehome avatar Jul 18 '15 02:07 lifehome

Thanks for the update. Please do let me know once you have implemented it in v2 :)

rahulmr avatar Jul 20 '15 11:07 rahulmr

Sorry guys I have been tied up and keep meaning to give mailsac love to release the latest. but that has not happened. If you need a quick-and-dirty way to grab attachments:

https://github.com/ruffrey/mailsac/blob/master/lib/mailserver.js#L117

after mailparser gets it, the attachments might be sitting right there as base64, but we are (at this time) intentionally dropping them. you could insert them into mongodb as a base64 then do the work to render them on your end. From an express route, something like: res.set('content-type', 'whatever/attachment-type'); res.send(new Buffer(attachmentAsBase64, 'base64')).

ruffrey avatar Jul 20 '15 13:07 ruffrey

Thanks but I am just an end user :( so do not know how to do what you have suggested. Where to put the res.set on which line etc. Sorry.

rahulmr avatar Aug 04 '15 09:08 rahulmr

@ruffrey it seems code is changed now. Could you please suggest a better way to get the attachment? Thanks

rahulmr avatar May 06 '16 13:05 rahulmr