You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Tilman Ginzel <ti...@gmail.com> on 2015/03/26 13:30:33 UTC

How to delete mails via code

Hi,

I have a rather unusual requirement where an unread email needs to be
deleted as soon as the user clicks on it. We were able to manage the
following so far:
- a user clicks (e.g. in Thunderbird) on an unread mail
- we recognize the click on the mail in the imap.processor.StoreProcessor

The next step would be to delete this mail from the server and notify
the client about the deletion. If deletion won't work, it would be ok
to move them to a trash folder. Unfortunately the move operation in
the MailboxManager throws a NotImplementedException.

Could you give me some hints on how to accomplish this? I've already
tried to use the expunge operation from the MessageManager, but it
seems like nothing happens. My guess is that we have to alter the
respond sent to the client.

Thanks in advance!

Kind regards
Tilman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: How to delete mails via code

Posted by Benoit Tellier <bt...@linagora.com>.
Hi,

The move capability is, as you spotted, not implemented by the Mailbox
Store. See RFC 3501 and you will see that the behaviour for this IMAP
command is not well defined.

Current clients ( eg : thunderbird ) perform first a copy of the
message. Then delete the old one. You should follow these steps to
"move" messages.

The expunge command only deletes mail marked  as DELETED. If you have no
message with the DELETED flag in your mailbox, nothing appens.

Hope it helps.

( Sorry for the noise, it seems I had a configuration problem with my GPG tools... )



Le 26/03/2015 13:30, Tilman Ginzel a écrit :
> Hi,
>
> I have a rather unusual requirement where an unread email needs to be
> deleted as soon as the user clicks on it. We were able to manage the
> following so far:
> - a user clicks (e.g. in Thunderbird) on an unread mail
> - we recognize the click on the mail in the imap.processor.StoreProcessor
>
> The next step would be to delete this mail from the server and notify
> the client about the deletion. If deletion won't work, it would be ok
> to move them to a trash folder. Unfortunately the move operation in
> the MailboxManager throws a NotImplementedException.
>
> Could you give me some hints on how to accomplish this? I've already
> tried to use the expunge operation from the MessageManager, but it
> seems like nothing happens. My guess is that we have to alter the
> respond sent to the client.
>
> Thanks in advance!
>
> Kind regards
> Tilman
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: ***UNCHECKED*** Re: How to delete mails via code

Posted by Michael Bailly <mb...@linagora.com>.
Le 26/03/2015 13:59, Benoit Tellier a écrit :
>
> Ceci est un message OpenPGP chiffré.
> Afin de pouvoir déchiffrer ce courrier, vous devez installer un 
> module complémentaire OpenPGP 
> <https://addons.mozilla.org/thunderbird/addon/enigmail/>.
>
>
tu as chiffré ton message envoyé dans une mailing liste publique 
apache... bif.

-- 
Michael BAILLY
Manager Equipe OpenPaaS

Tel: 06 60 30 21 16
LINAGORA, 80 rue Roque de Fillol - 92800 PUTEAUX

#########################

Open PaaS: XXI century collaboration
https://www.youtube.com/channel/UCgCZPNq1-g49VfOaxjbExlg
@AwesomePaaS