Fixed timing issue

This commit is contained in:
M66B 2019-02-26 09:09:46 +00:00
parent 9264fd1539
commit 493038de24
1 changed files with 4 additions and 1 deletions

View File

@ -54,7 +54,6 @@ import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.protocol.FetchResponse;
import com.sun.mail.imap.protocol.IMAPProtocol;
import com.sun.mail.imap.protocol.UID;
import com.sun.mail.smtp.SMTPTransport;
import com.sun.mail.util.FolderClosedIOException;
import com.sun.mail.util.MailConnectException;
@ -1851,6 +1850,10 @@ public class ServiceSynchronize extends LifecycleService {
long uid = append(istore, itarget, (MimeMessage) icopy);
Log.i(target.name + " appended id=" + message.id + " uid=" + uid);
// Fixed timing issue of at least Courier based servers
itarget.close(false);
itarget.open(Folder.READ_WRITE);
// Some providers, like Gmail, don't honor the appended seen flag
if (itarget.getPermanentFlags().contains(Flags.Flag.SEEN)) {
boolean seen = (autoread || message.ui_seen);