<?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>IMP dies on bad date headers</title> 
  <pubDate>Fri, 10 Apr 2026 09:21:01 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/13409</link> 
  <atom:link rel="self" type="application/rss+xml" title="IMP dies on bad date headers" href="https://bugs.horde.org/ticket/13409/rss" /> 
  <description>IMP dies on bad date headers</description> 
 
   
   
  <item> 
   <title>I have a user, converted from another mail application to Ho</title> 
   <description>I have a user, converted from another mail application to Horde, who complains about not being able to read his mails.
When he tries to access some of them, he gets server communication error.

The following are in the logs:
Jul 31 16:47:26 wm Webmail: [imp] PHP ERROR: strftime() expects parameter 2 to be long, string given [pid 79051 on line 178 of &quot;/usr/local/www/webmail/web/imp/lib/Message/Ui.php&quot;]
Jul 31 16:47:26 wm Webmail: PHP Fatal error:  Call to a member function format() on a non-object in /usr/local/www/webmail/web/imp/lib/Message/Ui.php on line 181

Putting some debug syslogs around this code it seems $this-&gt;_envelope-&gt;date becomes an empty string when the date header is invalid.
Two examples from the user&#039;s folder:
Date: Tue, 22 Oct 2013 19:02:07 +0200 (GMT+02:00)
Date: Wed, 02 Jul 2014 05:18:27 UT

If I correct these headers to be RFC conform, the messages can be read.
Thunderbird and other clients can show these correctly.</description> 
   <pubDate>Thu, 31 Jul 2014 14:59:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85009</link> 
  </item> 
   
  <item> 
   <title>&gt; I have a user, converted from another mail application to </title> 
   <description>&gt; I have a user, converted from another mail application to Horde, who 
&gt; complains about not being able to read his mails.
&gt; When he tries to access some of them, he gets server communication error.
&gt;
&gt; The following are in the logs:
&gt; Jul 31 16:47:26 wm Webmail: [imp] PHP ERROR: strftime() expects 
&gt; parameter 2 to be long, string given [pid 79051 on line 178 of 
&gt; &quot;/usr/local/www/webmail/web/imp/lib/Message/Ui.php&quot;]
&gt; Jul 31 16:47:26 wm Webmail: PHP Fatal error:  Call to a member 
&gt; function format() on a non-object in 
&gt; /usr/local/www/webmail/web/imp/lib/Message/Ui.php on line 181
&gt;
&gt; Putting some debug syslogs around this code it seems 
&gt; $this-&gt;_envelope-&gt;date becomes an empty string when the date header 
&gt; is invalid.
&gt; Two examples from the user&#039;s folder:
&gt; Date: Tue, 22 Oct 2013 19:02:07 +0200 (GMT+02:00)
&gt; Date: Wed, 02 Jul 2014 05:18:27 UT
&gt;
&gt; If I correct these headers to be RFC conform, the messages can be read.
&gt; Thunderbird and other clients can show these correctly.
After reading my own message: &quot;around this code&quot; really means imp/lib/Ajax/Application/ShowMessage.php and this loop:
        /* Build the rest of the headers. */
        foreach ($headers_list as $head =&gt; $str) {
            if ($val = $mime_headers-&gt;getValue($head)) {
                if ($head == &#039;date&#039;) {
                    /* Add local time to date header. */
                    $val = htmlspecialchars($imp_ui-&gt;getLocalTime($this-&gt;_envelope-&gt;date));

$this-&gt;_envelope-&gt;date here is an empty string on bad date headers, that&#039;s where getLocalTime dies.</description> 
   <pubDate>Thu, 31 Jul 2014 15:07:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85010</link> 
  </item> 
   
  <item> 
   <title>Can&#039;t reproduce.  AFAICT, envelope-&gt;date cannot be anything </title> 
   <description>Can&#039;t reproduce.  AFAICT, envelope-&gt;date cannot be anything other than a Horde_Imap_Client_DateTime object.

Considering that we catch/fix precisely the broken date headers you report in Horde_Imap_Client, I&#039;m wondering if you happen to be using PHP 5.4.29, 5.5.13, or 5.6?</description> 
   <pubDate>Thu, 31 Jul 2014 20:09:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85011</link> 
  </item> 
   
  <item> 
   <title>&gt; Can&#039;t reproduce.  AFAICT, envelope-&gt;date cannot be anythin</title> 
   <description>&gt; Can&#039;t reproduce.  AFAICT, envelope-&gt;date cannot be anything other 
&gt; than a Horde_Imap_Client_DateTime object.
&gt;
&gt; Considering that we catch/fix precisely the broken date headers you 
&gt; report in Horde_Imap_Client, I&#039;m wondering if you happen to be using 
&gt; PHP 5.4.29, 5.5.13, or 5.6?
# php -v
PHP 5.5.13 (cli) (built: Jun 10 2014 15:36:46) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Could you please help in narrowing down this issue?
Maybe with a sample code, which can be fed with a text input and does the same like Horde.</description> 
   <pubDate>Fri, 01 Aug 2014 07:44:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85012</link> 
  </item> 
   
  <item> 
   <title>Your version of PHP is broken.  This is worked around in Hor</title> 
   <description>Your version of PHP is broken.  This is worked around in Horde_Imap_Client 2.22.0+.</description> 
   <pubDate>Sat, 02 Aug 2014 18:24:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85029</link> 
  </item> 
   
  <item> 
   <title>&gt; Your version of PHP is broken.  This is worked around in </title> 
   <description>&gt; Your version of PHP is broken.  This is worked around in 
&gt; Horde_Imap_Client 2.22.0+.
Indeed, upgrading to 5.5.14 solves this issue. Thanks.</description> 
   <pubDate>Sat, 02 Aug 2014 21:54:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/13409#t85033</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
