Skip to content
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

mail-source file attachments (multipart email) #437

Open
borg1310 opened this issue Mar 6, 2023 · 1 comment
Open

mail-source file attachments (multipart email) #437

borg1310 opened this issue Mar 6, 2023 · 1 comment
Labels
question Further information is requested

Comments

@borg1310
Copy link

borg1310 commented Mar 6, 2023

hi,

we are trying to use the mail-source application to download emails from our mail server and feed existing attachments into a stream. however, only a string of the complete email (with attachments) is transmitted in the mail-source component. is there a possibility to have the email parsed directly into a multipart email? or does this have to be implemented manually by the user?

thanks in advance
regards,
juergen

@artembilan
Copy link
Member

Correct. The current implementation of Mail Source does this unconditionally:

.transform(Mail.toStringTransformer(this.properties.getCharset()))

So, independently of the mail content we always try to convert it into a String.
It is not clear how you'd like to be streamed a multipart email downstream, so we leave such a complex task out of this project scope.

See if you can use MailReceivingMessageSource in your custom source implementation to emit a MimeMessage and deal with its attachment the way you'd like.
See more info in docs, too: https://docs.spring.io/spring-integration/docs/current/reference/html/mail.html#mail-mapping.

We are open for contribution back if you find the way to stream multipart email down in a common way.

@artembilan artembilan added the question Further information is requested label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants