Spinoff from #2107789: URLs stripped from first line of emails

Patch has been committed for 6.x-2.x and 7.x-2.x (thanks rclemings).

Comments

rclemings’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.87 KB

This patch is intended to ensure that a line which:

(a) contains a colon,
(b) appears at the top of an email body, and
(c) is not actually a command

is not treated as a command and is not (wrongly) removed from the email body.

The patch examines each line (via function getCommands) and treats the part before the colon as a command only if the same command is listed in available_commands.

So incoming emails with first lines like:

http://drupal.org
Link: http://drupal.org
Hello: world

... which are not really commands, will not be regarded as commands and will remain in the email body rather than being stripped.

(Modifies MailhandlerCommandsDefault.class.php)

danepowell’s picture

Thanks- if the tests pass, I will commit this and be sure to attribute it to you.

Status: Needs review » Needs work

The last submitted patch, mailhandler-2115975-1.patch, failed testing.

rclemings’s picture

StatusFileSize
new1.88 KB
rclemings’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, mailhandler-2115975-4.patch, failed testing.

rclemings’s picture

Only one failure left but I'm not clear on what it is and how to fix it. Suggestions?

danepowell’s picture

Looks like the default commands for authenticated user are getting applied to anonymous users, so the node is getting published when it shouldn't be.

rclemings’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new2.86 KB
danepowell’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Needs review » Patch (to be ported)
rclemings’s picture

StatusFileSize
new2.88 KB

The relevant functions look exactly the same to me so let's see if this works.

rclemings’s picture

Status: Patch (to be ported) » Needs review
danepowell’s picture

Issue summary: View changes
Status: Needs review » Fixed

http://drupalcode.org/project/mailhandler.git/commit/fff1841

Thanks for contributing. Also, next time please take a look at the Drupal code style guidelines and make sure your code passes Coder Review (you are missing spaces before parentheses).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.