Foren

One more try at Message Board email sending and delivery

thumbnail
Pete Helgren, geändert vor 12 Jahren.

One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
There is still much mystery surrounding the email functionality in LR. I am running 6.0.6 on Glassfish and after a couple of months of installing, uninstalling, tweaking and a certain amount of hair pulling, I still don't have it working.

I see the following message in the server.log file:
[#|2011-09-30T18:55:44.130-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=8;_ThreadName=Thread-8;|18:55:44,130 ERROR [MailingListMessageListener:69] javax.mail.AuthenticationFailedException: Protocol error.
javax.mail.AuthenticationFailedException: Protocol error.
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:208)

So the first question is: Is it complaining about the authentication (User ID/Password) OR is it complaining about the protocol used (Maybe it wants IMAP instead of POP3?) In any case, that message is logged regularly in GF. I know that the userid/password combination is OK because I created an account in my mail client using the same parameters (presumably) passed in LR. I can access the mail account and retrieve messages. Apparently Liferay cannot.

So the next questions are:

1. Is the proper place to configure email in portal-ext.properties or can it all be done through the GUI or should it be done in GF with a JNDI entry?
2. If there are entries in BOTH places, does one take precedence?

And, an enhancement suggestion: Could you add a "Test" button to all the email configuration setting panels so that you can get immediate feedback about these settings? Trial and error and debugging is a poor way to troubleshoot. Just a "Test the settings" button would probably solve 90% of the issues.

Thanks,

Pete
Michael Harper, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Junior Member Beiträge: 56 Beitrittsdatum: 10.08.11 Neueste Beiträge
Pete Helgren:
So the next questions are:

1. Is the proper place to configure email in portal-ext.properties or can it all be done through the GUI or should it be done in GF with a JNDI entry?
2. If there are entries in BOTH places, does one take precedence?


I haven't messed around with the emailing portion of LR yet, but I can at least answer these questions.

#1 - Either way is fine, it just depends whether you are more comfortable with the GUI or the properties file.
#2 - If you have changed/saved any settings in the GUI, it will take precedence as those are saved in the database and any settings in the database take precedence over settings in the properties file.

Hope this helps answer at least a portion of what you are needing.

~ Mike
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
Thanks! Now, if someone can tell me what those settings *should* be to get it all to work, I'll have it done.

Pete
Michael Harper, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Junior Member Beiträge: 56 Beitrittsdatum: 10.08.11 Neueste Beiträge
Can you post a screenshot of you 'Mail" tab under Server Administration?

Just blank out the username & password.

or are you setting it in the properties file instead of the gui?
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
I am setting it in a properties file AND also in the GUI which is what triggered the question. Here is what I have in portal-ext.properties:

mail.session.mail.imap.host=10.0.10.2
mail.session.mail.imap.port=143
mail.session.mail.imap.user=userid
mail.session.mail.imap.password=password

mail.session.mail.smtp.host=10.0.10.2
mail.session.mail.smtp.port=25
#mail.session.mail.smtp.auth=true
mail.session.mail.smtp.user=userid
mail.session.mail.smtp.password=password

mail.session.mail.pop.host=10.0.10.2
mail.session.mail.pop.port=110
#mail.session.mail.pop.auth=true
mail.session.mail.pop.user=userid
mail.session.mail.pop.password=password

mail.session.mail.transport.protocol=smtps
mail.session.mail.smtps.host=smtp.gmail.com
mail.session.mail.smtps.port=465
mail.session.mail.smtps.auth=true
mail.session.mail.smtps.starttls.enable=true
mail.session.mail.smtps.user=mygmailemail@gmail.com

The plan is to use the email settings to send out new portal registration emails, all message board emails and email from one of the portal applications we have created (those are the SMTPS settings). And, the plan was to use POP to retrieve the emails sent back to the message board. Some of the messages ARE getting sent because I get a notification email when I register a new user (for example). When I create an account using my email client to access the message board "administrator" account that is the clearing house for the message board I do get the emails for that account (the "Email From" account). So *some* of this is working. What Isn't working is that when someone posts a new message IN the forum no email is received notifying the subscriber of that post. And, the second problem is the one I identified where I get repeated errors in the server.log about the POP authentication.

Here is the screen shot of the Email Configuration in Control Panel (FWIW): http://www.petesworkshop.com/images/LR_Email_Settings.jpg



The exchange server is on the internal network at 10.0.10.2. I also have another servlet application, hosted on the same server running javamail with identical settings and it works fine (for SMTP, I don't receive mail in that application so there are no POP3 settings). I don't think it is a firewall issue but I could run some traces to find out.

Not sure where to go to from here. It sure has been more difficult than it looked.....

Pete
Michael Harper, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Junior Member Beiträge: 56 Beitrittsdatum: 10.08.11 Neueste Beiträge
Just to eliminate an easy question, in the GUI settings, have you tried with 'Use a Secure network Connection' checked?
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
I have exchange set up to use basic authentication with userid and password sent in clear text. I think the "Secure" option requires SSL/TLS which the server isn't configured for. Right now I am trying a couple of different settings in LR and watching and logging email traffic to see if I can see any errors. So far I haven't seen anything unusual. I am assuming that a change to portal-ext.properties requires a restart, which takes quite a while in Glassfish.....
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
The SMTP stuff is now working correctly but the POP3 still isn't working. I still see the error in server.log and exchange shows that messages are accumulating in the mailbox so I know stuff is getting there, LR just can't retrieve it with POP3.

Is there any way to turn on diagnostic debugging in detail? Maybe showing the protocol being used, the IP address and the user id being passed. If I can sort this out I can move on to more interesting things about LR.....

Thanks.
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
Man! It is a bummer when a thread dies and early death with unanswered questions.....
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
Still answering my own questions and posts. Pete to LifeRay team: Trial and error is no way to debug and document a product. Time to invest in a step by step tutorial for any post in this forum that has more than 20 posts on the subject!

So, to answer my question about "How to debug" the email processing:
I added the following to portal-ext.properties:
mail.debug=true
mail.session.mail.debug=true
The TWO debug statements were added because I can't find any documentation on how to add these properties to the file. Do they need to have "mail.session" appended to the property name to work in LR? (Who knows!?)

But one of those entries did the trick and I get VERY verbose output. And I learned that my SMTP is working fine (which I knew anyway since mail was delivered when a post was made) More suprizingly I saw that the POP3 access was working fine. To whit (edited version of verbosity):

|S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 signing off.|#]
|DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]|#]
|DEBUG POP3: mail.pop3.rsetbeforequit: false|#]
|DEBUG POP3: mail.pop3.disabletop: false|#]
|DEBUG POP3: mail.pop3.forgettopheaders: false|#]
|DEBUG POP3: mail.pop3.cachewriteto: false|#]
|DEBUG POP3: mail.pop3.filecache.enable: false|#]
|DEBUG POP3: mail.pop3.keepmessagecontent: false|#]
|DEBUG POP3: mail.pop3.starttls.enable: false|#]
|DEBUG POP3: mail.pop3.starttls.required: false|#]
|DEBUG POP3: mail.pop3.apop.enable: false|#]
|DEBUG POP3: mail.pop3.disablecapa: false|#]
|DEBUG POP3: connecting to host "mydomaingroup.com", port 110, isSSL false|#]
|S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 (server.mydomain.local) ready.|#]
|C: CAPA|#]
|S: +OK Capability list follows|#]
|TOP
|USER
|PIPELINING
|EXPIRE NEVER
|UIDL
|SASL NTLM
|.
|DEBUG POP3: PIPELINING enabled|#]
|C: USER myuserid|#]
|S: +OK|#]
|C: PASS mypassword|#]
|S: +OK User successfully logged on.|#]
|C: STAT|#]
|S: +OK 0 0|#]
|C: NOOP|#]
|S: +OK|#]
|C: QUIT|#]
|S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 signing off.|#]

What is interesting is that I don't see the messages ending up BACK in the forum and it appears that the messages ARE being properly retrieved. So, the next question (that I'll probably have to answer myself) is: WHERE are the messages going?

As far as the AutherticationFailedException is concerned, it seems to be thrown every 4th or 5th attempt to connect to the server. The verbose version is this:

[#|2011-10-12T09:24:50.546-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=7;_ThreadName=Thread-8;|S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 signing off.|#]

[#|2011-10-12T09:25:44.075-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=6;_ThreadName=Thread-8;|09:25:44,075 ERROR [MailingListMessageListener:69] javax.mail.AuthenticationFailedException: Protocol error.
javax.mail.AuthenticationFailedException: Protocol error.
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:208)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at com.liferay.portlet.messageboards.messaging.MailingListMessageListener.getFolder(MailingListMessageListener.java:112)
at com.liferay.portlet.messageboards.messaging.MailingListMessageListener.receive(MailingListMessageListener.java:62)
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:898)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:920)
at java.lang.Thread.run(Thread.java:736)
|#]

[#|2011-10-12T09:25:50.482-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=9;_ThreadName=Thread-8;|DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]|#]

[#|2011-10-12T09:25:50.484-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=9;_ThreadName=Thread-8;|DEBUG POP3: mail.pop3.rsetbeforequit: false|#]

[#|2011-10-12T09:25:50.485-0600|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=9;_ThreadName=Thread-8;|DEBUG POP3: mail.pop3.disabletop: false|#]

Based on the prior POP3 transactions it looks like the exception is thrown right after the logging off. I don't see anything else, code wise, that would cause it. So it might just be a Red Herring....

If I can sort out the rest of this problem (the missing POP3 messages that should post back to the forum), probably without help from the LR team, I'll post the results.

CLOSE!
thumbnail
Drew Blessing, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Junior Member Beiträge: 78 Beitrittsdatum: 27.01.11 Neueste Beiträge
Hi Pete.

I'm sorry more people weren't able to reply to this post and help you out. In response to your message to the Liferay team...

The staff that do post here do so out of the kindness of their hearts and in free time. The point of these forums is for community members to collaborate and help each other out. It is not uncommon to see a staff member replying here but that's definitely not what we should expects 100% of the time.

If you do require personal support and response from the Liferay staff, I would suggest an Enterprise License. Also, community members may contribute to the wiki and documentation. If you're interested in contributing, head over to the wiki and check out the posting guidelines.

Thanks!
PS I am in no way affiliated with Liferay and my views should not be attributed as such.
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
Thanks Drew. Yep. I know that this is a community, not a commercial forum. I support a few open source projects myself, so I know the balance of time vs revenue.
I don't want to get into a philosophical discussion about how to manage an open source project when you have both a community and commercial offering but I do have access to someone who has an Enterprise license and their experience, though better, isn't compelling enough for me to pursue an enterprise license. I usually use the community support as a bellwether of what a commercial offering will look like. And based on what I have experienced so far, the LR team does an OK job here but I would do things a little differently. What you want is to have your users have such a good experience that they will pay the upcharge for great experience.

You'll also notice, for the rest of the posts *I* have made here, that when I DO finally find the answer, through trial and error, or just dumb luck, I'll post back my solution. The challenge has been *getting* to that solution so I can post back.... ;-)

I DO appreciate any help and feedback and I appreciate your perspective.
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery (Antwort)

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
Yeah, trial and error eventually DO work out. I have most of the message board emailing functionality working now. As an FYI:

This is still a bit of a mystery but I can tell you what I did. There may be some irrelevant info since I have tried so many things. All of this relates to using the message board with Exchange 2003:

I have the portal-ext.properties and the mail settings for the LR instance listed above (Oct 7 8:10am). The most important thing here is that we are working with several different places to configure. The first place is in Email Configuration in the control panel. The second place is the email settings in the message board portlet itself and finally, in EACH category that you set up. Check each one of those settings. I created a single user account for the message board but then I added the additional email addresses for EACH category.

So, if I created a user called mbadmin and it was at my_domain.com then the email setting on the message board (Email from) would be mbadmin@my_domain.com and I also used mbadmin as the user (with the appropriate password) for the email settings in Email Configuration.

I had three categories on the message board: projects, issues, discussion so I created three email addresses for mbadmin:
projects.forum@my_domain.com
issues.forum@my_domain.com
discussion.forum@my_domain.com

I *think* those email addresses allow LR to find the right category to drop the responses into so they are important AND the .forum suffix IS important. I also think it is important to make sure the email domain in the portal settings matches the domain that is used to send/receive email (although I can't be sure).

Once I got the additional email addresses added to the user account used to send/receive the email, that seems to take care of the rest of the problems.

There IS an open issue though: There is a bug, apparently, that prevents the reply-to email address from being populated. It looks like I'll have to hack a fix for that in order to get it to work. Right now you have to manually add the reply to address.

So, one more self-fixed LR problem! I hope this helps someone else in the struggle to use Liferay......
thumbnail
Zeeshan Khan, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
Great work Pete....cheers !!

i need ur help in this....


after adding the line <aui:input name="file" type="file" /> in the WEBFORM jsp file, i am able to see the field of attaching the document but the problem is when i click the SEND button, everything is coming in my gmail inbox except the attached document.....
thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
I haven't tried that so I don't know what the issue could be. My *guess* is that the input file, although referencing the file you selected, still needs coding to upload and attach the file, just like an email client would.

So, if I understand you correctly, you want to be able to add an attachment to a post?
thumbnail
Zeeshan Khan, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
Hi Pete !!

thnx for ur reply....

actually we require to send attachment on configured email address......i just want to send attachment along with my WEB FORM details.....

thnx !!
thumbnail
Zeeshan Khan, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
Hi Pete !!

please provide some solution as i am stucked in this for a very long time.....emoticon

thumbnail
Pete Helgren, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Regular Member Beiträge: 225 Beitrittsdatum: 07.04.11 Neueste Beiträge
I wish I could help you more but I am very new to LifeRay and I don't write Struts/Spring or JSP Java code so I am also very unfamiliar with the LifeRay internals. Since LifeRay uses Struts/Spring you end up in configuration purgatory where there are many places to change config files and much magic takes place because of the configuration infrastructure (IMHO).

My experience, so far, with Liferay is in getting it properly configured, and that wasn't easy. Changing functionality is a little beyond my abilities at the moment, especially since it is a Struts/Spring/JSP application with which I have little experience.

So I really can't help you with this one...
thumbnail
Zeeshan Khan, geändert vor 12 Jahren.

RE: One more try at Message Board email sending and delivery

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
hey Pete !!

thnx anyways man !!!