View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006214 | SOGo | Web Mail | public | 2026-05-20 12:04 | 2026-07-01 07:56 |
| Reporter | rof | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | new | Resolution | open | ||
| OS | Debian Bookworm | ||||
| Product Version | 5.12.6 | ||||
| Summary | 0006214: Signature duplicated when switching identity in compose (regression from 0005695 fix) | ||||
| Description | When a user switches the From address in the compose window (e.g. from their personal address to a shared/public mailbox), the signature is not removed and a second copy is appended. SOGo version: 5.12.8 (nightly 20260518-1) Setup:
| ||||
| Steps To Reproduce |
| ||||
| Additional Information | Root cause is in MessageEditorController.js, setFromIdentity function. The fix for 0005695 (commit b7e529d) replaced the original regex (lines 430-431): //var currentSignature = new RegExp('(' + reNl + '){' + nlNb + '}--' + space + reNl + with (line 432): var currentSignature = new RegExp('(<p>)?(<br ?\/?>( )?[ \n]?)?-- <br ?\/?>( )?[ \n]?(<\/p>)?' + currentIdentity.signature) Two problems:
Because the regex never matches, the old signature stays in place and a second copy is appended via the fallback paths (line 440 or lines 448-461). Suggested fix: restore use of the mode-aware variables AND regex escaping: var escapedSig = currentIdentity.signature.replace(/[-[]{}()*+?.,\^$|#\s]/g, '\$&'); The try/catch for 0005695 (regex too big) should remain as a fallback. | ||||
| Tags | identity, regression, signature | ||||
|
This is a duplicate of 0006168 |
|
|
Thanks for linking bug 0006168, but I believe commit 71d865b is actually the cause of the problem, not the fix. The issue persists on our installation with the latest nightly (5.12.8). Looking at the diff, the commit commented out the original regex (lines 427-428): var currentSignature = new RegExp('(' + reNl + '){' + nlNb + '}--' + space + reNl + and replaced it with (line 432): var currentSignature = new RegExp('(<p>)?(<br ?\/?>( )?[ \n]?)?-- <br ?\/?>( )?[ \n]?(<\/p>)?' + currentIdentity.signature) This replacement has two problems:
The nl2 and reNl2 variables added by the commit are never used in the actual regex on line 432. Because the regex never matches, the old signature is never removed, and the fallback paths (line 440 or 448-461) append it again, causing the duplication. The original commented-out code was correct in approach. A proper fix should restore the mode-aware variables and the escaping, while keeping the try/catch from 0005695: var escapedSig = currentIdentity.signature.replace(/[-[]{}()*+?.,\^$|#\s]/g, '\$&'); I can reproduce this 100% of the time with plain text compose mode (SOGoMailComposeMessageType = text) and a multi-line signature containing URLs. |
|