SnappyMail İnvalid Token İssue

Hello everyone. I can’t access my emails via Snappy Mail. But RainLoop works. As you can see in the screenshot, I am getting an “Invalid Token” error.

I couldn’t find any resources on this. I think only I am having this problem.

Could you help?

Try create new chrome profiles and login there. Maybe some of your chrome extension block it.

I tried what you said. But my problem is not solved.
@usmannasir Can you suggest for my problem?

Is there anyone who can help with my problem? I can’t use Snappy Mail. That’s why I can only use RainLoop.

I have exactly the same problem. Rainloop works perfectly, but Snappymail shows me ever time “Invalid Token” alert dialog when I try to login (with 100% true credentials). I have tried this with different mail-website combinations, and every time the same result. False combinations results with “Server message: AUTHENTICATIONFAILED Authentication failed.”, as supposed to be.

By the way, I was able to log in ONLY FOR ONE TIME, so I am 100% sure, it can log me in, but suddenly same alert dialog appeared on the screen, saying “invalid token”. When I pressed OK, Snappymail logged me out.

I was using an older version (2.0) of the CyberPanel, but due to SSL issues (it was not be able to auto renew SSL anymore), I have upgraded my CyberPanel. My operating System is Centos7.

Related sample email log:
Sep 13 19:47:16 ns1 dovecot: imap-login: Login: user=somemail@domain.com, method=PLAIN, rip=::1, lip=::1, mpid=124459, TLS, session=<5XetcetcetcAAAAAAAAAAAAAAB>
Sep 13 19:47:16 ns1 dovecot: imap(somemail@domain.com)<124459><5XetcetcetcAAAAAAAAAAAAAAB>: Logged out in=11 out=483 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0

1 Like

Hello FaikEmre, actually I do not require SnappyMail, but this problem was very annoying, so I debugged SnappyMail and found the problem. I FOUND THE BUG, the problem is not caused by the user! It’s just that SnappyMail considers the UTC timezone for the authentication token expiration date (i.e. in Turkey, the default timezone is UTC+3 now, but SnappyMail thinks it’s ALWAYS UTC+0). A little deeper: Let’s say, for example, it’s 09:30 in Turkey and your SnappyMail is running on a server in Turkey whose time zone is set to UTC+3 by default. SnappyMail should set an expiration date for a login attempt token to 1 hour. So it should expire at 10.30 (UTC+3). And it should control those times according to the server times, no matter where the user is trying to log in (i.e. if you live in Japan, it should still consider UTC+3 according to the server configuration. But the problem is, does Snappy Mail think that server is always UTC+0. But when trying to validate the expiration time, it checks the configured UTC+3 time!)

Then I tried changing my server’s timezone to UTC. Tada! It now works perfectly as it should. Now the token expires after 1 hour of trying to login.

In summary, there is a bug that SnappyMail ALWAYS creates the authentication token according to the UTC+0 timezone, but not according to the server’s default timezone as it normally should.
And in our situation (just to let the other users who have questions in mind) user time doesn’t affect this invalid token issue.

Since changing UTC timezone is fine for my case, I changed my timezone to UTC. (If changing the time zone from UTC+3 to UTC0 is not allowed, the time can also be set equal to the UTC time zone without changing the time zone). My server is a virtual server and I couldn’t change my default time zone (Natro Hosting, I definitely DO NOT RECOMMEND IT!). So I have installed a NTP Server by:
# yum install ntp -y
command in Centos7.

After that, you can check if the ntpd service is started or not by:
# service ntpd status
command. If not, try:

# systemctl start ntpd.service
# systemctl enable ntpd.service

commands. By default, UTC timezone should be set now. If not, try to reboot the server once and check it again.

Normally, Server time can also be viewed by:
# timedatectl
and could timezone be changed easily without NTP server installation by:
# timedatectl set-timezone UTC
command.

I hope this information helps you. Good luck!

P.S: I have no relationship, neither with CyberPanel nor with SnappyMail developers nor with Natro Hosting. These men have no interest in community, as I have seen. There is insufficient documentation, insufficient community support, insufficient customer support, maybe “no” would be a little better word rather than “insufficient”. Next time I will migrate my websites to another control panel and another hosting company.

And also please kindly note that, you should not write # symbols in the command line, it is the standard command character.

1 Like

Thank you very much for the solution @onuryildiz

I have a question. I don’t want to change my server’s timezone. How can I make SnappyMail’s timezone UTC+3?

I think this process also solves our problem.