Thanks Stephan for your answer.
Hmm. Probably, the timezone configuration (i.e. the contents of TZ timezone environment variable) somehow doesn't reach the final stages of e-mail delivery.
Sorry, I just found out we had pigeonhole-0.4.3 running on the old server. The sources of 0.2.5 were also lying around, but were not used anymore.
On the old and the new server there's no TZ or TIMEZONE variable. Still the version 0.4.3 together with System V on Mandriva 2010.2 worked and the systemd version on CentOS 7.1.x sets up the past (2h back) as the modtime
I think I found out that the function sieve_file_storage_update_mtime() is the cause of this problem.
No. That is for the storage of the Sieve scripts and not the delivered e-mail. That part is handled by Dovecot lib-storage.
I see. Made some assumptions which were wrong.
I haven't tried this at my end yet, but - to make sure we have all the information we may need - could you enlighten us a bit about your configuration? So, what output is produced by
dovecot -n
? How is final delivery performed (using LDA or LMTP)?
We are delivering mail via Dovecot-LDA, which calls pigeonhole ...
This is the (relevant) part of 'doveconf -':
# 2.2.18: /srv/dovecot-2.2.18/etc/dovecot/dovecot.conf # Pigeonhole version 0.4.8 (0c4ae064f307+) # OS: Linux 3.10.0-229.7.2.el7.x86_64 x86_64 CentOS Linux release 7.1.1503 (Core) auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login cram-md5 auth_verbose = yes auth_verbose_passwords = plain base_dir = /var/run/dovecot-22/ debug_log_path = /var/log/dovecot/dovecot.debug default_internal_user = someuser default_login_user = someuser disable_plaintext_auth = no info_log_path = /var/log/dovecot/dovecot.log log_path = /var/log/dovecot/dovecot.err mail_location = maildir:~/Maildir:INBOX=~/Maildir mail_plugins = acl managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate [...] plugin { acl = vfile mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename mail_log_fields = uid box msgid size sieve = /srv/mail/sieve/%n.sieve sieve_before = /srv/mail/sieve/spam-filter/%n.sieve sieve_dir = ~/sieve sieve_global_dir = /srv/mail/sieve/global/ sieve_global_path = /srv/mail/sieve/default.sieve } protocols = imap sieve service auth { unix_listener auth-userdb { group = vmail mode = 0600 user = someuser } } service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } process_limit = 400 process_min_avail = 2 } service imap { executable = imap postlogin process_limit = 350 } service postlogin { executable = script-login rawlog user = someuser } [..] userdb { args = uid=someuser gid=vmail home=/srv/mail/someuser/%u driver = static } userdb { args = username_format=%n /etc/dovecot/users driver = passwd-file } protocol imap { mail_max_userip_connections = 30 mail_plugins = acl imap_acl mail_log notify } protocol lda { info_log_path = /var/log/dovecot/deliver.log log_path = /var/log/dovecot/deliver.err mail_plugins = sieve }
I had a look at lib-storage of dovecot, which also has calls for utime in it.
Well, I yet fail to understand why this could be useful or necessary. After I write the file it already has the correct modtime. Absolutely no need to fiddle around with utime - IMHO.
If I create a file by just touching it like 'touch SOMEFILE' it has the correct current localtime as modtime. Why should I change this to two hours in the past? I still can't see the reason for this behaviour. Perhaps some IMAP requirement I don't know of?
Hope you can elighten me and/or help me.
Thank you for your time.
-- Christoph Gröver