Emails not being sent

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan

Hi,

Does your SMTP server reject TLS requests, by chance? I see you’ve set TLS off, however I fixed an issue in our development branch (2.16) recently where the user setting was not being honored and TLS was forced on.

Regards,

Halvdan Hoem Grelland

DHIS2 Developer

···

2014-07-24 11:49 GMT+02:00 WILLIAMS, Ryan O’Neil williamsryan@who.int:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to “noreply@dhis2.org”. Hope its not being clobbered by a spam filter on your email server.

Bob

···

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

···

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to “noreply@dhis2.org”. Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

···

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to “noreply@dhis2.org”. Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

I think that is as of 2.16. In 2.15 I don’t see it.

···

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

···

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

I'll give that a try. Thanks
Ryan

···

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]
Sent: vendredi 25 juillet 2014 13:29
To: WILLIAMS, Ryan O'Neil
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from DHIS2 App Hub) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards
Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O'Neil <williamsryan@who.int<mailto:williamsryan@who.int>> wrote:
I think that is as of 2.16. In 2.15 I don't see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com<mailto:bobjolliffe@gmail.com>]
Sent: jeudi 24 juillet 2014 15:49

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.
Two additional lines show up in the log after the "recovery message sent" line

* INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
* INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
* INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have "Enable message email notifications" checked.
No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

···

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]
Sent: vendredi 25 juillet 2014 13:29
To: WILLIAMS, Ryan O'Neil
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from DHIS2 App Hub) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards
Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O'Neil <williamsryan@who.int<mailto:williamsryan@who.int>> wrote:
I think that is as of 2.16. In 2.15 I don't see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com<mailto:bobjolliffe@gmail.com>]
Sent: jeudi 24 juillet 2014 15:49

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it should be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn’t really see the “Email sent using host” line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn’t reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards

Bob

···

On 29 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.

Two additional lines show up in the log after the “recovery message sent” line

  • INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
  • INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
  • INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have “Enable message email notifications” checked.

No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: vendredi 25 juillet 2014 13:29

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Thanks Bob,

There are two issues or "functions".

1. Password recovery (uses email function)

a. This now works since the installation of the lasted build of 2.15

2. Messages sent via email (when use enables this)

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)
Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks
ryan

···

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]
Sent: mardi 29 juillet 2014 13:08
To: WILLIAMS, Ryan O'Neil
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it *should* be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn't really see the "Email sent using host" line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn't reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards
Bob

On 29 July 2014 10:49, WILLIAMS, Ryan O'Neil <williamsryan@who.int<mailto:williamsryan@who.int>> wrote:
Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.
Two additional lines show up in the log after the "recovery message sent" line

* INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
* INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com<mailto:xxx@bbb.com> (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
* INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com<http://aaaa.bbb.com> with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have "Enable message email notifications" checked.
No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com<mailto:bobjolliffe@gmail.com>]
Sent: vendredi 25 juillet 2014 13:29
To: WILLIAMS, Ryan O'Neil
Cc: dhis2-users@lists.launchpad.net<mailto:dhis2-users@lists.launchpad.net>
Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from DHIS2 App Hub) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards
Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O'Neil <williamsryan@who.int<mailto:williamsryan@who.int>> wrote:
I think that is as of 2.16. In 2.15 I don't see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com<mailto:bobjolliffe@gmail.com>]
Sent: jeudi 24 juillet 2014 15:49

Ah ok. So I think there is no need to waste time doing the tcpdump thing. If the log file is not saying that email has been sent then there will have been no comms with the mail server.

So you are right - there seem not to be a problem with the lower level email sending code. The issue is elsewhere.

Somebody a bit closer to the messaging code should be able to help you debugging why the messages are not being sent. I could work through the code but will take longer than someone more familiar with it. I might get the chance later in the week but definitely not today :frowning:

···

On 29 July 2014 12:29, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Thanks Bob,

There are two issues or “functions”.

  1.   Password recovery (uses email function)
    

a. This now works since the installation of the lasted build of 2.15

  1.   Messages sent via email (when use enables this)
    

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)

Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:08

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it should be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn’t really see the “Email sent using host” line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn’t reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards

Bob

On 29 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.

Two additional lines show up in the log after the “recovery message sent” line

  • INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
  • INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
  • INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have “Enable message email notifications” checked.

No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: vendredi 25 juillet 2014 13:29

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

I have debugged this particular piece of code before and made a peculiar discovery: Even though exceptions from the apache commons email library are being handled (logged, that is), other exceptions in the same method are swallowed. This is due to the task executor being used (spring SimpleAsyncTaskExecutor) to execute the emailing routine. Therefore, as Bob points out, it is likely the problem is happening elsewhere (of the email library) and exceptions might not be logged at all (due to the task executor).

The following link should provide a pretty good starting point for implementing a task executor which logs any exceptions. http://java.dzone.com/articles/spring-async-and-exception

I have actually done this before but sadly did not save the code as it was used only for debugging a single case. Unfortunately I am on holiday at the moment so I cannot help you further with the code. The guide at the link I’ve provided should cover most aspects and be easy to implement for anyone familiar with the general codebase, though.

Worth a try I’d say.

Halvdan

···

2014-07-29 12:51 GMT+01:00 Bob Jolliffe bobjolliffe@gmail.com:

Ah ok. So I think there is no need to waste time doing the tcpdump thing. If the log file is not saying that email has been sent then there will have been no comms with the mail server.

So you are right - there seem not to be a problem with the lower level email sending code. The issue is elsewhere.

Somebody a bit closer to the messaging code should be able to help you debugging why the messages are not being sent. I could work through the code but will take longer than someone more familiar with it. I might get the chance later in the week but definitely not today :frowning:


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 29 July 2014 12:29, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Thanks Bob,

There are two issues or “functions”.

  1.   Password recovery (uses email function)
    

a. This now works since the installation of the lasted build of 2.15

  1.   Messages sent via email (when use enables this)
    

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)

Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:08

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it should be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn’t really see the “Email sent using host” line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn’t reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards

Bob

On 29 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.

Two additional lines show up in the log after the “recovery message sent” line

  • INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
  • INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
  • INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have “Enable message email notifications” checked.

No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: vendredi 25 juillet 2014 13:29

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Ok, thanks. Please let me know.
Cheers
ryan

···

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]
Sent: mardi 29 juillet 2014 13:52
To: WILLIAMS, Ryan O'Neil
Cc: dhis2-users@lists.launchpad.net
Subject: Re: [Dhis2-users] Emails not being sent

Ah ok. So I think there is no need to waste time doing the tcpdump thing. If the log file is not saying that email has been sent then there will have been no comms with the mail server.

So you are right - there seem not to be a problem with the lower level email sending code. The issue is elsewhere.

Somebody a bit closer to the messaging code should be able to help you debugging why the messages are not being sent. I could work through the code but will take longer than someone more familiar with it. I might get the chance later in the week but definitely not today :frowning:

On 29 July 2014 12:29, WILLIAMS, Ryan O'Neil <williamsryan@who.int<mailto:williamsryan@who.int>> wrote:
Thanks Bob,

There are two issues or "functions".

1. Password recovery (uses email function)

a. This now works since the installation of the lasted build of 2.15

2. Messages sent via email (when use enables this)

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)
Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks
ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com<mailto:bobjolliffe@gmail.com>]
Sent: mardi 29 juillet 2014 13:08

Ryan I just set up dhis2 v2.15 build 15196. I set up a mail transport (exim4) on localhost and tried out the dhis2 messaging functionality. I set “Enable message email notifications” on the account.

The messages are properly being routed to the mail server and delivered to my email account. They go immediately, ie without any scheduler delay.

So there is something else going on with your setup. I can only think it is something to do with the “Enable message email notifications” setting somehow not being recognized. So some problem in the messaging setup but not the email.

Sorry it is not very helpful to you for me to confirm that it “works here” but that is all I have at the moment.

Bob

···

On 31 July 2014 08:18, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Ok, thanks. Please let me know.

Cheers

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:52

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Ah ok. So I think there is no need to waste time doing the tcpdump thing. If the log file is not saying that email has been sent then there will have been no comms with the mail server.

So you are right - there seem not to be a problem with the lower level email sending code. The issue is elsewhere.

Somebody a bit closer to the messaging code should be able to help you debugging why the messages are not being sent. I could work through the code but will take longer than someone more familiar with it. I might get the chance later in the week but definitely not today :frowning:

On 29 July 2014 12:29, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Thanks Bob,

There are two issues or “functions”.

  1.   Password recovery (uses email function)
    

a. This now works since the installation of the lasted build of 2.15

  1.   Messages sent via email (when use enables this)
    

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)

Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:08

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it should be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn’t really see the " Email sent using host" line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn’t reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards

Bob

On 29 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.

Two additional lines show up in the log after the “recovery message sent” line

  • INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
  • INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
  • INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have “Enable message email notifications” checked.

No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: vendredi 25 juillet 2014 13:29

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Hi Ryan,

in 2.16 we added a convenient method for testing your email setup under settings > email:

https://apps.dhis2.org/demo/dhis-web-maintenance-settings/systemEmailSettings.action

We also added some more logging on failure.

So if you are able to upgrade to 2.16 some time that would help.

regards,

Lars

···

On Thu, Jul 31, 2014 at 1:28 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Ryan I just set up dhis2 v2.15 build 15196. I set up a mail transport (exim4) on localhost and tried out the dhis2 messaging functionality. I set “Enable message email notifications” on the account.

The messages are properly being routed to the mail server and delivered to my email account. They go immediately, ie without any scheduler delay.

So there is something else going on with your setup. I can only think it is something to do with the “Enable message email notifications” setting somehow not being recognized. So some problem in the messaging setup but not the email.

Sorry it is not very helpful to you for me to confirm that it “works here” but that is all I have at the moment.

Bob


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 31 July 2014 08:18, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Ok, thanks. Please let me know.

Cheers

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:52

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Ah ok. So I think there is no need to waste time doing the tcpdump thing. If the log file is not saying that email has been sent then there will have been no comms with the mail server.

So you are right - there seem not to be a problem with the lower level email sending code. The issue is elsewhere.

Somebody a bit closer to the messaging code should be able to help you debugging why the messages are not being sent. I could work through the code but will take longer than someone more familiar with it. I might get the chance later in the week but definitely not today :frowning:

On 29 July 2014 12:29, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Thanks Bob,

There are two issues or “functions”.

  1.   Password recovery (uses email function)
    

a. This now works since the installation of the lasted build of 2.15

  1.   Messages sent via email (when use enables this)
    

a. This does not work

b. No entire are in the log files pertaining to this

c. This is the reason for my questions, is there a scheduler (but over 48hrs later, still nothing in log)

Since item 1 works and not 2, leads me to believe that it is not only an email issue.

I will try to test for communications between the server and the email server.

Thanks

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: mardi 29 juillet 2014 13:08

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

I hope one of the authors of that module who will have been working and testing the module will be able to answer this more authoritatively. My comments were based really on a reading of the source code and predicting from that what it should be doing.

What I can say is that there is no scheduler, or if there is it has already been invoked for you to see the log messages that you do. The code which sends the email seems to do it there and then and should be throwing some exception if it fails ie. you shouldn’t really see the " Email sent using host" line in your log if the sending fails. Rather you should see "Could not send email: "

Of course it is hard to know what the mailhost does with it but it seems what you are saying is that the mail doesn’t reach it. As I indicated earlier what I would do is to use something like tcpdump on the server to verify whether there is comms with the mailserver or not.

Regards

Bob

On 29 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

I just installed 2.15 build 15196 and it managed to solve one aspect of the problem. Email recovery now works.

Two additional lines show up in the log after the “recovery message sent” line

  • INFO 2014-07-28 18:33:08,739 Recovery message sent for user: xxx (AccountController.java [TP-Processor8])
  • INFO 2014-07-28 18:33:08,851 Sending email to user: xxx with email address: xxx@bbb.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])
  • INFO 2014-07-28 18:33:08,931 Email sent using host: aaaa.bbb.com with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-76])

However, email messages are still not being send via the message module, even though the recipients all have “Enable message email notifications” checked.

No lines concerning messages appear in the log. Should message be sent immediately or is there a scheduler for this?

Ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: vendredi 25 juillet 2014 13:29

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Yes you are right. I see lars added it on 20 May.

Though I see that the change was backported to 2.15 in rev 15054. If you upgrade your war to the latest build of 2.15 (available from https://apps.dhis2.org/ci/job/dhis-2.15/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war ) you will find that the email from_address setting has been added. It might be your other problem is addressed as well.

Regards

Bob

On 25 July 2014 09:56, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

I think that is as of 2.16. In 2.15 I don’t see it.

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 15:49

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Sorry Ryan, just looking again at the code, I am not right about FROM_ADDRESS being hard coded. This is in fact a system setting - in email settings dialog.

On 24 July 2014 14:04, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Hi Bob,

Thanks for providing the FROM_ADDRESS.

I will ask IT check the traffic information between the servers.

I sent an email through the server from my computer via telnet using the FROM_ADDRESS:noreply@dhis2.org
and it went through fine.

ryan

From: Bob Jolliffe [mailto:bobjolliffe@gmail.com]

Sent: jeudi 24 juillet 2014 12:44

To: WILLIAMS, Ryan O’Neil

Cc: dhis2-users@lists.launchpad.net

Subject: Re: [Dhis2-users] Emails not being sent

Hi Ryan

From what I understand of the source code, if the message sending failed there should have been a warning entry in your log saying “Could not send email: … ”. If you are not seeing that then it is strange and not consistent with the documentation of the apache commons email library which is being used.

Can you perchance verify with ethereal or tcpdump that there is no traffic between dhis2 and the email server?

The FROM_ADDRESS is currently hardwired to "noreply@dhis2.org ". Hope its not being clobbered by a spam filter on your email server.

Bob

On 24 July 2014 10:49, WILLIAMS, Ryan O’Neil williamsryan@who.int wrote:

Dear all,

We are running version 2.15 instance of dhis2 and we are having trouble getting the email functionality to work.

The email server address and port have been provided using the email settings UI.

We have tried to use the recover password and send message functionality to no avail. Each time the functions are executed, the following entries can be found in the catalina.out log file respectively:

  • … Recovery message sent for user: xxx

OR

  • … Sending email to user: User{surname=‘xxx’, …firstName= … (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])
  • …Email sent using host: emailserver with TLS: false (EmailMessageSender.java [SimpleAsyncTaskExecutor-664])

No entries can be found on the email server concerning these emails. No errors concerning emails can be found in the catalina log file.

Other applications on the same server using the same settings can successfully send emails.

Any ideas about what the problem could be or how we can debug this in more detail?

Also, I don’t see a way to configure the FROM_ADDRESS, is this possible? What is the default sender?

cheers

Ryan


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp