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

mgorven’s picture

Version: 5.x-1.2 » 6.x-1.2
Component: Miscellaneous » Code
Status: Active » Needs review
StatusFileSize
new517 bytes

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.

moshe weitzman’s picture

Status: Needs review » Patch (to be ported)

Committed to 6. Awaiting a D5 patch. Thanks.

kirkcaraway’s picture

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.

lblume’s picture

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!

halcyonCorsair’s picture

Category: support » bug
Status: Patch (to be ported) » Active
StatusFileSize
new770 bytes

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">-- 
Ian Ward’s picture

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.

halcyonCorsair’s picture

@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.

jmcclelland’s picture

StatusFileSize
new513 bytes

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

ilo’s picture

Version: 6.x-1.10 » 6.x-1.x-dev
Status: Postponed » Needs review
Issue tags: +#D7

such a nice problem.. thanks for the report!

danepowell’s picture

Component: Code » Mailhandler
Status: Needs review » Closed (won't fix)

Sorry, Mailhandler 6.x-1.x / 7.x-1.x are no longer supported. Please upgrade to 6.x-2.x / 7.x-2.x and re-open if still an issue. Thanks!