Opened 6 years ago

Last modified 4 months ago

#4337 accepted defect (bug)

Blog by Email: No content is assumed

Reported by: jottlieb Owned by: westi
Priority: high Milestone: Future Release
Component: Blog by Email Version: 2.2
Severity: major Keywords:
Cc: cfactor, rob1n, lozzd

Description

It seems, the Blog by Email functions is broken in WP 2.2.
Mails are recognized, but only the title/subject is assumed - no content. Content is empty :(
No matter if text email or html email.

Author = bla@example.org 
 
Content-type: text/plain, Content-Transfer-Encoding: 8bit, boundary: 
 
Raw content:
 
Author: 1
 
Posted title: Test
Posted content:
 
Mission complete, message 1 deleted.

Attachments (3)

class-pop3.php.patch (896 bytes) - added by cfactor 6 years ago.
This version adds to the trailing period function to strip all leading periods added by the POP3 server.
4337.diff (618 bytes) - added by Nazgul 6 years ago.
4337.2.diff (13.1 KB) - added by westi 6 years ago.
Diff to update to current class-pop3.php from squirrelmail

Download all attachments as: .zip

Change History (39)

  • Milestone set to 2.4

jottlieb: I ran into this myself when I was setting up email blogging. I'm using dovecot as my pop3 server, if that could mean anything. I'm attaching a patch that solves it for me. I have not tested it with other POP3 servers can test it, it would be great.

The first change is what really fixes the problem. For some reason the blank line between the headers and the body was matching the original /\s+/, so I changed it to /\s+\S+/ so it can be used to only match the overrun header lines.

The second change is for something different. Since the $line doesn't get called until after the while check is done, by the time the message ending period hits the while check, it had already been added by the previous iteration. I tried adding the fgets line before the while loop and moving the existing one to after the current line is added to existing MsgArray, but for some reason, this times out. And yet, the script does exactly what I tried in function uidl (though it appears that wordpress never calls it.) So I just added the check where it checks for end of buffer.

cfactor6 years ago

This version adds to the trailing period function to strip all leading periods added by the POP3 server.

comment:3 follow-ups: ↓ 9 ↓ 13   cfactor6 years ago

I'm guessing no one saw the original patch, but I updated my patch to strip the extra periods added by the POP3 server according to RFC 1939.

  • Cc cfactor added
  • Keywords has-patch added; blog by email removed

Maybe adding in 'has-patch' will get someone's attention. ;)

comment:6   dmd6 years ago

  • Cc rob1n added
  • Milestone changed from 2.4 (future) to 2.3 (trunk)

This patch fixes the problem. This should be incorporated into 2.2.2 rather than waiting for 2.4.

This patch:

makes core functionality that used to work and is now broken start working again

and, importantly, can have NO possible effect on any other part of WordPress.

comment:7   dmd6 years ago

  • Milestone changed from 2.3 (trunk) to 2.2.2

comment:8   dmd6 years ago

  • Priority changed from normal to high
  • Severity changed from normal to major

Considering this bug causes posts to be thrown out by WordPress - user's data is irretrievably lost - I'm upping the priority/severity.

comment:9 in reply to: ↑ 3   Nazgul6 years ago

Replying to cfactor:

I'm guessing no one saw the original patch, but I updated my patch to strip the extra periods added by the POP3 server according to RFC 1939.

This is also fixed upstream, but in a different way:
http://squirrelmail.svn.sourceforge.net/viewvc/squirrelmail/branches/SM-1_4-STABLE/squirrelmail/plugins/mail_fetch/class.POP3.php?r1=12391&r2=12426

As for the other part. It should be reported upstream, so they can fix it at their end as well.

Scratch my remark about it being fixed upstream. That fix was for a similar issue in another part of the code. Their fix seems cleaner though, by not using ereg's.

Nazgul6 years ago

Cleaner patch.

  • Milestone changed from 2.2.2 to 2.2.3

comment:13 in reply to: ↑ 3   sfmobius6 years ago

Replying to cfactor:

I couldn't get either attached patch to function correctly w/v2.2. I did find a work around that works beautifully for those who aren't as technically minded. Use the "Postie" plug-in and then add

<iframe src="http://www.yoursite.com/blogdir/wp-content/plugins/postie/get_mail.php" name="mailiframe" width="0" height="0" frameborder="0" scrolling="no" title=""></iframe>

to your footer. It causes the postie mail.php file to run every time you get a visitor to your blog. Unless you need instant posting, it is a great work around in my humble opinion.

comment:14 follow-up: ↓ 17   cfactor6 years ago

Sorry for being out of touch. My mail server this account was sending mail to had a catastrophic hardware failure that caused it to go foom, and I've been too busy to fix it. Change the email setting to point to a webmail account for now.

Nazgul: your patch method of handling period is definitely cleaner and smarter, but it will add an extra blank line to the body of the message where the end of body period was, as that line would become "\r\n" and will not break on the empty($line) check. It probably won't matter to most people, but it's also not "proper."

sfmobius: I'd like to hear more about what happened when you tried either of our patches. When I was first setting up post-by-email, I thought about using Postie instead, but decided that I wanted to keep the installation simple and didn't want to add extra plugins I won't use. So yes, from what I've heard, Postie works well for a lot of people and is certainly more feature-rich. This fix is for those who want to stick with basic WordPress.

  • Milestone changed from 2.2.3 to 2.3
  • Owner changed from anonymous to westi
  • Status changed from new to assigned

westi6 years ago

Diff to update to current class-pop3.php from squirrelmail

comment:17 in reply to: ↑ 14 ; follow-up: ↓ 18   shadowdad6 years ago

Replying to cfactor:

Sorry for being out of touch. My mail server this account was sending mail to had a catastrophic hardware failure that caused it to go foom, and I've been too busy to fix it. Change the email setting to point to a webmail account for now.

Nazgul: your patch method of handling period is definitely cleaner and smarter, but it will add an extra blank line to the body of the message where the end of body period was, as that line would become "\r\n" and will not break on the empty($line) check. It probably won't matter to most people, but it's also not "proper."

sfmobius: I'd like to hear more about what happened when you tried either of our patches. When I was first setting up post-by-email, I thought about using Postie instead, but decided that I wanted to keep the installation simple and didn't want to add extra plugins I won't use. So yes, from what I've heard, Postie works well for a lot of people and is certainly more feature-rich. This fix is for those who want to stick with basic WordPress.

cfactor: followed here from your post on 4318. i am happy to reverify this fix. i have just been swapping in and out the wp-mail.php files to get post-by-mail to function. so i don't screw it up, if you could send a detailed list of how and where to apply patch (rob.shurtleff@…) i will be happy to test and report back

comment:18 in reply to: ↑ 17   cfactor6 years ago

Replying to shadowdad:

cfactor: followed here from your post on 4318. i am happy to reverify this fix. i have just been swapping in and out the wp-mail.php files to get post-by-mail to function. so i don't screw it up, if you could send a detailed list of how and where to apply patch (rob.shurtleff@…) i will be happy to test and report back

I don't have a working install right now to test, but here's what you do:

Download *one* of the files above in Attachments. (you'll want to click on the link to the file and then click on the "Original Format" link at the bottom of the page.) The first one is the one I tested and "works-for-me." I see no reason 4337.diff will break anything more than what is already broken, and aside from the extra line issue, I don't see any reason not to use that over mine. But I have not tested it. I have not had a chance to read through or test 4337.2.diff.

Then assuming you have shell access to a unix-based system, cd into the wp-includes directory of the wordpress install, and run "patch --dry-run -P1 < patchfile" Replace "patchfile" with location and filename of the patch you downloaded. This will test the patch to see if it'll apply cleanly to your installation. If it you see no errors, run it again with out the "--dry-run" to actually apply the patch, and you're done.

(In [6044]) Update pop3 class to latest from squirrelmail. Props westi. see #4337

I committed the upstream updates to the pop3 class. Does that help this issue?

Closed #4318 as a duplicate of this one.

  • Resolution set to fixed
  • Status changed from assigned to closed

Haven't heard anything. Assuming fixed.

  • Resolution fixed deleted
  • Status changed from closed to reopened

I don't know if I should open a new ticket but this problem is back, see

http://wordpress.org/support/topic/152039?replies=3

I have verified exactly the same problem as the poster in WP 2.3.3

  • Milestone changed from 2.3 to 2.6
  • Cc lozzd added
  • Milestone changed from 2.9 to 2.6.1

Upgraded to 2.6 and this is still happening from my Blackberry. Am using Postie for now, but any ideas when this will be fixed?

  • Keywords has-patch removed
  • Milestone changed from 2.6.1 to 2.9

2.6.1 has been released, moving to 2.9 milestone.

Post-by-email needs a fair chunk of work.

is this still current?

  • Component changed from General to Mail
  • Keywords reporter-feedback added

Do we have a testcase for this? Can the reporter please confirm that this is still current? Are there others doing mail blogging?

I'd assume its still current, nothing has changed around here.

Test case: Send an email to WordPress through as many mail servers as you can until you find one that fails.

Include a full email (including headers) received by WordPress which fails. Until that happens, Its going to be hit-and-miss sorting it out.

  • Component changed from Mail to Blog by Email
  • Status changed from reopened to accepted

Moving all blog-by-email bugs to a seperate component and out of 2.9.

This will all be address by a new canonical blog-by-email plugin which is under development and will hopefully be available by the time 2.9 is released.

  • Milestone changed from 2.9 to Future Release

comment:33 follow-up: ↓ 34   RyanMurphy3 years ago

Since blog-by-email is/has moved to a plugin, and since there hasn't been anything on here for 11 months, should the ticket be wontfix'd?

comment:34 in reply to: ↑ 33   westi3 years ago

Replying to RyanMurphy:

Since blog-by-email is/has moved to a plugin, and since there hasn't been anything on here for 11 months, should the ticket be wontfix'd?

Once the plugin is released and we have confirmed this bug is resolved the ticket will be closed.

In version 3.2 'Post via email' is still part of WordPress I presume this is still an issue? Or are there still plans to develop a canonical blog-by-email plugin? Would be great if someone could tell more about this.

  • Keywords reporter-feedback removed

Any takers / closers?

Note: See TracTickets for help on using tickets.