Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress read receipt via IMAP?

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?

like image 866
Sebastian Zartner Avatar asked Oct 01 '22 18:10

Sebastian Zartner


1 Answers

The only way to resolve this issue is to change the settings on the Exchange server itself. From the Exchange Management Shell, enter the following command:

set-ImapSettings -SuppressReadReceipt $true

You will then get no read receipts at all from Exchange for messages that are read via IMAP. It is then up to your application to generate the read receipts itself.

Technet also has more detailed info about set-ImapSettings.

like image 183
Jamie Cockburn Avatar answered Oct 04 '22 19:10

Jamie Cockburn