Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ankur Agarwal
Not Able to Send Email from Liferay
April 10, 2012 5:33 AM
Answer

Ankur Agarwal

Rank: New Member

Posts: 20

Join Date: March 27, 2012

Recent Posts

I am facing problems in setting up a mail server, when i click on the Forgot Password? link and provide the email id it shows request proccessed succesfully.
But i get the following error in the console :
12:23:37,689 ERROR [MailEngine:489] 554 Mail from test@liferay.com rejected for policy reasons.

12:23:37,690 ERROR [MailEngine:154] com.sun.mail.smtp.SMTPSendFailedException: 554 Mail from test@liferay.com rejected for policy reasons.

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at com.liferay.util.mail.MailEngine._send(MailEngine.java:465)
at com.liferay.util.mail.MailEngine.send(MailEngine.java:366)
at com.liferay.util.mail.MailEngine.send(MailEngine.java:110)
at com.liferay.mail.messaging.MailMessageListener.doMailMessage(MailMessageListener.java:101)
at com.liferay.mail.messaging.MailMessageListener.doReceive(MailMessageListener.java:115)
at com.liferay.mail.messaging.MailMessageListener.receive(MailMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:63)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:61)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Can You please provide help? Where do i need to make the changes as in Server Administration>Mail or Control Panel>Portal Settings>Main Configuration
Thanks in Advance.......
David H Nebinger
RE: Not Able to Send Email from Liferay
April 10, 2012 5:38 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11314

Join Date: September 1, 2006

Recent Posts

You don't have to do anything, your Liferay install is just right.

Instead, look to the stack trace and resolve the real issue. It's reporting that the email is rejected due to policy reasons. Your mail server has determined that the email should be rejected.

Since I see the test@liferay.com is being rejected, I'm guessing that it might be complaining about the sender email address. You might need to go to the Settings control panel then to the Email Notifications page and make some changes there.
Prakash Khanchandani
RE: Not Able to Send Email from Liferay
April 10, 2012 6:15 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Check these settings:

## Mail Properties
mail.session.mail.smtp.auth=true
mail.session.mail.smtp.host=
mail.session.mail.smtp.password=
mail.session.mail.smtp.port=25
mail.session.mail.smtp.user=
mail.session.mail.transport.protocol=smtp
David H Nebinger
RE: Not Able to Send Email from Liferay
April 10, 2012 6:24 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11314

Join Date: September 1, 2006

Recent Posts

These are only used during the first launch of Liferay. Afterwards, mail settings come from the database (set via the control panel).

That plus non of the settings address why test@liferay.com would have been rejected by the mail server. Obviously it is connecting to the mail server and attempting the email send...
Hitoshi Ozawa
RE: Not Able to Send Email from Liferay
April 10, 2012 6:56 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

As David said, it's probably because your email server is setup to reject email that's not in your company domain.
That's why it's rejecting email from @liferay.com.

Go to Control Panel -> Portal Settings and setup your portal's email address to be that of your company.
You may also be required to enter authorized email user and password to send email.
Ankur Agarwal
RE: Not Able to Send Email from Liferay
April 10, 2012 11:07 PM
Answer

Ankur Agarwal

Rank: New Member

Posts: 20

Join Date: March 27, 2012

Recent Posts

Hi,
Thanks Hitoshi !
I changed the domain from liferay.com to my company domain, in Control Panel>Portal Settings>General>Main Configuration Mail Domain.
But i could not find where to add the valid username and password, are we talking about Server Administration>Mail and filling up the details there?
Under Control Panel>Portal Settings>Email Notifications i also set the Senders Name and Address.
But i am still getting the same error.
Where can i view/change the policy?
If any can provide help, please...!
Dhrutika Vyas
RE: Not Able to Send Email from Liferay
April 10, 2012 11:17 PM
Answer

Dhrutika Vyas

Rank: Expert

Posts: 438

Join Date: February 9, 2009

Recent Posts

Hi,

Yes you need to do mail setting under Server Administration> Mail

There you need to provide smtp server,user name ,password and port number.

Regards,
Dhrutika
Ankur Agarwal
RE: Not Able to Send Email from Liferay
April 11, 2012 3:35 AM
Answer

Ankur Agarwal

Rank: New Member

Posts: 20

Join Date: March 27, 2012

Recent Posts

Hi Dhrutika,
I have made the changes in the Server Administration>Mail,
But i guess my understanding is not clear can you please provide me the meaning of the fields present there and what each field represents/does:
Incoming POP Server
Incoming Port
Check Box - Use Secure Network Connection
Username
Password

Outgoing SMTP Server
Outgoing Port
Check Box - Use Secure Network Connection
Username
Password

As i am new to liferay, Thanks in adv
Ankur Agarwal
RE: Not Able to Send Email from Liferay
April 11, 2012 5:49 AM
Answer

Ankur Agarwal

Rank: New Member

Posts: 20

Join Date: March 27, 2012

Recent Posts

Hi All,
Thanks for your help!
I was finally able to set up the mail server and send mails for forgot password functionality... emoticon
For other functionalties too i am hopeful that it will work
Prakash Khanchandani
RE: Not Able to Send Email from Liferay
April 13, 2012 2:11 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Yes exactly. Thanks.
Shankar Baba
RE: Not Able to Send Email from Liferay
December 14, 2012 9:56 PM
Answer

Shankar Baba

Rank: Regular Member

Posts: 144

Join Date: October 17, 2012

Recent Posts

Ankur Agarwal:
Hi All,
Thanks for your help!
I was finally able to set up the mail server and send mails for forgot password functionality... emoticon
For other functionalties too i am hopeful that it will work



Hi, Ankur can u explain me how you achieved this, iam not able to configure the mail server for gmail, my requirement is when i add a webcontent as a user mail should be sent to all users under the organization, for this what should i do?