Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message::move() doesn't work. #73

Closed
mvar opened this issue Feb 6, 2015 · 3 comments
Closed

Message::move() doesn't work. #73

mvar opened this issue Feb 6, 2015 · 3 comments
Labels
Milestone

Comments

@mvar
Copy link
Contributor

mvar commented Feb 6, 2015

I'm trying to move email to another mailbox. Library does not return any error. Looks like success, but email isn't moved.

$message->move($this->mailboxProcessed);
$this->mailboxProcessed->expunge();

Also another issue is, that emails cannot be moved in a loop. Strange, but this issue occurs even when emails doesn't get moved:

[Ddeboer\Imap\Exception\MessageDoesNotExistException]
Message 4 does not exist: imap_fetchstructure(): Bad message number

I'm trying to move email on Bluehost email server.

@ddeboer ddeboer added this to the 1.0 milestone Feb 16, 2015
@skynet
Copy link

skynet commented Jun 30, 2015

Was this fixed?

@pedrosoares
Copy link

I Fix that using this method:
`

<?php



namespace App\Mail;



use Ddeboer\Imap;



class Message extends Imap\Message{

public function __construct($stream, $messageNumber){
    if($stream == null)
        return;
    parent::__construct($stream, $messageNumber);
}

public function move(Imap\Mailbox $mailbox){
    $m = parent::move($mailbox);
    imap_expunge($this->stream);
    return $m;
}

public static function parse(Imap\Message $object){
    $obj = new Message(null,null);
    foreach (get_object_vars($object) as $key => $name) {
        $obj->$key = $name;
    }
    return $obj;
}



}`

@Slamdunk Slamdunk added the bug label Sep 22, 2017
Slamdunk added a commit that referenced this issue Sep 29, 2017
Fix imap_mail_move behaviour and test it
Close #73
@Slamdunk
Copy link
Collaborator

There was a bug fixed in #207 but also remember to call $connection->expunge() 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants