Notifications for some account

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Notifications for some account

Post by Hanscento » 2021-06-20 18:23

Hi,
I recently bought a domain, I have started using hMailServer in a computer inside my house, but considering that my internet isn't very fast (i only have 3 Mb/s UP), I decided to switch to AWS and i was able to successfully reconfigure everything.
On my phone I use and used Spark as client, but after having switched to AWS only for some addresses I don't receive any notifications until I open the App, on other addresses I receive notifications near real time (as before when I was Hosting hMailServer in my House).
I don't think it is a configuration problem because otherwise i wouldn't recieve any notification from any adress.
I have no idea...

palinka
Senior user
Senior user
Posts: 2792
Joined: 2017-09-12 17:57

Re: Notifications for some account

Post by palinka » 2021-06-20 20:09

Clients poll servers. Not the other way around.

In hmailserver do you have imap idle enabled?

In your client, check to see if it runs in the background.

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-20 20:14

palinka wrote:
2021-06-20 20:09
Clients poll servers. Not the other way around.

In hmailserver do you have imap idle enabled?

In your client, check to see if it runs in the background.
Yes i have Imap Idle enabled.
I have an iPhone and i have background app refresh turned on.
I have also tried other devices (my pc with Outlook, another phone with android, and also another iPhone) but still dosn't work... :cry:

mikedibella
Senior user
Senior user
Posts: 517
Joined: 2016-12-08 02:21

Re: Notifications for some account

Post by mikedibella » 2021-06-20 20:25

Background refresh on iPhone relies on push notifications from the server, through the Apple Push Notification Service, to the device. The device receives the push notification and the client get an event that there is work for it to do. The client can then wake up and poll the server.

The relationship between the server and client requires the push to be originated by the authority that signed the client app. The signer has authorization to submit push notifications for that app.

The way Apple has set this up makes it impossible for a mail server to initiate a push notification without a proxy maintained by the client app developer. The client app developer has to host this proxy and poll the mailbox for changes, then generate the push to the client.

So you'll need to see if the developer of Spark has this infrastructure in place, and if so, ask them how the client can create the subscription to poll the mailbox though the proxy.

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-20 20:41

mikedibella wrote:
2021-06-20 20:25
Background refresh on iPhone relies on push notifications from the server, through the Apple Push Notification Service, to the device. The device receives the push notification and the client get an event that there is work for it to do. The client can then wake up and poll the server.

The relationship between the server and client requires the push to be originated by the authority that signed the client app. The signer has authorization to submit push notifications for that app.

The way Apple has set this up makes it impossible for a mail server to initiate a push notification without a proxy maintained by the client app developer. The client app developer has to host this proxy and poll the mailbox for changes, then generate the push to the client.

So you'll need to see if the developer of Spark has this infrastructure in place, and if so, ask them how the client can create the subscription to poll the mailbox though the proxy.
I could agree with you if I had never received notifications from Spark, but as long as hMailServer was hosted on a PC in my house, I received notifications from Spark on the iPhone almost in real time, since I use AWS I do not receive notifications at all. neither 5 minutes later or half an hour later

mikedibella
Senior user
Senior user
Posts: 517
Joined: 2016-12-08 02:21

Re: Notifications for some account

Post by mikedibella » 2021-06-20 21:41

Perhaps the NAT timers on AWS are short and interfering with the health of the inactive TCP connection between Spark and HMS after the IDLE command is issued?

See https://datatracker.ietf.org/doc/html/r ... intervals.

Is the IDLE refresh interval configurable in Spark?

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-20 21:51

mikedibella wrote:
2021-06-20 21:41
Perhaps the NAT timers on AWS are short and interfering with the health of the inactive TCP connection between Spark and HMS after the IDLE command is issued?
No, I don't think because i would not recieve notifications from any addresses.
i can't find anything on google that could resolve my issue.
it is very strange that from some addresses i can recieve notifications, and from others i can't.
mikedibella wrote:
2021-06-20 21:41
Is the IDLE refresh interval configurable in Spark?
From settings you can't

mikedibella
Senior user
Senior user
Posts: 517
Joined: 2016-12-08 02:21

Re: Notifications for some account

Post by mikedibella » 2021-06-21 00:37

Enable IMAP logging and filter the log to show only the IMAP session of the account exhibiting the issue. Do you see the client initiate the IDLE state? Do you see periodic keep-alives from the server, something like “OK still here”?

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-21 01:16

mikedibella wrote:
2021-06-21 00:37
Enable IMAP logging and filter the log to show only the IMAP session of the account exhibiting the issue. Do you see the client initiate the IDLE state? Do you see periodic keep-alives from the server, something like “OK still here”?
Because i don’t know how to filter the log to show only the IMAP session of the account exhibiting the issue i have deleted all account except the faulty one. In the log I don’t see any “OK Still Here” but i see a lot of “SENT+idling” and “OK IDLE terminated”

mikedibella
Senior user
Senior user
Posts: 517
Joined: 2016-12-08 02:21

Re: Notifications for some account

Post by mikedibella » 2021-06-21 01:45

Right-click on a log entry to filter only that session.

While filtering, send an email to the account and see if the service notifies the client. Does the client react to the notification?

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-21 12:29

mikedibella wrote:
2021-06-21 01:45
Right-click on a log entry to filter only that session.

While filtering, send an email to the account and see if the service notifies the client. Does the client react to the notification?
I don't know if the server notifies the client, but i have found an ERROR log in folder C:\Program Files (x86)\hMailServer\Logs. i'll put first two lines down below, it is very long but all lines look like the same, only different ids


"ERROR" 1172 "2021-06-21 01:20:12.303" "Severity: 3 (Medium), Code: HM5026, Source: PersistentMessage::_WriteDataToMessageFile, Description: Message retrieval failed because message file C:\Program Files (x86)\hMailServer\Data\mydomain.com\user\61\{61898B17-8818-4FB7-A21F-4BF7DD214F4E}.eml did not exist."
"ERROR" 3740 "2021-06-21 01:29:48.625" "Severity: 3 (Medium), Code: HM5026, Source: PersistentMessage::_WriteDataToMessageFile, Description: Message retrieval failed because message file C:\Program Files (x86)\hMailServer\Data\mydomain.com\user\59\{59610764-0253-482E-B9AD-12698C7A5805}.eml did not exist."

palinka
Senior user
Senior user
Posts: 2792
Joined: 2017-09-12 17:57

Re: Notifications for some account

Post by palinka » 2021-06-21 12:36

Hanscento wrote:
2021-06-21 12:29
mikedibella wrote:
2021-06-21 01:45
Right-click on a log entry to filter only that session.

While filtering, send an email to the account and see if the service notifies the client. Does the client react to the notification?
I don't know if the server notifies the client, but i have found an ERROR log in folder C:\Program Files (x86)\hMailServer\Logs. i'll put first two lines down below, it is very long but all lines look like the same, only different ids


"ERROR" 1172 "2021-06-21 01:20:12.303" "Severity: 3 (Medium), Code: HM5026, Source: PersistentMessage::_WriteDataToMessageFile, Description: Message retrieval failed because message file C:\Program Files (x86)\hMailServer\Data\mydomain.com\user\61\{61898B17-8818-4FB7-A21F-4BF7DD214F4E}.eml did not exist."
"ERROR" 3740 "2021-06-21 01:29:48.625" "Severity: 3 (Medium), Code: HM5026, Source: PersistentMessage::_WriteDataToMessageFile, Description: Message retrieval failed because message file C:\Program Files (x86)\hMailServer\Data\mydomain.com\user\59\{59610764-0253-482E-B9AD-12698C7A5805}.eml did not exist."
Usually this means that antivirus is interfering. Exclude the hmailserver data directory from antivirus scanning.

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-21 12:43

palinka wrote:
2021-06-21 12:36
Usually this means that antivirus is interfering. Exclude the hmailserver data directory from antivirus scanning.
I'm using Windows Server 2012 Standard, which as long as i know does not have Windows Defender, and I didn't install any other antivirus software

User avatar
SorenR
Senior user
Senior user
Posts: 4712
Joined: 2006-08-21 15:38
Location: Denmark

Re: Notifications for some account

Post by SorenR » 2021-06-21 12:46

Hanscento wrote:
2021-06-21 12:43
palinka wrote:
2021-06-21 12:36
Usually this means that antivirus is interfering. Exclude the hmailserver data directory from antivirus scanning.
I'm using Windows Server 2012 Standard, which as long as i know does not have Windows Defender, and I didn't install any other antivirus software
You should check, you may have Defender without the GUI like on Windows Server 2012 R2... Even thr CORE versions of Windows Server have Defender...
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-21 13:09

SorenR wrote:
2021-06-21 12:46
[You should check, you may have Defender without the GUI like on Windows Server 2012 R2... Even thr CORE versions of Windows Server have Defender...
I checked, there is no windfend service neither running or installed.

mikedibella
Senior user
Senior user
Posts: 517
Joined: 2016-12-08 02:21

Re: Notifications for some account

Post by mikedibella » 2021-06-21 18:47

Hanscento wrote:
2021-06-21 13:09
I checked, there is no windfend service neither running or installed.
Regardless, I think you have found your smoking gun. You need to thoroughly analyze the on-premise platform that behaved as expected against the EC2 instance that exhibits the anomaly and identify all differences, then try to rule each difference out as casual. The goal is to identify a change you can make in the EC2 environment that eliminates the file error and then retest your use case to see if you get the expected behavior.

User avatar
katip
Senior user
Senior user
Posts: 907
Joined: 2006-12-22 07:58
Location: Istanbul

Re: Notifications for some account

Post by katip » 2021-06-21 19:34

Hanscento wrote:
2021-06-21 13:09
I checked, there is no windfend service neither running or installed.
that's ok. we forget about Defender. mine are also off/disabled or non-existent on all servers.
this error is typically related to deleted eml files on file system level, but still referred to in HMS DB.
happened is happened. you go on with further investigation to find out what it was.
meanwhile i'd suggest to run a DataDirectorySynchronizer.exe, twice with both options, and also have a look at this:
http://www.hmailserver.com/forum/viewto ... 20&t=27646
then see how it goes on. HTH
Katip
--
HMS 5.7.0, MariaDB 10.4.10, SA 3.4.2, ClamAV 0.103.2

Hanscento
New user
New user
Posts: 9
Joined: 2021-06-10 18:23

Re: Notifications for some account

Post by Hanscento » 2021-06-22 14:58

ok i've done some testing, using another IP (not AWS, a friend house) i have the same issue (Obviusly i've adjusted DNS records), so i think that it could be something related with my house IP, because when i point the domain to my IP everything works as it should, when i use another IP i can send and recieve normally except that on my phone (and also other devices) I don't recieve any notfication

Post Reply