I want implement a confirmation dialog for sending email read receipts in my application. The application uses IMAP to communicate with the mail server, which is currently restricted to a Microsoft Exchange Server 2010.
The receipt is obviously automatically send by the server when the \Seen
flag is sent. So the IMAP commands would look something like this:
c1 LOGIN username password
c2 SELECT mailbox
c3 UID STORE 123 flags \Seen
(Btw. this stands in contrast to the solution found in another stackoverflow question, which said that setting the \Seen
flag would not cause the Exchange Server to send receipts.)
Though how to handle the case when the user does not want to send a read receipt?
My initial idea was simply not to set the \Seen
flag. Though this causes the server to automatically send a notification to the sender that the email was deleted without being read in case the message is deleted from the server.
Also marking the message with \Deleted
and \Seen
before expunging didn't help:
c1 UID STORE 123 flags (\Deleted \Seen)
c1 UID EXPUNGE 123
So how to explicitly suppress the read receipt message in case the user doesn't want to send one?