Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How does IMAP handle conflicts?

70 views
Skip to first unread message

Tristan Miller

unread,
May 27, 2013, 5:09:29 AM5/27/13
to
Greetings.

I've always been curious about how IMAP in offline mode handles conflicts
during synchronization.

For example, say we have an IMAP account with three mail folders: Inbox,
Foo, and Bar. Fred and Barney both check the account with their respective
machines, and see that there's a message in the Inbox. While offline, Fred
moves the message from Inbox to Foo, and Barney moves it from Inbox to Bar.
Then Fred and Barney both synchronize their clients with the IMAP server.
What happens to the message?

Regards,
Tristan

--
_
_V.-o Tristan Miller >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=- <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you

Bruce Esquibel

unread,
May 27, 2013, 9:26:04 AM5/27/13
to
Tristan Miller <psych...@nothingisreal.com> wrote:

> For example, say we have an IMAP account with three mail folders: Inbox,
> Foo, and Bar. Fred and Barney both check the account with their respective
> machines, and see that there's a message in the Inbox. While offline, Fred
> moves the message from Inbox to Foo, and Barney moves it from Inbox to Bar.
> Then Fred and Barney both synchronize their clients with the IMAP server.
> What happens to the message?

Isn't this one of those things that cause a rip in the universe and
everything gets sucked in a black hole?

I don't know the exact answer but likely whoever went online first after
working offline gets the message moved to where they wanted it.

The johnny-come-lately who connects next just gets a copy in the mailbox the
other person moved it to, in which they can move it again if need be.

One thing to point out, you are talking about two people sharing one
account, which in my opinion is never a good idea. On our system some of the
businesses that need multiple people sharing one account (like info@), each
person has their own account and an alias is configured to drop the mail
into each of their accounts.

That way each person can do whatever they want with any particular message
without stepping on someone else toes.

-bruce
b...@ripco.com

Thor Kottelin

unread,
May 27, 2013, 9:38:48 AM5/27/13
to
"Bruce Esquibel" <b...@ripco.com> wrote in message
news:knvmtc$n1r$1...@remote5bge0.ripco.com...

> One thing to point out, you are talking about two people sharing one
> account, which in my opinion is never a good idea. On our system some of
> the
> businesses that need multiple people sharing one account (like info@),
> each
> person has their own account and an alias is configured to drop the mail
> into each of their accounts.
>
> That way each person can do whatever they want with any particular
> message
> without stepping on someone else toes.

How do those businesses ensure that each request is handled by exactly one
person? A shared role account can be used as a poor man's ticketing
system.

--
Thor Kottelin
http://www.anta.net/

Sam

unread,
May 27, 2013, 9:56:39 AM5/27/13
to
Tristan Miller writes:

> Greetings.
>
> I've always been curious about how IMAP in offline mode handles conflicts
> during synchronization.
>
> For example, say we have an IMAP account with three mail folders: Inbox,
> Foo, and Bar. Fred and Barney both check the account with their respective
> machines, and see that there's a message in the Inbox. While offline, Fred
> moves the message from Inbox to Foo, and Barney moves it from Inbox to Bar.
> Then Fred and Barney both synchronize their clients with the IMAP server.
> What happens to the message?

IMAP specifies a communication protocol between a client and a server. IMAP
does not specify what a client does when it's not connected to a server,
or what a server does when it's not connected to a client.

So, this really falls outside the scope of IMAP. Anything can happen,
between the screen getting filled with garbage error messages, to the sun
exploding in a galaxy-wide fireball.

But the most likely answer is that whichever one ends up reconnecting to the
server first, the client will move the message in question. The second
client will not find it, when it reconnects. There is no means for the
second client to be aware of the first client's action, so an error message,
of some sorts, is the likely result.

But I don't even know of any IMAP client that has any kind of "offline" mode
that works this way. If an IMAP client is not connected to the server, the
most it will let you do is, perhaps, write a new message, and save a draft
of it, locally. It won't let you do anything with any existing message in
the mailbox, until it reconnects to the server.

Tristan Miller

unread,
May 27, 2013, 3:49:56 PM5/27/13
to
Greetings.

In article <news:knvmtc$n1r$1...@remote5bge0.ripco.com>, Bruce Esquibel wrote:
> I don't know the exact answer but likely whoever went online first after
> working offline gets the message moved to where they wanted it.
>
> The johnny-come-lately who connects next just gets a copy in the mailbox
> the other person moved it to, in which they can move it again if need be.

That's what I figured. But I was wondering if the protocol specified that
(in my example) Barney's client must produce an error message indicating
that the action requested cannot be carried out.

> One thing to point out, you are talking about two people sharing one
> account, which in my opinion is never a good idea.

This was just for the sake of an example. It could just as easily have
been a single person accessing the same IMAP account from, say, home and
work computers.

> On our system some of
> the businesses that need multiple people sharing one account (like
> info@), each person has their own account and an alias is configured to
> drop the mail into each of their accounts.
>
> That way each person can do whatever they want with any particular
> message without stepping on someone else toes.

But this way is also fraught with problems: if two people get separate
copies of the messages, how are they going to know which ones have been
replied to already or not? If you share a single IMAP account the e-mail
client will mark messages as replied, and the reply will be put in a single
sent-mail folder, so the chances of two or more people sending duplicate
replies will be reduced.

Tristan Miller

unread,
May 27, 2013, 4:15:35 PM5/27/13
to
Greetings.

In article <news:cone.1369662691....@monster.email-scan.com>,
Sam wrote:
> IMAP specifies a communication protocol between a client and a server.
> IMAP does not specify what a client does when it's not connected to a
> server, or what a server does when it's not connected to a client.
>
> So, this really falls outside the scope of IMAP.

But surely the protocol specifies what happens if a client tells the server
to do some operation on a message which doesn't exist (or at least doesn't
exist where the client thinks it exists).

> But I don't even know of any IMAP client that has any kind of "offline"
> mode that works this way. If an IMAP client is not connected to the
> server, the most it will let you do is, perhaps, write a new message, and
> save a draft of it, locally. It won't let you do anything with any
> existing message in the mailbox, until it reconnects to the server.

Really? Both the IMAP clients I use regularly (KMail and Thunderbird)
allow messages to be moved between folders when the client is offline. The
changes are then synchronized the next time the client connects to the
server. I had simply assumed that most other IMAP clients would behave
similarly.

Sam

unread,
May 27, 2013, 5:31:00 PM5/27/13
to
Tristan Miller writes:

> Greetings.
>
> In article <news:cone.1369662691....@monster.email-scan.com>,
> Sam wrote:
> > IMAP specifies a communication protocol between a client and a server.
> > IMAP does not specify what a client does when it's not connected to a
> > server, or what a server does when it's not connected to a client.
> >
> > So, this really falls outside the scope of IMAP.
>
> But surely the protocol specifies what happens if a client tells the server
> to do some operation on a message which doesn't exist (or at least doesn't
> exist where the client thinks it exists).

Yes, the client gets an error message.

> > But I don't even know of any IMAP client that has any kind of "offline"
> > mode that works this way. If an IMAP client is not connected to the
> > server, the most it will let you do is, perhaps, write a new message, and
> > save a draft of it, locally. It won't let you do anything with any
> > existing message in the mailbox, until it reconnects to the server.
>
> Really? Both the IMAP clients I use regularly (KMail and Thunderbird)
> allow messages to be moved between folders when the client is offline. The
> changes are then synchronized the next time the client connects to the
> server. I had simply assumed that most other IMAP clients would behave
> similarly.

Might very well be; however IMAP does not specify what client must or must
not do when it's not connected to the server. However, if you accept this
situation as your premise, then what happens when a server gets a request to
do "some operation on a message which doesn't exist" does not apply, for the
following reasons.

It's reasonable to conclude that when a client purports to implement some
kind of an offline funcitonality, the client will certainly be aware that
things might have changed, since the last time it was connected to the
server. So, for that reason, the client is not going to just blindly send
commands to the server, referencing messages that may not exist anymore,
when it reconnects. It's reasonable to conclude that the IMAP client, after
returning online, will make an effort to see what's going on in the mailbox
now, before doing anything. And, all I'm saying, what happens when things
don't look the same falls outside the scope of IMAP. It's up to the client
to figure out what to do, if someone else moved the same message, or even
removed it altogether. Or if another IMAP client removed or renamed the
folder the message was in. If an IMAP client renamed the folder, there's no
way another IMAP client can tell what happened to it, besides the fact that
it's gone. There may be a new folder somewhere else within the mailbox. The
other IMAP client may or may not see it, right away. And there is no
clear indication that the new folder is the same folder.

There are some things in IMAP that a client can use in this situation, but
the scope of those particular things is still limited to the "are things the
same, or are they different, and are not where they were before" scope.

Bruce Esquibel

unread,
May 28, 2013, 8:14:15 AM5/28/13
to
Thor Kottelin <th...@anta.net> wrote:

> How do those businesses ensure that each request is handled by exactly one
> person? A shared role account can be used as a poor man's ticketing
> system.

I can see your point but it's more for a hierarchy style.

There is only supposed to be one person to handle the email, even with 2 or
3 others getting a copy. Generally you have the "low man on the totem pole"
with his/her boss or supervisor and then their department head or
supervisor above them.

That way if there is a failure to respond or follow up from the low man on
the totem pole (i didn't get it, didn't see it), the others can forward it
back to them, probably with some strong warning to quit screwing up.

It's probably some kind of micromanagement with everyone trying to protect
their own asses, but seems pretty common around here for the typical
business setups.

-bruce
b...@ripco.com

arnod...@gmail.com

unread,
Mar 9, 2017, 1:38:20 PM3/9/17
to
I have done some testing using my Gmail account on Mail OSX (offline) moving a message to one of my Gmail folders, and then using my phone to move the same message to the trash.

Upon connecting my Mac to the internet, the deleted message disappeared from the folder I had move it to. So the online version took precedence. Makes sense. There was no warning message though.

- Arno
0 new messages