WordPress.org

Ready to get started?Download WordPress

Forums

Blog by email: No body showing (29 posts)

  1. JSiefer
    Member
    Posted 8 years ago #

    I have gotten the blog by email function to work correctly. It will display that I have email when I check the wp-mail.php address and runs normally except... it is not posting the actual body of the email- only the header. Is this due to the partiuclar POP account that I'm using or perhaps something else...? Any thoughts are greatly appreciated. -J.

  2. JSiefer
    Member
    Posted 8 years ago #

    Here is an update on what it reports. NO POSTED CONTENT!

    Author = Email@Address.Com

    Content-type: multipart/alternative, boundary: ----=_Part_26016_4682939.1155229664260

    Raw content:

    Author: 1

    Posted title: Test Title
    Posted content:

    Mission complete, message 1 deleted.

    Any thoughts? Anybody? Please!

  3. thomasw98
    Member
    Posted 8 years ago #

    Hi J: I had the same problem and I figured out that it was because I was sending the emails in HTML format instead of plain text. So now the bodies show up no problem EXCEPT they are all garbage characters. I am still working on this problem but you can try the "text" method of sending to see if this solves your problem.

  4. Pedigree
    Member
    Posted 7 years ago #

    Hi,
    Anyone resolved this one yet ? If I send an email from my cell phone it reads the body, if I send from my pc email programme it does not (html or plain) ... but it did when I first set it up 2 days back.
    Infuriating or what ?
    Before I ditch WordPress for something else ... any words of wisdom out there ?
    Thanks.

  5. Pedigree
    Member
    Posted 7 years ago #

    Hi all,

    I tried a couple of things to solve this :-

    (1) Copying all files across fresh to overwrite the previous files ... did not work

    (2) Go to the MySQL database and manually delete the wp- tables and rerun the setup ... that worked ! OK, you lose all postings, accounts etc, but it worked.

    Only thing I did different was to play with a couple of the themes recommended through the wordpress website (I installed a Christmas one). I tried going back to the default before doing #2 above and that did not solve it.

    For now, its working.

  6. Pedigree
    Member
    Posted 7 years ago #

    OK, a week later, haven't customised with any themes etc and the problem has started again. The email to blog function is so incredibly useful, how come there is no solution ?

    Am now searching for other blogging software. Pity !

  7. peymano
    Member
    Posted 7 years ago #

    It looks as though multipart messages aren't being parsed correctly. I made a quick fix to wp-mail.php:

    Approx 165 lines in, you'll see:

    if ($content_type == 'multipart/alternative') {
    $content = explode('--'.$boundary, $content);
    $content = $content[2];
    $content = explode('Content-Transfer-Encoding: quoted-printable', $content);
    $content = strip_tags($content[1], '<img><p><br><i><b><u><strike><font><span><div>');
    }

    Just change the line that reads:

    $content = explode('Content-Transfer-Encoding: quoted-printable', $content);

    into:

    $content = explode("\r\n\r\n", $content, 2);

  8. martinauer
    Member
    Posted 7 years ago #

    In WordPress 2.2 (running on a Server with PHP 4.4.3) I managed to solve the problem in this way:

    in wp-includes/class-pop3.php I commented out line 372 "continue;

    I admit it was a bit of guesswork. I did not study the logic in depth, but I found out that in wp-mail.php $bodysignal never got set to true because the empty line that serves as the signal for the beginning of the body did not get written into the array $message.

    If you are a coder you will understand what I mean.
    If not, just try it and hopefully it will work for you too :)

    Martin

  9. rkollmeyer
    Member
    Posted 7 years ago #

    Commenting out line 372 "continue;" in clas-pop3.php took care of that problem for me too.

    Thanks for the help, Martinauer!

  10. michaelea
    Member
    Posted 7 years ago #

    Commenting out line 372 worked for me (thank you martinauer) - I feel like I'm a programmer now or something :) - just 1 more "quick" question tho'....

    I like the look of peymano's suggestion as well and am wondering if that works and what the difference is between the two offered solutions - programatically wise I mean?

    I'm happy with the line 372 solution but am wondering what the long term effects might be for either of the solutions above..

    Thanks a lot if you can help me here...

  11. michaelea
    Member
    Posted 7 years ago #

    Addendum: also, if peymano's solution was tried by others how come no-one commented on whether it worked or not or even said "thank you" ??

  12. Michael Clark
    Member
    Posted 7 years ago #

    I tried peymano's solution. It did not work under WordPress 2.2.

    martinauer's solution did work, except that there the last line in the email is duplicated.

  13. jockotomen
    Member
    Posted 7 years ago #

    I used Martinauers solution. Some success. But I just got like the firs 20 characters i the body showing up in the blogEntry.

  14. mollerhansen
    Member
    Posted 7 years ago #

    any one found a solutions that doesn't make the errors?

    Have the exact same error - no body.
    Neither with plain text mails!

  15. rkollmeyer
    Member
    Posted 7 years ago #

    Looks like an official solution has just been posted in the WordPress Trac!

    http://trac.wordpress.org/ticket/4337

    I haven't tried to implement the solution yet, but I just found it and thought it might help someone out.

  16. stewar67
    Member
    Posted 7 years ago #

    Looks like an official solution has just been posted in the WordPress Trac!

    any luck with that? i tried it but now i just get

    Parse error: parse error, unexpected T_STRING in /home/httpd/vhosts/example.com/httpdocs/wp-includes/class-pop3.php on line 374

    and i've tripled-checked my mods against the Trac code...

    guess i'll go and try the earlier suggestion from above...

  17. riggie11
    Member
    Posted 7 years ago #

    Well I simply replaced lines 367 - 379 in /wp-includes/class-pop3.php with this code below(which I took from the above solution in WordPress Trac) and it worked. I also commented out "continue;" ...

    Works perfectly in 2 blogs I have in WP 2.2.
    -Riggie
    -------------------------------------------------

    while ( !ereg("^\.\r\n",$line))
    {
    $line = fgets($fp,$buffer);
    if (preg_match("/^\s+/", $line) && $count > 0) {
    $MsgArray[$count-1] .= $line;
    // continue;
    }
    if(empty($line)) { break; }
    if ((ereg("^\.\r\n",$line)) || (empty($line))) { break; }

    //Strip any extra leading periods and store the result
    if (ereg("^\.\.", $line)) {
    $MsgArray[$count] = substr($line, 1);
    } else {
    $MsgArray[$count] = $line;
    }

    $MsgArray[$count] = $line;
    $count++;
    }
    return $MsgArray;

  18. pikey
    Member
    Posted 7 years ago #

    Hi,

    This addition to the code worked for me, it gets rid of the extra point. But only when sending emails from my pc. When the blog owner sent an email, the content is blank, and when sent from his mobile device nothing arrived at all. Suppose this was the way he sent it? HTML or something which I am looking in to.

    Even more bizarrely, one entry was stored under > manage > posts > but the title was <!--enpts-->Test 3<!--enpte-->. The post did not display on the site at all, but you could preview. Strange.

    Also, when sending an image, the image does not show inline but as a bunch of code.

    In this day and age there must be so much demand for these services, I am surprised I can not send email messages (with images) from my mobile phone as a standard, or even find usable extensions or codec docs to add this usability to my blog.

    Anybody have any ideas, suggestions?

  19. blmooreiii
    Member
    Posted 7 years ago #

    I am utterly lost. I cant tell when line 367 begins. I am looking at it throught word pad and notebook and nothing. Suggestions?

    If someoneo just have the edited class-php file already downloaded and post it that would be cool too

  20. riggie11
    Member
    Posted 7 years ago #

    I posted the version of class-pop3.php here below which works for me. Simply copy the code below and replace class-pop3.php in your wp/wp-includes/ folder.
    -Riggie
    -----------------------------------------
    <?php

    /**
    * mail_fetch/setup.php
    *
    * Copyright (c) 1999-2006 The SquirrelMail Project Team
    *
    * Copyright (c) 1999 CDI (cdi@thewebmasters.net) All Rights Reserved
    * Modified by Philippe Mingo 2001 mingo@rotedic.com
    * An RFC 1939 compliant wrapper class for the POP3 protocol.
    *
    * Licensed under the GNU GPL. For full terms see the file COPYING.
    *
    * pop3 class
    *
    * $Id: class-pop3.php 4945 2007-02-25 18:19:21Z ryan $
    */

    class POP3 {
    var $ERROR = ''; // Error string.

    var $TIMEOUT = 60; // Default timeout before giving up on a
    // network operation.

    var $COUNT = -1; // Mailbox msg count

    var $BUFFER = 512; // Socket buffer for socket fgets() calls.
    // Per RFC 1939 the returned line a POP3
    // server can send is 512 bytes.

    var $FP = ''; // The connection to the server's
    // file descriptor

    var $MAILSERVER = ''; // Set this to hard code the server name

    var $DEBUG = FALSE; // set to true to echo pop3
    // commands and responses to error_log
    // this WILL log passwords!

    var $BANNER = ''; // Holds the banner returned by the
    // pop server - used for apop()

    var $ALLOWAPOP = FALSE; // Allow or disallow apop()
    // This must be set to true
    // manually

    function POP3 ( $server = '', $timeout = '' ) {
    settype($this->BUFFER,"integer");
    if( !empty($server) ) {
    // Do not allow programs to alter MAILSERVER
    // if it is already specified. They can get around
    // this if they -really- want to, so don't count on it.
    if(empty($this->MAILSERVER))
    $this->MAILSERVER = $server;
    }
    if(!empty($timeout)) {
    settype($timeout,"integer");
    $this->TIMEOUT = $timeout;
    if (!ini_get('safe_mode'))
    set_time_limit($timeout);
    }
    return true;
    }

    function update_timer () {
    if (!ini_get('safe_mode'))
    set_time_limit($this->TIMEOUT);
    return true;
    }

    function connect ($server, $port = 110) {
    // Opens a socket to the specified server. Unless overridden,
    // port defaults to 110. Returns true on success, false on fail

    // If MAILSERVER is set, override $server with it's value

    if (!isset($port) || !$port) {$port = 110;}
    if(!empty($this->MAILSERVER))
    $server = $this->MAILSERVER;

    if(empty($server)){
    $this->ERROR = _("POP3 connect:") . ' ' . _("No server specified");
    unset($this->FP);
    return false;
    }

    $fp = @fsockopen("$server", $port, $errno, $errstr);

    if(!$fp) {
    $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$errno] [$errstr]";
    unset($this->FP);
    return false;
    }

    socket_set_blocking($fp,-1);
    $this->update_timer();
    $reply = fgets($fp,$this->BUFFER);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG)
    error_log("POP3 SEND [connect: $server] GOT [$reply]",0);
    if(!$this->is_ok($reply)) {
    $this->ERROR = _("POP3 connect:") . ' ' . _("Error ") . "[$reply]";
    unset($this->FP);
    return false;
    }
    $this->FP = $fp;
    $this->BANNER = $this->parse_banner($reply);
    return true;
    }

    function user ($user = "") {
    // Sends the USER command, returns true or false

    if( empty($user) ) {
    $this->ERROR = _("POP3 user:") . ' ' . _("no login ID submitted");
    return false;
    } elseif(!isset($this->FP)) {
    $this->ERROR = _("POP3 user:") . ' ' . _("connection not established");
    return false;
    } else {
    $reply = $this->send_cmd("USER $user");
    if(!$this->is_ok($reply)) {
    $this->ERROR = _("POP3 user:") . ' ' . _("Error ") . "[$reply]";
    return false;
    } else
    return true;
    }
    }

    function pass ($pass = "") {
    // Sends the PASS command, returns # of msgs in mailbox,
    // returns false (undef) on Auth failure

    if(empty($pass)) {
    $this->ERROR = _("POP3 pass:") . ' ' . _("No password submitted");
    return false;
    } elseif(!isset($this->FP)) {
    $this->ERROR = _("POP3 pass:") . ' ' . _("connection not established");
    return false;
    } else {
    $reply = $this->send_cmd("PASS $pass");
    if(!$this->is_ok($reply)) {
    $this->ERROR = _("POP3 pass:") . ' ' . _("Authentication failed ") . "[$reply]";
    $this->quit();
    return false;
    } else {
    // Auth successful.
    $count = $this->last("count");
    $this->COUNT = $count;
    return $count;
    }
    }
    }

    function apop ($login,$pass) {
    // Attempts an APOP login. If this fails, it'll
    // try a standard login. YOUR SERVER MUST SUPPORT
    // THE USE OF THE APOP COMMAND!
    // (apop is optional per rfc1939)

    if(!isset($this->FP)) {
    $this->ERROR = _("POP3 apop:") . ' ' . _("No connection to server");
    return false;
    } elseif(!$this->ALLOWAPOP) {
    $retVal = $this->login($login,$pass);
    return $retVal;
    } elseif(empty($login)) {
    $this->ERROR = _("POP3 apop:") . ' ' . _("No login ID submitted");
    return false;
    } elseif(empty($pass)) {
    $this->ERROR = _("POP3 apop:") . ' ' . _("No password submitted");
    return false;
    } else {
    $banner = $this->BANNER;
    if( (!$banner) or (empty($banner)) ) {
    $this->ERROR = _("POP3 apop:") . ' ' . _("No server banner") . ' - ' . _("abort");
    $retVal = $this->login($login,$pass);
    return $retVal;
    } else {
    $AuthString = $banner;
    $AuthString .= $pass;
    $APOPString = md5($AuthString);
    $cmd = "APOP $login $APOPString";
    $reply = $this->send_cmd($cmd);
    if(!$this->is_ok($reply)) {
    $this->ERROR = _("POP3 apop:") . ' ' . _("apop authentication failed") . ' - ' . _("abort");
    $retVal = $this->login($login,$pass);
    return $retVal;
    } else {
    // Auth successful.
    $count = $this->last("count");
    $this->COUNT = $count;
    return $count;
    }
    }
    }
    }

    function login ($login = "", $pass = "") {
    // Sends both user and pass. Returns # of msgs in mailbox or
    // false on failure (or -1, if the error occurs while getting
    // the number of messages.)

    if( !isset($this->FP) ) {
    $this->ERROR = _("POP3 login:") . ' ' . _("No connection to server");
    return false;
    } else {
    $fp = $this->FP;
    if( !$this->user( $login ) ) {
    // Preserve the error generated by user()
    return false;
    } else {
    $count = $this->pass($pass);
    if( (!$count) || ($count == -1) ) {
    // Preserve the error generated by last() and pass()
    return false;
    } else
    return $count;
    }
    }
    }

    function top ($msgNum, $numLines = "0") {
    // Gets the header and first $numLines of the msg body
    // returns data in an array with each returned line being
    // an array element. If $numLines is empty, returns
    // only the header information, and none of the body.

    if(!isset($this->FP)) {
    $this->ERROR = _("POP3 top:") . ' ' . _("No connection to server");
    return false;
    }
    $this->update_timer();

    $fp = $this->FP;
    $buffer = $this->BUFFER;
    $cmd = "TOP $msgNum $numLines";
    fwrite($fp, "TOP $msgNum $numLines\r\n");
    $reply = fgets($fp, $buffer);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) {
    @error_log("POP3 SEND [$cmd] GOT [$reply]",0);
    }
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 top:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }

    $count = 0;
    $MsgArray = array();

    $line = fgets($fp,$buffer);
    while ( !ereg("^\.\r\n",$line))
    {
    $MsgArray[$count] = $line;
    $count++;
    $line = fgets($fp,$buffer);
    if(empty($line)) { break; }
    }

    return $MsgArray;
    }

    function pop_list ($msgNum = "") {
    // If called with an argument, returns that msgs' size in octets
    // No argument returns an associative array of undeleted
    // msg numbers and their sizes in octets

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 pop_list:") . ' ' . _("No connection to server");
    return false;
    }
    $fp = $this->FP;
    $Total = $this->COUNT;
    if( (!$Total) or ($Total == -1) )
    {
    return false;
    }
    if($Total == 0)
    {
    return array("0","0");
    // return -1; // mailbox empty
    }

    $this->update_timer();

    if(!empty($msgNum))
    {
    $cmd = "LIST $msgNum";
    fwrite($fp,"$cmd\r\n");
    $reply = fgets($fp,$this->BUFFER);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) {
    @error_log("POP3 SEND [$cmd] GOT [$reply]",0);
    }
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }
    list($junk,$num,$size) = preg_split('/\s+/',$reply);
    return $size;
    }
    $cmd = "LIST";
    $reply = $this->send_cmd($cmd);
    if(!$this->is_ok($reply))
    {
    $reply = $this->strip_clf($reply);
    $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }
    $MsgArray = array();
    $MsgArray[0] = $Total;
    for($msgC=1;$msgC <= $Total; $msgC++)
    {
    if($msgC > $Total) { break; }
    $line = fgets($fp,$this->BUFFER);
    $line = $this->strip_clf($line);
    if(ereg("^\.",$line))
    {
    $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
    return false;
    }
    list($thisMsg,$msgSize) = preg_split('/\s+/',$line);
    settype($thisMsg,"integer");
    if($thisMsg != $msgC)
    {
    $MsgArray[$msgC] = "deleted";
    }
    else
    {
    $MsgArray[$msgC] = $msgSize;
    }
    }
    return $MsgArray;
    }

    function get ($msgNum) {
    // Retrieve the specified msg number. Returns an array
    // where each line of the msg is an array element.

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 get:") . ' ' . _("No connection to server");
    return false;
    }

    $this->update_timer();

    $fp = $this->FP;
    $buffer = $this->BUFFER;
    $cmd = "RETR $msgNum";
    $reply = $this->send_cmd($cmd);

    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 get:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }

    $count = 0;
    $MsgArray = array();

    $line = "";
    while ( !ereg("^\.\r\n",$line))
    {
    $line = fgets($fp,$buffer);
    if (preg_match("/^\s+/", $line) && $count > 0) {
    $MsgArray[$count-1] .= $line;
    // continue;
    }
    if(empty($line)) { break; }
    if ((ereg("^\.\r\n",$line)) || (empty($line))) { break; }

    //Strip any extra leading periods and store the result
    if (ereg("^\.\.", $line)) {
    $MsgArray[$count] = substr($line, 1);
    } else {
    $MsgArray[$count] = $line;
    }

    $MsgArray[$count] = $line;
    $count++;
    }
    return $MsgArray;
    }

    function last ( $type = "count" ) {
    // Returns the highest msg number in the mailbox.
    // returns -1 on error, 0+ on success, if type != count
    // results in a popstat() call (2 element array returned)

    $last = -1;
    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 last:") . ' ' . _("No connection to server");
    return $last;
    }

    $reply = $this->send_cmd("STAT");
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 last:") . ' ' . _("Error ") . "[$reply]";
    return $last;
    }

    $Vars = preg_split('/\s+/',$reply);
    $count = $Vars[1];
    $size = $Vars[2];
    settype($count,"integer");
    settype($size,"integer");
    if($type != "count")
    {
    return array($count,$size);
    }
    return $count;
    }

    function reset () {
    // Resets the status of the remote server. This includes
    // resetting the status of ALL msgs to not be deleted.
    // This method automatically closes the connection to the server.

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 reset:") . ' ' . _("No connection to server");
    return false;
    }
    $reply = $this->send_cmd("RSET");
    if(!$this->is_ok($reply))
    {
    // The POP3 RSET command -never- gives a -ERR
    // response - if it ever does, something truely
    // wild is going on.

    $this->ERROR = _("POP3 reset:") . ' ' . _("Error ") . "[$reply]";
    @error_log("POP3 reset: ERROR [$reply]",0);
    }
    $this->quit();
    return true;
    }

    function send_cmd ( $cmd = "" )
    {
    // Sends a user defined command string to the
    // POP server and returns the results. Useful for
    // non-compliant or custom POP servers.
    // Do NOT includ the \r\n as part of your command
    // string - it will be appended automatically.

    // The return value is a standard fgets() call, which
    // will read up to $this->BUFFER bytes of data, until it
    // encounters a new line, or EOF, whichever happens first.

    // This method works best if $cmd responds with only
    // one line of data.

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 send_cmd:") . ' ' . _("No connection to server");
    return false;
    }

    if(empty($cmd))
    {
    $this->ERROR = _("POP3 send_cmd:") . ' ' . _("Empty command string");
    return "";
    }

    $fp = $this->FP;
    $buffer = $this->BUFFER;
    $this->update_timer();
    fwrite($fp,"$cmd\r\n");
    $reply = fgets($fp,$buffer);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
    return $reply;
    }

    function quit() {
    // Closes the connection to the POP3 server, deleting
    // any msgs marked as deleted.

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 quit:") . ' ' . _("connection does not exist");
    return false;
    }
    $fp = $this->FP;
    $cmd = "QUIT";
    fwrite($fp,"$cmd\r\n");
    $reply = fgets($fp,$this->BUFFER);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
    fclose($fp);
    unset($this->FP);
    return true;
    }

    function popstat () {
    // Returns an array of 2 elements. The number of undeleted
    // msgs in the mailbox, and the size of the mbox in octets.

    $PopArray = $this->last("array");

    if($PopArray == -1) { return false; }

    if( (!$PopArray) or (empty($PopArray)) )
    {
    return false;
    }
    return $PopArray;
    }

    function uidl ($msgNum = "")
    {
    // Returns the UIDL of the msg specified. If called with
    // no arguments, returns an associative array where each
    // undeleted msg num is a key, and the msg's uidl is the element
    // Array element 0 will contain the total number of msgs

    if(!isset($this->FP)) {
    $this->ERROR = _("POP3 uidl:") . ' ' . _("No connection to server");
    return false;
    }

    $fp = $this->FP;
    $buffer = $this->BUFFER;

    if(!empty($msgNum)) {
    $cmd = "UIDL $msgNum";
    $reply = $this->send_cmd($cmd);
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }
    list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply);
    return $myUidl;
    } else {
    $this->update_timer();

    $UIDLArray = array();
    $Total = $this->COUNT;
    $UIDLArray[0] = $Total;

    if ($Total < 1)
    {
    return $UIDLArray;
    }
    $cmd = "UIDL";
    fwrite($fp, "UIDL\r\n");
    $reply = fgets($fp, $buffer);
    $reply = $this->strip_clf($reply);
    if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); }
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
    return false;
    }

    $line = "";
    $count = 1;
    $line = fgets($fp,$buffer);
    while ( !ereg("^\.\r\n",$line)) {
    if(ereg("^\.\r\n",$line)) {
    break;
    }
    list ($msg,$msgUidl) = preg_split('/\s+/',$line);
    $msgUidl = $this->strip_clf($msgUidl);
    if($count == $msg) {
    $UIDLArray[$msg] = $msgUidl;
    }
    else
    {
    $UIDLArray[$count] = 'deleted';
    }
    $count++;
    $line = fgets($fp,$buffer);
    }
    }
    return $UIDLArray;
    }

    function delete ($msgNum = "") {
    // Flags a specified msg as deleted. The msg will not
    // be deleted until a quit() method is called.

    if(!isset($this->FP))
    {
    $this->ERROR = _("POP3 delete:") . ' ' . _("No connection to server");
    return false;
    }
    if(empty($msgNum))
    {
    $this->ERROR = _("POP3 delete:") . ' ' . _("No msg number submitted");
    return false;
    }
    $reply = $this->send_cmd("DELE $msgNum");
    if(!$this->is_ok($reply))
    {
    $this->ERROR = _("POP3 delete:") . ' ' . _("Command failed ") . "[$reply]";
    return false;
    }
    return true;
    }

    // *********************************************************

    // The following methods are internal to the class.

    function is_ok ($cmd = "") {
    // Return true or false on +OK or -ERR

    if( empty($cmd) )
    return false;
    else
    return( ereg ("^\+OK", $cmd ) );
    }

    function strip_clf ($text = "") {
    // Strips \r\n from server responses

    if(empty($text))
    return $text;
    else {
    $stripped = str_replace("\r",'',$text);
    $stripped = str_replace("\n",'',$stripped);
    return $stripped;
    }
    }

    function parse_banner ( $server_text ) {
    $outside = true;
    $banner = "";
    $length = strlen($server_text);
    for($count =0; $count < $length; $count++)
    {
    $digit = substr($server_text, $count, 1);
    if (!empty($digit)) {
    if( (!$outside) && ($digit != '<') && ($digit != '>') )
    {
    $banner .= $digit;
    }
    if ($digit == '<')
    {
    $outside = false;
    }
    if($digit == '>')
    {
    $outside = true;
    }
    }
    }
    $banner = $this->strip_clf($banner); // Just in case
    return "<$banner>";
    }

    } // End class

    ?>

  21. Bobcat
    Member
    Posted 7 years ago #

    Just a note that I applied the Trac patch listed above to my blog, and it solved the problem.

  22. igudo
    Member
    Posted 7 years ago #

  23. wellofdreams
    Member
    Posted 7 years ago #

    I'm using the above script, but I still dont get a body posted. Any other ideas? I'm using 2.2.1

  24. snoopylover
    Member
    Posted 7 years ago #

    I've updated the code in class-pop3.php and the body shows now. But no matter how I send it (HTML, Plain TXT, Western ISO or UTF-8) the body has added "=" and other characters. Any suggestions?

  25. gonzoradio
    Member
    Posted 7 years ago #

    Installed WordPress only 2 days ago. Using wp-cron en wp-cron-mail, i received te mails without body from cell, lotus notes AND Gmail.
    The cell email got the body ok, but the subject has iso info preceding subject text.
    Finally without patching got gmail to get it right, using the plain-text option when composing. This only works if not sent in UTF8 format.
    After replacing the complete class-pop3.php with above mentioned complete patch: no body from gmail. Cell gave ame result as before. Weird.

  26. schultzy
    Member
    Posted 7 years ago #

    I recently installed WordPress and have been trying to blog by email and was not getting the body of the email to post. I have tried using the code riggie11 posted, but it still isn't working correctly. This is what I got when I tried doing an email post.

    I am testing out the Blog By Email =
    feature of Word=20
    Press. I am not sure if I will keep it even if it works. I =
    run the=20
    risk of the email address getting SPAMMED and what gets sent to the =
    email=20
    address gets posted. I will just have to wait and=20
    see.

  27. djchuang
    Member
    Posted 7 years ago #

    This seems to be a rather elusive fix, since POP3 emails can involve quite a number of factors. I've used igudo's fix above, which helps, but I'm told that when you enter a double-quote, that the post via email will be prematurely ended. Or, there may be leading spaces and blanks in front of a blog post.

    I've got a discussion in the comment thread at http://www.djchuang.com/2007/wordpress-fix-for-blog-post-via-email/

  28. J3ff
    Member
    Posted 7 years ago #

    peymano's fix worked perfectly for me (running 2.2). It even works with mail sent from gmail. Great job friend.

  29. djchuang
    Member
    Posted 7 years ago #

    I just tried the peymano fix today (now I'm running WP 2.2.2 - latest recent security update) and that only got me a title on the post via email. The message body didn't make it through, and the blog entry was blank. :(

Topic Closed

This topic has been closed to new replies.

About this Topic