<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Wrong timezone used in linked attachment notifications</title> 
  <pubDate>Fri, 10 Apr 2026 03:39:17 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/4609</link> 
  <atom:link rel="self" type="application/rss+xml" title="Wrong timezone used in linked attachment notifications" href="https://bugs.horde.org/ticket/4609/rss" /> 
  <description>Wrong timezone used in linked attachment notifications</description> 
 
   
   
  <item> 
   <title>In link attachment downloaded notifications emails, the &quot;Att</title> 
   <description>In link attachment downloaded notifications emails, the &quot;Attachment Date:&quot; is set to GMT-10 instead of GMT-5 on our system in the EST timezone.  Using a real example, when the receipient of the link attachment downloaded the attachment, the sender received the link attachment download notification email with:



Attachment date: Wed,  1 Nov 2006 03:37:12 -0500



when the correct time the attachment was uploaded was actually:



Wed,  1 Nov 2006 08:37:12 -0500.



The problem appears to be caused by the use of gmmktime in horde/imp/lib/Compose.php.  It uses:



$ts = gmmktime();

$fullpath = sprintf(&#039;%s/%s/%d&#039;, IMP_VFS_LINK_ATTACH_PATH, $auth, $ts);



So this generates a URL in  email sent to the receipient like so:



https://server/attachment.php?u=&lt;email&gt;&amp;t=&lt;gmmktime()&gt;&amp;f=&lt;attachment&gt;



horde/imp/attachment.php then uses the value of t=&lt;gmmktime()&gt; as the date:



time_stamp = Util::getFormData(&#039;t&#039;);

[snip]

$msg-&gt;setContents(String::wrap(sprintf(_(&quot;Your linked attachment has been downloaded by at least one user.\n\nAttachment name: %s\nAtt

achment date: %s\n\nClick on the following link to permanently delete the attachment:\n%s&quot;), $file_name, date(&#039;r&#039;, $time_stamp), Util::addParamete

r(Horde::selfUrl(true, false, true), &#039;d&#039;, $id))));



On my system, gmmktime() returns seconds since epoch + 5 hours and time() returns second since epoch.  So I used this patch:



[root@puma imp]# diff attachment.php attachment.php.orig

47,49d46

&lt; // generate timestamp that shows correct timezone for notification email

&lt; $time_stamp_display = $time_stamp - intval(date(&#039;Z&#039;, $time_stamp));

&lt;

113c110

&lt;             $msg-&gt;setContents(String::wrap(sprintf(_(&quot;Your linked attachment has been downloaded by at least one user.\n\nAttachment name: %s\nAttachment date: %s\n\nClick on the following link to permanently delete the attachment:\n%s&quot;), $file_name, date(&#039;r&#039;, $time_stamp_display), Util::addParameter(Horde::selfUrl(true, false, true), &#039;d&#039;, $id))));

---

&gt;             $msg-&gt;setContents(String::wrap(sprintf(_(&quot;Your linked attachment has been downloaded by at least one user.\n\nAttachment name: %s\nAttachment date: %s\n\nClick on the following link to permanently delete the attachment:\n%s&quot;), $file_name, date(&#039;r&#039;, $time_stamp), Util::addParameter(Horde::selfUrl(true, false, true), &#039;d&#039;, $id))));



I&#039;m using Horde 3.1.4, IMP 4.1.3 on RHEL 4 AS U4.  This has PHP version 4.3.9.

</description> 
   <pubDate>Wed, 01 Nov 2006 22:52:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t25533</link> 
  </item> 
   
  <item> 
   <title>Please, PLEASE provide meaningful ticket summaries.</title> 
   <description>Please, PLEASE provide meaningful ticket summaries.</description> 
   <pubDate>Wed, 01 Nov 2006 23:20:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t25539</link> 
  </item> 
   
  <item> 
   <title>I meant to say:



&quot;On my system, gmmktime() returns seconds</title> 
   <description>I meant to say:



&quot;On my system, gmmktime() returns seconds since epoch - 5 hours&quot;</description> 
   <pubDate>Mon, 06 Nov 2006 04:30:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t25778</link> 
  </item> 
   
  <item> 
   <title>So is there a reason not to just use time instead of gmmktim</title> 
   <description>So is there a reason not to just use time instead of gmmktime in Compose.php? And can you please upload your patch as an attachment, generated as a unified diff? Thanks.</description> 
   <pubDate>Thu, 16 Nov 2006 05:20:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t26149</link> 
  </item> 
   
  <item> 
   <title>&gt; So is there a reason not to just use time instead of gmmkt</title> 
   <description>&gt; So is there a reason not to just use time instead of gmmktime in 

&gt; Compose.php?



There is no difference because it returns the timestamp, so that doesn&#039;t fix the problem. I &quot;fixed&quot; this locally already but with some weird results that I still need to look into.</description> 
   <pubDate>Thu, 16 Nov 2006 12:46:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t26211</link> 
  </item> 
   
  <item> 
   <title>&gt; I &quot;fixed&quot; this locally already but with some weird results</title> 
   <description>&gt; I &quot;fixed&quot; this locally already but with some weird results that I still need to look into.



What&#039;s the status of this?</description> 
   <pubDate>Fri, 26 Oct 2007 03:39:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t38094</link> 
  </item> 
   
  <item> 
   <title>No progress.</title> 
   <description>No progress.</description> 
   <pubDate>Fri, 26 Oct 2007 10:50:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t38136</link> 
  </item> 
   
  <item> 
   <title>Fixed in 4.2.0 - looks like we were missing a call to NLS::s</title> 
   <description>Fixed in 4.2.0 - looks like we were missing a call to NLS::setTimeZone().</description> 
   <pubDate>Tue, 13 Nov 2007 01:55:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4609#t38586</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
