Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Fabio Foglia
postmaster email validation fail in 6.0.6
June 12, 2012 12:48 AM
Answer

Fabio Foglia

Rank: Junior Member

Posts: 61

Join Date: September 2, 2011

Recent Posts

Hello,

if I try to create a user with email startong with postmaster@... the operation fails !!!

The problem came out on:

UserLocalServiceUtil.addUser

Caused by: com.liferay.portal.UserEmailAddressException at com.liferay.portal.service.impl.UserLocalServiceImpl.validateEmailAddress(UserLocalServiceImpl.java:3143) at com.liferay.portal.service.impl.UserLocalServiceImpl.validate(UserLocalServiceImpl.java:3084)
at com.liferay.portal.service.impl.UserLocalServiceImpl.addUser(UserLocalServiceImpl.java:344)

It seems to be fixed there:

http://issues.liferay.com/browse/LEP-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs

but the problem is already present in 6.0.6.

How can I resolve or skip the validation?
Samuel Kong
RE: postmaster email validation fail in 6.0.6
June 12, 2012 2:18 AM
Answer

Samuel Kong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1383

Join Date: March 10, 2008

Recent Posts

postmaster@ is a reserved email address and cannot be used.

LEP-4083 fixes Validator.isEmailAddress(). It's not directly related to your issue.
Fabio Foglia
[RESOLVED] RE: postmaster email validation fail in 6.0.6
June 12, 2012 2:44 AM
Answer

Fabio Foglia

Rank: Junior Member

Posts: 61

Join Date: September 2, 2011

Recent Posts

Hello,

thanks for reply.

Next question is:

So If I have a customer that wants to create a user with postmaster account, the only possible solution is to abandon Liferay for another product?

It don't seems a good solution. The right seems to leave this setting to be configurable and not HARD CODED !!!

The funny stuff is that "com.liferay.portal.kernel.util.Validator.isEmailAddress" go over well and the operation fails on "UserLocalServiceUtil.addUser".

Well. Following a work-aroud found:

1) Create the accound with xpostmaster@domain.com (instead of postmaster@domain.com), so you can create the user with "UserLocalServiceUtil.addUser"
2) Use "UserLocalServiceUtil.updateUser" to fix the email address to the right one

Best regards

Fabio
Samuel Kong
RE: postmaster email validation fail in 6.0.6
June 18, 2012 3:10 AM
Answer

Samuel Kong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1383

Join Date: March 10, 2008

Recent Posts