Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29755

How to make javax.mail use a local "sendmail" binary?

$
0
0

I'm using javax.mail to create E-Mails and render those to their textual representation. Under certain conditions I don't want to forward those results using SMTP, but e.g. pipe them to a sendmail-binary. That seems to be pretty common in case of shell scripts and I came across this in the Perl-ecosystem as well.

Is something like that supported by javax.mail itself or some additional "plugin" already?

I don't see any such option, only SMTP or different network related protocols. Though, one can additionally implement a custom transport by extending Transport and registering that instead of SMTP in javamail.providers. Looking at the available source code, I see many concepts of hosts, ports, URLs, established connections etc., which doesn't fit local communication using a pipe very well. I wonder if one is able to override default behaviour to not work too network-specific at all.

So, can this approach work for non-network related transports at all or is "Transport" simply not designed that way?

I'f Im already using javax.mail, it might be a good idea to integrate any customization with that as much as reasonable.


Viewing all articles
Browse latest Browse all 29755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>