POTENTIAL SOLUTION FOR UW-IMAP!!!!
WARNING: THIS IS NOT FOR THE COMMON USER - SYSADMINS ONLY
(if you act on this as a non-sysadmin, you may lose all your emails)
I did some deep work with my crew to try and solve this annoying problem.
What it comes down to is that, while it's affecting IMAP, it's really about your mbox/INBOX spool. That file is out of sync with the iphone, so the two no longer track per-message status the same and you end up with these out of sync deletes being ignored.
What you want to do is force a reset of the status tracking on the server -- the way you do that is by clearing that hidden internal "Dummy Message" in the spool file ... but there are some dangers ... the biggest one being that you have to lock the file while editing it -- otherwise, SMTP may come in with new inbound email while you're editing and bad things could happen.
The spool file I'm discussing is the one USUALLY found in a place like /var/mail/<username>
This dummy message retains "state" for deleted, read, replied, etc.
WARNING: YOU MUST LOCK THE SPOOL BEFORE EDITING!!!! (your server may use .lock or file locking -- if you edit while Sendmail tries to write to the file, bad things will happen)
We deleted my "Dummy Message", which in my case was at the top of the spoolfile. We deleted all lines down to the first "From" of the following message.
Once we deleted the dummy message, I restarted my client and PRESTO - true and righteous deleting. Appropriate status tracking between my iphone and other clients -- the whole fix.
PLEASE READ THIS ENTIRE MESSAGE BEFORE TRYING THIS ON YOUR SERVER - WE COULD BE VERY WRONG - YOU ARE TAKING FULL RESPONSIBILITY FOR DOING THIS (BUT IT WORKED FOR US)
This was completely figured out by my (genius) Sr. Admin, Pat -- he actually KNEW Crispin ... so we're talking about old school genius here (dear Apple -- learn a better word).
So, here are Pat's notes on what to do for locking and what to delete:
Pat says about the dummy message:
Dummy message looks like this.
From MAILER-DAEMON Sat Feb 22 15:00:05 2014
Date: 22 Feb 2014 15:00:05 -0800
From: Mail System Internal Data <MAILER-DAEMON@meadgroup.com>
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
Message-ID: <1393110005@meadgroup.com>
X-IMAP: 1159886868 0000096080
Status: RO
This text is part of the internal format of your mail folder, and is not
a real message. It is created automatically by the mail system software.
If deleted, important folder data will be lost, and it will be re-created
with the data reset to initial values.
Pat says about locking:
If you are gonna edit it, you need to lock it. If dot locking is supported
by your mail delivery agent, create in /var/mail a file named
<user>.lock, after you verify none is already present. Do your edit
and save, then remove the <user>.lock. If procmail is the delivery
agent, you can use lockfile /var/mail/<user>.lock. It won't
set it unless none exists. Otherwise use touch(1) Read manpage
for lockfile(1) before doing anything.
Procmail uses multiple locking schemes, including paying attention
to lockfiles.
If dot locking is not supported by the mail delivery agent, you should
shut down the mail service (sendmail, postfix, or whatever) to stop
mail deliveries, do your edit, then restart the mail service. Also make
sure no clients are active for <user> in question, so you are the only
one/process writing to the file.
This is to avoid possible corruption of inboxes by mail delivery scribbling
on inbox while you are editing.ssh
Not only causing possible loss of 1 or more messages, it is a PITA to
clean up.
I say about the process in general:
- If you can, turn off your SMTP server briefly
- Turn off all clients for the user in question (iphone, laptop, desktop, etc.)
- Lock the spool file with either a file named <user>.lock or following the terms of your operating system's locking format
- Copy your individual mail spool file to a backup (please!)
- Find the Dummy Message in your spool (usually at top, but search for "INTERNAL" if not)
- Delete Dummy Message
- Restart SMTP server
- Test with clients
- Test with iPhone
- If successful - come HERE and confirm method