Forums de discussion

EMail puzzles

thumbnail
Jeff Zhuk, modifié il y a 14 années.

EMail puzzles

Junior Member Publications: 64 Date d'inscription: 09/09/09 Publications récentes
Email notification is not working at my Liferay installation.
In the Tomcat log there is the line about "cannot connect to the localhost port 25"

Context.xml is configured to access smtp.gmail.com, I don't see any reference to the mail server on the localhost.
Here is the extract from the tomcat/conf/context.xml

<Resource name="mail/MailSession" auth="Container" type="javax.mail.Session"
mail.imap.host="imap.gmail.com" mail.imap.port="993" mail.imap.socketFactory.class="javax.net.ssl.SSLSocketFactory"
mail.pop.host="pop.gmail.com" mail.store.protocol="imap"
mail.transport.protocol="smtp" mail.smtp.host="smtp.gmail.com"
mail.smtp.port="465" mail.smtp.auth="true"
mail.smtp.starttls.enable="true"
mail.smtp.user="GMAIL-ID" password="GMAIL-PSW"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>

It would be great if someone can explain why Liferay tries to connect to "localhost port 25" (no mail server is located on the localhost)
What is missing?

Another question is about PasswordChangeNotification.
This option is ENABLED via the Enterprise Admin -> Email Notifications -> PasswordChangeNotification
Nevertheless, after changing password there is no attempts visible in the log file to issue email.

Thank you for your help,

Jeff
thumbnail
Jonas Yuan, modifié il y a 14 années.

RE: EMail puzzles

Liferay Master Publications: 993 Date d'inscription: 27/04/07 Publications récentes
Hi Jeff,

You need two things to cover for mail engine settings.

1) enable the JNDI name to lookup the Java Mail session
set
mail.session.jndi.name=mail/MailSession 

in portal-ext.properties

2) update ROOT.xml under $TOMCAT_AS_DIR/conf/Catalina/localhost with following

	<resource name="mail/MailSession" auth="Container" type="javax.mail.Session" mail.imap.host="imap.gmail.com" mail.imap.port="993" mail.pop.host="pop.gmail.com" mail.store.protocol="imap" mail.transport.protocol="smtp" mail.smtp.host="smtp.gmail.com" mail.smtp.port="465" mail.smtp.auth="true" mail.smtp.starttls.enable="true" mail.smtp.user="username" password="password" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />	

Note that using your own account.

Hope that it helps;

Thanks

Jonas Yuan
-----------------
The Author of Liferay Books:
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
thumbnail
Jeff Zhuk, modifié il y a 14 années.

RE: EMail puzzles

Junior Member Publications: 64 Date d'inscription: 09/09/09 Publications récentes
Jonas,

Thank you for the hint!
1) Moving the Resource lines from the tomcat/conf/context.xml to the tomcat/conf/Catalina/localhost/ROOT.xml and adding the jndi line to the tomcat/webapps/ROOT/WEB-INF/classes/portal-ext.properties file solved one puzzle: email is working producing the New Account notification.

2) The PasswordChangeNotification is not issued in spite it is enabled. It is not crucial because a user can see the password on the screen but still desirable. In the scenario when someone else (not a valid user) had access to the screen and has changed the password, a valid user would be notified via the email.

Did I miss something besides the ENABLE checkbox (it was checked by default) in the configuration?

3) I downloaded the latest sources and would like to use Eclipse to work with them. What is the best way to bring sources under Eclipse?
Trying to copy src folder into a new project didn't work well. Any advice?

Thank you so much!
P.S. Looking forward to reading your books (I worked with the Liferay in the past, but there are a lot of changes during the recent months)

Jeff
thumbnail
Jonas Yuan, modifié il y a 14 années.

RE: EMail puzzles

Liferay Master Publications: 993 Date d'inscription: 27/04/07 Publications récentes
Hi Jeff,

1) Moving the Resource lines from the tomcat/conf/context.xml to the tomcat/conf/Catalina/localhost/ROOT.xml and adding the jndi line to the tomcat/webapps/ROOT/WEB-INF/classes/portal-ext.properties file solved one puzzle: email is working producing the New Account notification.

Great!

2) The PasswordChangeNotification is not issued in spite it is enabled. It is not crucial because a user can see the password on the screen but still desirable. In the scenario when someone else (not a valid user) had access to the screen and has changed the password, a valid user would be notified via the email.
Did I miss something besides the ENABLE checkbox (it was checked by default) in the configuration?


Do you get it solved?

You can configure this in Control Panel. And Liferay Portal permissions system is powerful. You can can control permissions as you want.

3) I downloaded the latest sources and would like to use Eclipse to work with them. What is the best way to bring sources under Eclipse?
Trying to copy src folder into a new project didn't work well. Any advice?

I believe that the book will give you more details.
Liferay Portal 5.2 Systems Development

P.S. Looking forward to reading your books (I worked with the Liferay in the past, but there are a lot of changes during the recent months)


Hope that the book helps.

Jonas Yuan
-----------------
The Author of Liferay Books:
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
thumbnail
Jeff Zhuk, modifié il y a 14 années.

RE: EMail puzzles

Junior Member Publications: 64 Date d'inscription: 09/09/09 Publications récentes
Hi Jonas!

>2) The PasswordChangeNotification is not issued in spite it is enabled.

Still not solved although it was configured via the Control Panel

>3) Working with Eclipse - yes, solved!

>P.S. Looking forward to reading your books - work in progress

Thank you!

Jeff
thumbnail
Jonas Yuan, modifié il y a 14 années.

RE: EMail puzzles

Liferay Master Publications: 993 Date d'inscription: 27/04/07 Publications récentes
Hi Jeff,

Need full settings in Java Mail (using GMail as an example) like:

mail.session.mail.pop3.host=pop.gmail.com
mail.session.mail.pop3.password=
mail.session.mail.pop3.port=110
mail.session.mail.pop3.user=
mail.session.mail.imap.host=imap.gmail.com
mail.session.mail.imap.port=993
mail.session.mail.store.protocol=imap
mail.session.mail.transport.protocol=smtp 
mail.session.mail.smtp.host=smtp.gmail.com 
mail.session.mail.smtp.password=password 
mail.session.mail.smtp.user=user
mail.session.mail.smtp.port=465 
mail.session.mail.smtp.auth=true 
mail.session.mail.smtp.starttls.enable=true 
mail.session.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

You would be able to add above lines at the end of portal-ext.properties first.

The Control Panel use default settings like:
    mail.session.mail.pop3.host=localhost
    mail.session.mail.pop3.password=
    mail.session.mail.pop3.port=110
    mail.session.mail.pop3.user=
    mail.session.mail.smtp.auth=false
    mail.session.mail.smtp.host=localhost
    mail.session.mail.smtp.password=
    mail.session.mail.smtp.port=25
    mail.session.mail.smtp.user=
    mail.session.mail.store.protocol=pop3
    mail.session.mail.transport.protocol=smtp


This is the reason that it was not solved configured via the Control Panel. It seems a bug for the UI of mail configuration via the Control Panel. Fortunately, you can manually specify additional JavaMail properties to override the above configuration via Advanced Properties.

Got it?

Jonas Yuan
-----------------
The Author of Liferay Books:
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
thumbnail
bergkamp sliew, modifié il y a 14 années.

RE: EMail puzzles

New Member Publications: 18 Date d'inscription: 08/11/09 Publications récentes
hi jonas,

hope you can help out with my problem.

i'm using liferay 5.2.3+tomcat and customised the email settings based on your posting.
during the new user account creation, it went well with email notification being sent to the user.
but... it didn't work for the events like password changed and subscription of particular web content (such as General, News, etc.).
no java exception was generated in the log, as well as no entries in my mail server (i'm using postfix).

pls advise, thx.
thumbnail
bergkamp sliew, modifié il y a 14 années.

RE: EMail puzzles

New Member Publications: 18 Date d'inscription: 08/11/09 Publications récentes
I found the solution for my problem emoticon
I used the wrong GUI (the one under Web Content) for announcements purpose.
When I create a web content, there's a category option which consists of "Announcement" related attribute like "General", "News",...
I think I got confused with both of these applications (Web Content & Announcements).

Anyway, it's working now, thanks.
thumbnail
Jeff Zhuk, modifié il y a 13 années.

RE: EMail puzzles

Junior Member Publications: 64 Date d'inscription: 09/09/09 Publications récentes
Thanks!

Jeff
thumbnail
Akash Jaisawal, modifié il y a 9 années.

RE: EMail puzzles

Regular Member Publications: 141 Date d'inscription: 03/03/12 Publications récentes
Hello Juan,

i am facing some problem regarding mail. i have a group portlet, when any user(user-z) remove group from his account a mail comes to "group admin" that user-Z remove account.
but it still contains ${User} in email.
email must contains group's owner name instead of ${User}

any help?
kapil m mathur, modifié il y a 14 années.

RE: EMail puzzles

New Member Publications: 17 Date d'inscription: 03/12/09 Publications récentes
hi Jeff,
I am using Liferay 5.2.3 with tomcat bundle.I am not getting how to configure mail server,I am login to the portal using test@liferay.com account and I want to send configure mail server but my mail server is installed on another machine and i know the IP address of that machine and I m confused in parameter
mail.smtp.user="username"
password="password"

Shall I mentioned my username say for eg,kapilm@gmail.com and at password place my real password.


I also want to setup Liferay 5.2.3 source code using eclipse plz help me out,I searched it but most of the documents were outdated.

WAiting for your reply.
thumbnail
Jeff Zhuk, modifié il y a 13 années.

RE: EMail puzzles

Junior Member Publications: 64 Date d'inscription: 09/09/09 Publications récentes
Kapil,

That's exactly right, use your email address as the "username" property and your email password as the "password" property.

For Eclipse settings, see my post "Using Eclipse".

Sorry for the late response, I didn't visit the site for a long time.

Jeff