On 21/06/2017 10:52 PM, Paul Gilmartin wrote:
Nice.  I see:
         final String username = "smtp-username";
         final String password = "smtp-password";

Rather than hard-coding, could these be extracted from RACF (or other?)
database?  Or kept in suitably protected user-specific files?
RACF? Maybe, but you would have to figure out how to get the data using Java. Protected files, certainly.

You might want to move all the hard coded items into some sort of external configuration e.g. read them from DDs. The sample isn't intended to be the ideal solution, it is intended as a working example of what can be done, expected to be extended and modified as required. While you don't want to hard code stuff in production code, it often makes things clearer in a sample where you just want to understand the code. Abstraction etc. can be desirable in production code because it hides implementation details, but the details are what you want to see in a sample.

What about headers?  Ideally, I might expect:
     From: z/OS-ID
     Sender: "smtp-username"
You can set headers as required:
https://javaee.github.io/javamail/docs/api/javax/mail/internet/MimeMessage.html#setHeader-java.lang.String-java.lang.String-
also:
https://javaee.github.io/javamail/docs/api/javax/mail/internet/MimeMessage.html#setReplyTo-javax.mail.Address:A-

What your mail server allows is a different question - but part of the original question was how to enforce corporate mail standards on mail originating from z/OS.

Might these be publicized (not stored) on CBTTAPE.org to attract
users to Black Hill's storefront?

They could certainly be linked etc. from cbttape.org. I'm not sure whether they would be suitable for the CBT tape itself since it's really just a sample, not something you would use in production. I have some ideas for other Java utilities that could be candidates for the CBT tape however...

--
Andrew Rowley
Black Hill Software
+61 413 302 386

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to