Forum

Accueil » Liferay Portal » English » 2. Using Liferay » General

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Jeff Zhuk
EMail puzzles
16 octobre 2009 15:24
Réponse

Jeff Zhuk

Rang: Junior Member

Publications: 64

Date d'inscription: 9 septembre 2009

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
Jonas Yuan
RE: EMail puzzles
16 octobre 2009 16:40
Réponse

Jonas Yuan

Rang: Liferay Master

Publications: 993

Date d'inscription: 26 avril 2007

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
1mail.session.jndi.name=mail/MailSession

in portal-ext.properties

2) update ROOT.xml under $TOMCAT_AS_DIR/conf/Catalina/localhost with following
 1
 2    <Resource
 3        name="mail/MailSession"
 4        auth="Container"
 5        type="javax.mail.Session"
 6        mail.imap.host="imap.gmail.com"
 7        mail.imap.port="993"
 8        mail.pop.host="pop.gmail.com"
 9        mail.store.protocol="imap"
10        mail.transport.protocol="smtp"
11        mail.smtp.host="smtp.gmail.com"
12        mail.smtp.port="465"
13        mail.smtp.auth="true"
14        mail.smtp.starttls.enable="true"
15        mail.smtp.user="username"
16        password="password"
17        mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
18    />   

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
Jeff Zhuk
RE: EMail puzzles
17 octobre 2009 11:01
Réponse

Jeff Zhuk

Rang: Junior Member

Publications: 64

Date d'inscription: 9 septembre 2009

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
Jonas Yuan
RE: EMail puzzles
25 octobre 2009 08:12
Réponse

Jonas Yuan

Rang: Liferay Master

Publications: 993

Date d'inscription: 26 avril 2007

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
Jeff Zhuk
RE: EMail puzzles
4 novembre 2009 12:23
Réponse

Jeff Zhuk

Rang: Junior Member

Publications: 64

Date d'inscription: 9 septembre 2009

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
Jonas Yuan
RE: EMail puzzles
7 novembre 2009 08:33
Réponse

Jonas Yuan

Rang: Liferay Master

Publications: 993

Date d'inscription: 26 avril 2007

Publications Récentes

Hi Jeff,

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

 1mail.session.mail.pop3.host=pop.gmail.com
 2mail.session.mail.pop3.password=
 3mail.session.mail.pop3.port=110
 4mail.session.mail.pop3.user=
 5mail.session.mail.imap.host=imap.gmail.com
 6mail.session.mail.imap.port=993
 7mail.session.mail.store.protocol=imap
 8mail.session.mail.transport.protocol=smtp
 9mail.session.mail.smtp.host=smtp.gmail.com
10mail.session.mail.smtp.password=password
11mail.session.mail.smtp.user=user
12mail.session.mail.smtp.port=465
13mail.session.mail.smtp.auth=true
14mail.session.mail.smtp.starttls.enable=true
15mail.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:
 1    mail.session.mail.pop3.host=localhost
 2    mail.session.mail.pop3.password=
 3    mail.session.mail.pop3.port=110
 4    mail.session.mail.pop3.user=
 5    mail.session.mail.smtp.auth=false
 6    mail.session.mail.smtp.host=localhost
 7    mail.session.mail.smtp.password=
 8    mail.session.mail.smtp.port=25
 9    mail.session.mail.smtp.user=
10    mail.session.mail.store.protocol=pop3
11    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
bergkamp sliew
RE: EMail puzzles
8 novembre 2009 01:23
Réponse

bergkamp sliew

Rang: New Member

Publications: 18

Date d'inscription: 8 novembre 2009

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.
bergkamp sliew
RE: EMail puzzles
27 novembre 2009 05:52
Réponse

bergkamp sliew

Rang: New Member

Publications: 18

Date d'inscription: 8 novembre 2009

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.
kapil m mathur
RE: EMail puzzles
18 janvier 2010 01:07
Réponse

kapil m mathur

Rang: New Member

Publications: 17

Date d'inscription: 3 décembre 2009

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.
Jeff Zhuk
RE: EMail puzzles
26 avril 2010 06:53
Réponse

Jeff Zhuk

Rang: Junior Member

Publications: 64

Date d'inscription: 9 septembre 2009

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
Jeff Zhuk
RE: EMail puzzles
26 avril 2010 06:54
Réponse

Jeff Zhuk

Rang: Junior Member

Publications: 64

Date d'inscription: 9 septembre 2009

Publications Récentes

Thanks!

Jeff
Akash Jaisawal
RE: EMail puzzles
9 juin 2014 05:39
Réponse

Akash Jaisawal

Rang: Junior Member

Publications: 75

Date d'inscription: 3 mars 2012

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?