Re: Move to Gmail-trash instead of deleting

Kia Niskavaara <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <CALed1ewymO=-tKANUT2DJQtu7R5Fz8GJUhstAg3dXuVmmTpm1A@mail.gmail.com>
Can getmail watch the Trash-folder instead of Inbox? If yes, then I can
create a filter that will move the relevant emails directly to trash.
However:

I've tried changing mailboxes = ("INBOX",) to mailboxes = ("TRASH",) in
getmailrc.

And at the same time changing
ExecStart=/usr/bin/getmail --rcfile=/home/daniel/.getmail/getmailrc --idle
INBOX
to
ExecStart=/usr/bin/getmail --rcfile=/home/daniel/.getmail/getmailrc --idle
TRASH
in my .service file

I get the following info from getmail:
mailbox TRASH not selectable (TRASH) - verify the mailbox exists and you
have sufficient permissions

Does Gmail have a different name for the Trash-folder?





On Tue, Jun 16, 2020 at 7:50 AM Kia Niskavaara <[email protected]>
wrote:

>
> On Mon, Jun 15, 2020 at 4:09 PM Kia Niskavaara <[email protected]>
> wrote:
>
>> On Mon, Jun 15, 2020 at 3:22 PM Charles Cazabon <
>> [email protected]> wrote:
>>
>>> Kia Niskavaara <[email protected]> wrote:
>>> >
>>> > I'm using getmail with Gmail IMAP and SimpleIMAPSSLRetriever.
>>> >
>>> > I've tried using 'delete = True' in config, and as suspected this
>>> deletes
>>> > the mail in Gmail.
>>> >
>>> > However, I would like to move it from Gmail-Inbox to Gmail-Trash
>>> instead of
>>> > deleting. This is normal Gmail behaviour when clicking the
>>> Trash-symbol in
>>> > the web interface. Is this possible with getmail also?
>>>
>>> Yes.  getmail's built-in support is the move_on_delete option - it's
>>> documented under common retriever parameters.  Set delete and
>>> move_on_delete
>>> and you will get what you want.
>>>
>>> I also think (not sure) that this can be controlled with a Gmail
>>> preference.
>>> I thought by default, IMAP client deletes were moved to Trash instead of
>>> being
>>> deleted - perhaps you changed that setting?  Or Gmail have changed the
>>> default.
>>>
>>> Charles
>>>
>>
>> Thanks! I found the setting in Gmail now. By default deleted mail gets
>> moved to archive. So I changed it to "send to trash" and now it seems to be
>> working as needed.
>>
>> Thanks again
>>
>
> Even though I changed the setting in gmail, they are still in the All mail
> folder and not in Trash.
>
> The setting in Gmail say it will be moved to trash: "when a message is
> marked as deleted and expunged from the last visible imap folder".
>
> Not sure how to "expunge from the last visible imap folder". What does
> that mean? And is it possible to achieve this with getmail?
>
> So far I have only used delete = True in getmailrc. Can move_on_delete
> move the mail to the gmail trash folder?
>
> Thanks
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.