Download & Extend

Signature not removed, OG group not set for publication of discusisons in listhandler

Project:Mailhandler
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:#D7

Issue Summary

Hi,

The signature is not removed from emails I send, despite the "-- " being my signature cut-off point set in my Thunderbird email accoutn settings and as the signature cutoff point in mailhandler.

I am using mailhandler with listhandler and for some reason when new discussion topics are submitted, they are not assigned to the organic group despite this command set in mailhandler:

og_group: [421]

Strangely, replies to a topic ARE allocated to the group. Any ideas?

Thanks

Comments

#1

Version:5.x-1.2» 6.x-1.2
Component:Miscellaneous» Code
Status:active» needs review

The problem is that lines are trimmed before checking for the signature, which means that the trailing space is stripped and therefore doesn't match. My attached patch changes the signature check so that it is done against the untrimmed line.

AttachmentSize
mailhandler-signature.diff 517 bytes

#2

Status:needs review» patch (to be ported)

Committed to 6. Awaiting a D5 patch. Thanks.

#3

Not sure if this has been fixed yet, but I'm having the same problem. I even tried substituting "###" for the normal "-- " and it still doesn't recognize it, and lets it all flow through. Is there something I'm missing? Thanks.

#4

Version:6.x-1.2» 6.x-1.10

The issue is still present in the current version. Can anyone with better understanding of PHP than me have a look? I don't really understand how the patch could have fixed that. Thanks!

#5

Category:support request» bug report
Status:patch (to be ported)» active

Hi, here is an updated patch to correctly detect signatures from thunderbird, the current code will miss signatures from thunderbird when they begin like so:
<pre cols="72" class="moz-signature">--

AttachmentSize
mailhandler-6.x-1.10_handle-thunderbird-sigs.patch 770 bytes

#6

Status:active» postponed

thanks for this patch halcyonCorsair. I put back the $sig in the function signature and where it's called. I am going to hold off on putting in the moz-specific code for now. I imagine mozilla is not the only custom case. There should probably be a way to hook in here to do custom cleanup work.

#7

@Ian,

Even if we you don't add the custom bit for mozilla, you should be careful about the current lines:

    $start = substr($lines[$i], 0, strlen($sep)+3);
    if ($sep && strstr($start, $sep)) { // mail clients sometimes prefix replies with ' >'

I encountered the case with where an HTML email had a comment near the start:
<!-- Comment here.... -->
and an email signature separator of '--', which the strstr($start, $sep) picked up and proceeded to ignore the rest of the email.

#8

I have similar problems as noted in comment #7. Forwarded messages get cut off (they start with ----- forwarded message -----).

I don't think the code as written or any of the patches actually do what is being advertised, which is to cut off the body when you encounter a line that includes the designated separator (and only the designated separator).

Given the thunderbird issue - maybe a better long term solution is to enable the addition of multiple separators? Or a regular expression? In the meantime - I've attached a patch the operates based on what I think is the advertised behavior.

jamie

AttachmentSize
mailhandler.retrieve.inc_.sig_.patch 513 bytes

#9

Version:6.x-1.10» 6.x-1.x-dev
Status:postponed» needs review

such a nice problem.. thanks for the report!

nobody click here