Fixing SquirrelMail’s weird reply behavior

Posted by chetan on July 23, 2009 in misc

After years of being annoyed by the fact that SquirrelMail, an otherwise fine product, doesn’t include the date and name of the sender when replying to emails like just about every other email client on the planet, I finally broke down and fixed it. Below is the simple 1 line patch against SquirrelMail 1.4.19. It will most likely work on older 1.4.x versions as well.

Download patch (squirrelmail-1.4.19-reply_body.patch)

--- squirrelmail-1.4.19/src/compose.php	2009-05-14 06:26:29.000000000 +0000
+++ squirrelmail/src/compose.php	2009-07-23 16:09:59.000000000 +0000
@@ -856,7 +856,7 @@
                 $rewrap_body = explode("\n", $body);
                 $from = (is_array($orig_header->from) && !empty($orig_header->from)) ? $orig_header->from[0] : $orig_header->from;
                 sqUnWordWrap($body);
-                $body = '';
+                $body = "\n\n\nOn " . getLongDateString( $orig_header->date, $orig_header->date_unparsed ) . " {$send_to} wrote:\n"; // MOD BY chetan
                 $cnt = count($rewrap_body);
                 for ($i=0;$i<$cnt;$i++) {
                     sqWordWrap($rewrap_body[$i], $editor_size, $default_charset);