look into provided standalone.xml where you can find simple example how to configure javamail. just look for mail subsystem.
here are some other options you can use (some of them where added in latest 7.1.0.Final-SNAPSHOT nightly builds)
<subsystem xmlns="urn:jboss:domain:mail:1.0"> <mail-session jndi-name="java:/Mail" from="name dot surname at domain dot tld" > <smtp-server outbound-socket-binding-ref="mail-smtp" ssl="true"> <login name="nobody" password="pass"/> </smtp-server> <pop3-server outbound-socket-binding-ref="mail-pop3"/> <imap-server outbound-socket-binding-ref="mail-imap"> <login name="nobody" password="pass"/> </imap-server> </mail-session> <mail-session debug="true" jndi-name="java:jboss/mail/Default" > <smtp-server outbound-socket-binding-ref="mail-smtp"/> </mail-session> </subsystem>
hope it helps,
Thanks a lot for example. Btw is there any example how to configure correctly SMTPS?:-)
1 of 1 people found this helpful
flag ssl=true controls that. there was also discusion on this matter here:
http://community.jboss.org/message/639131 there is also a sample config for using gmail's smtp
But please for using ssl + authenfication to smtp(s), use latest nightly build. (any build from this year will be fine)
Thanks Tomaz again,
one more thing which is also mentioned in the thread u sent. I'm trying to set-up an gmail imap and Im getting
530 5.7.0 Must issue a STARTTLS command first.
I'm using 7.1. CR1 from downloads page. Should I try later nighly build or the problem is elsewhere?
1 of 1 people found this helpful
you can connect to google via SSL not TLS, I have not managed to make TLS work, Google has also SSL port for all services but it does not adviertize it as much.
Can you please try with that. And yes CR1 does not have support for that. I missed deadline for few hours, It is in all nightly builds after new year. Can you try with them first.
As for TLS goes, I would like to see what kind of properties did you use in manual config (or before AS7) that made it work? Can you create an jira issue for that and describe it.
As just adding "mail.smtp.starttls.enable" did not work for me.
But then again, this property is in current implementation of AS7 only set for smtp protocol and I was only trying to make it work with SMTP
Well .. thanks again:-)
Actually I don't need TLS, I was searching for correct SSL port of GMAIL. I maybe mislooked, tried both 465 and 587 but again the server is requesting starttls command. Can you please tell me what SSL port did you tried for gmail?
Btw my configuration (maybe i mislooked something):
<remote-destination host="smtp.gmail.com" port="465"/>
<login username="xyz" password=xyz" ssl="true"/>
Im sorry, am I missing something?
Make sure you are using nightly build after 2. of january this year.
and sample config is this:
<mail-session jndi-name="java:/Mail" debug="true"> <smtp-server ssl="true" outbound-socket-binding-ref="mail-smtp"> <login name="user dot name at gmail dot com" password="password"/> </smtp-server> </mail-session> ... ... <outbound-socket-binding name="mail-smtp"> <remote-destination host="smtp.gmail.com" port="465"/> <--! please note 465 is SSL that works, 587 is TLS and currently does not work --> </outbound-socket-binding>
Just use this config and replace username and password and it should work.
Sorry for a little late answer but with lastest build I made it finally working. Once again, thanks Tomaz for your time and helpful anwers. Cheers
Sorry for wakening long sleeping thread.
How to make mail session login delegated to JAAS, just like datasource connection. Im using jboss 7.2.
I took a peek at the source of mail subsystem and I know it is not supported out of the box.
Can you point me to the right direction whether to,
1. enhance mail subsystem to support jaas login. im ready to get my hand dirty. i know a bit about jboss 7 architecture, however some hint and directions wouldnt hurt. or..
2. implement mail as jca resource. if i assume correctly jca subsystem does support security-domain.