[Tickets #470] NEW: Signature bug

bugs at bugs.horde.org bugs at bugs.horde.org
Tue Aug 10 11:02:02 PDT 2004


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=470
-----------------------------------------------------------------------
 Ticket     | 470
 Created By | nummedal_imp at ime.ntnu.no
 Summary    | Signature bug
 Queue      | IMP
 Version    | 3.2.5
 State      | Unconfirmed
 Priority   | 2. Medium
 Type       | Bug
 Owners     | 
-----------------------------------------------------------------------


nummedal_imp at ime.ntnu.no (2004-08-10 11:02) wrote:

The sig_first and sig_dashes features creates problems when replying and
forwarding messages.  Any mailreader (including Imp itself) that knows of
the '-- ' convention will then treat the quoted text after the signature as
part of the signature.  This is confusing for any recipients of such
messages.  The solution is to only honor the sig_dashes flag if composing a
new message or if the sig_first flag is not set.

The following patch is not tested, but should at least be a guide to a
finished fix.


*** lib/Identity/IMP.php.org    Tue Aug 10 15:40:02 2004
--- lib/Identity/IMP.php        Tue Aug 10 19:09:38 2004
***************
*** 233,245 ****
          $val = $this->getValue('signature', $ident);

          if (isset($val)) {
              $sig_first = $this->getValue('sig_first', $ident);
-             $sig_dashes = $this->getValue('sig_dashes', $ident);
              $val = str_replace("\r\n", "\n", $val);
-             if ($sig_dashes) {
-                 $val = "-- \n$val";
-             }
              if (isset($sig_first) && $sig_first) {
                  $val = "\n" . $val . "\n\n\n";
              } else {
                  $val = "\n" . $val;
--- 233,241 ----


*** compose.php.org     Tue Aug 10 15:43:00 2004
--- compose.php Tue Aug 10 19:43:16 2004
***************
*** 1208,1222 ****
                                  $identity->getValue('save_sent_mail',
$ident));
  }
  $sig = $identity->getSignature();
  $sig_first = $identity->getValue('sig_first');

  if ($get_sig) {
      if (isset($msg) && !empty($sig)) {
!         if ($sig_first) {
              $msg  = "\n" . $sig . $msg;
          } else {
!             $msg .= "\n" . $sig;
          }
      }
  }

--- 1208,1229 ----
                                  $identity->getValue('save_sent_mail',
$ident));
  }
  $sig = $identity->getSignature();
  $sig_first = $identity->getValue('sig_first');
+ $sig_dashes = $identity->getValue('sig_dashes');
+
+ // Only honor sig_dashes if the signature is at the end, or the message is
empty.

  if ($get_sig) {
      if (isset($msg) && !empty($sig)) {
!         if ($sig_first && !empty(trim($msg))) {
              $msg  = "\n" . $sig . $msg;
          } else {
!             if ($sig_dashes) {
!                 $msg .= "\n-- \n$" .sig;
!             } else {
!                 $msg .= "\n" . $sig;
!             }
          }
      }
  }






More information about the bugs mailing list