1

Topic: Wrong timestamp for emails in queue

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hi,
at present my timezone is GMT+02:00 (Europe/Rome) with offset of an hour until the end of October (then GMT+01:00).
If I send email with SOGo or Roundcube, I see the correct timestamp of sent emails in folder and also at destination timestamp is ok. Also logs report the right timestamp.
What is wrong is timestamp for outgoing emails in the queue (for example because of greylist): they have timestamp (Arrival time) according to GMT and not GMT+02:00.

Any ideas?
Thank you
Best regards

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Wrong timestamp for emails in queue

sentosa wrote:

What is wrong is timestamp for outgoing emails in the queue (for example because of greylist): they have timestamp (Arrival time) according to GMT and not GMT+02:00.

What's wrong with this different timestamp in queue?

Mail client applications (e.g. Outlook, Thunderbird, etc) read the timestamp in mail header, they don't know the timestamp in your mail queue at all. So Postfix has the freedom to use GMT (or whatever it prefers) timestamp for queue (again, not the time in mail header).

3

Re: Wrong timestamp for emails in queue

For the everyday operations, it does not matter, but for a debugging matter it does; quite often I have a look at the situation in the queue for example and it is not useful to have to remember that an email was sent two hours later.
Moreover I manage another linux mail server which I have installed piece by piece with the same base components (postfix, amavis, dovecot, clamav, spamassassin) and there is not this kind of problem: emails in queue have the right timestamp.
Is there a way to correct this behavior in Iredmail installation?

thank you
Best regards

ZhangHuangbin wrote:
sentosa wrote:

What is wrong is timestamp for outgoing emails in the queue (for example because of greylist): they have timestamp (Arrival time) according to GMT and not GMT+02:00.

What's wrong with this different timestamp in queue?

Mail client applications (e.g. Outlook, Thunderbird, etc) read the timestamp in mail header, they don't know the timestamp in your mail queue at all. So Postfix has the freedom to use GMT (or whatever it prefers) timestamp for queue (again, not the time in mail header).

4

Re: Wrong timestamp for emails in queue

I'm afraid that I'm confused what issue we're talking about. Could you please show us some samples?

5

Re: Wrong timestamp for emails in queue

Ok, the issue is that with respect to the time of sending, if an email remains in postfix queue for greylisting or other matters, it shows date and hour according to GMT while the timestamp (date and hour) of that same email in Outlook, SOGo or Roundcube shows the right timestamp (the time of sending) which is GMT+02:00.
My timezone is GMT+02:00 (Europe/Rome; with daylight saving).
To make an example:
if I send an email at 11.00 a.m. and it gets greylisted, I see it in the queue with arrival time 9.00 a.m. while in Outlook, SOGo and Roundcube I see it as Sent at 11.00 a.m.

I think that also the arrival time in the queue should be the same time of sending.

Thank you


ZhangHuangbin wrote:

I'm afraid that I'm confused what issue we're talking about. Could you please show us some samples?

6

Re: Wrong timestamp for emails in queue

*) Does your server have correct time zone?
*) Did you copy /etc/localtime to /var/spool/postfix/etc/ ?

7

Re: Wrong timestamp for emails in queue

I did dpkg-reconfigure tzdata after installation just for sure and, yes, time zone is right.
A "diff /etc/localtime /var/spool/postfix/etc/localtime" does not return any difference so I have not copied.

I have no idea.
Thank you


ZhangHuangbin wrote:

*) Does your server have correct time zone?
*) Did you copy /etc/localtime to /var/spool/postfix/etc/ ?

8

Re: Wrong timestamp for emails in queue

Please show me the incorrect timestamps. How did you check the timestamp?

9

Re: Wrong timestamp for emails in queue

ZhangHuangbin wrote:

Please show me the incorrect timestamps. How did you check the timestamp?

Here an example of what happens(where destination mail domain is on another email server):

root@ubuntu16:~# date
gio 27 ott 2016, 18.16.53, CEST
root@ubuntu16:~# postqueue -p
-Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
3AF28160DB3*    1014 Thu Oct 27 16:16:52  stefano@mailtest.sentosa.it
                                         aaa@sentosanet.com

-- 0 Kbytes in 1 Request.
root@ubuntu16:~#

The time and date on Outlook, SOGo and Roundcube for the sent email is gio 27 ott 2016, 18.16.53, CEST.
I've tried also the following setting:
root@ubuntu16:~# cat /etc/adjtime
# assume that the BIOS clock is set to UTC time (recommended)
UTC=no
root@ubuntu16:~#
with a reboot but nothing changes.

Also bios clock is now at the same time and date of linux. Before it was with UTC time and date and the problem was the same.
Thank you

10

Re: Wrong timestamp for emails in queue

sentosa wrote:

The time and date on Outlook, SOGo and Roundcube for the sent email is gio 27 ott 2016, 18.16.53, CEST.

The date you see on Outlook, SOGo, Roundcube are read from mail headers, not the "Arrival Time" in Postfix mail queue.

If you send an email and check the queue immediately, the arrival time should be correct. Some emails may stuck in queue, so that arrival time will be the real time it arrived in queue.

I didn't see any problem with this. Or maybe i misunderstood your issue.

11

Re: Wrong timestamp for emails in queue

ZhangHuangbin wrote:
sentosa wrote:

The time and date on Outlook, SOGo and Roundcube for the sent email is gio 27 ott 2016, 18.16.53, CEST.

The date you see on Outlook, SOGo, Roundcube are read from mail headers, not the "Arrival Time" in Postfix mail queue.

If you send an email and check the queue immediately, the arrival time should be correct. Some emails may stuck in queue, so that arrival time will be the real time it arrived in queue.

I didn't see any problem with this. Or maybe i misunderstood your issue.

The problem is that if I send an email and check the queue immediately (while the email is still in the queue, as done until now) the arrival time is one hour before (exactly the UTC hours because my timezone is Europe/Rome); until 30 october it was two hours before.
It seems very strange this behavior but I don't succeed in solving.
It would be better to have the correct arrival time (not UTC time) in the queue for example in case of debug needed.
Thank you