s-nail copying deleted imap messages to trash

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

s-nail copying deleted imap messages to trash

Jon Fineman
For current s-nail is there a way with an imap account to copy messages that I
delete to my ISPs trash folder like the set record=+Sent command copies sent
message to my sent folder?

Currently they are being permanently deleted.

Thanks.

Jon

Reply | Threaded
Open this post in threaded view
|

Re: s-nail copying deleted imap messages to trash

Steffen Nurpmeso-2
Hello.

Jon Fineman wrote in <20191223153845.KCdII%[hidden email]>:
 |For current s-nail is there a way with an imap account to copy messages \
 |that I
 |delete to my ISPs trash folder like the set record=+Sent command copies \
 |sent
 |message to my sent folder?
 |
 |Currently they are being permanently deleted.

I would say there are multiple possibilities, if i understand your
desire correctly.  The easiest would likely be a function plus
a commandalias (or even a key binding).

  define my_delete {
    \copy "$@" /tmp/undelete.mbox
    \delete "$@"
  }
  commandalias d '\call my_delete'

And then you say "d *" as before.  Just replace my_delete with
whatever is your desire, but note that this is inefficient unless
you stay under the same IMAP account (for a while).  You could
also just use \move instead of \copy, which is likely very much
more efficient than the above.  But there is no automatic and
builtin way to say, for example, "just let delete do x and y", no.

 |Thanks.

Hope this help.
Merry Christmas ;) i wish from Germany,
Ciao,

 |Jon
 |
 |
 --End of <20191223153845.KCdII%[hidden email]>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply | Threaded
Open this post in threaded view
|

Re: s-nail copying deleted imap messages to trash

Steffen Nurpmeso-2
Steffen Nurpmeso wrote in <20191223200257.kP4KP%[hidden email]>:
 |Jon Fineman wrote in <20191223153845.KCdII%[hidden email]>:
 ||For current s-nail is there a way with an imap account to copy messages \
 ||that I
 ||delete to my ISPs trash folder like the set record=+Sent command copies \
 ||sent
 ||message to my sent folder?
 ||
 ||Currently they are being permanently deleted.
 |
 |I would say there are multiple possibilities, if i understand your
 |desire correctly.  The easiest would likely be a function plus
 |a commandalias (or even a key binding).
 |
 |  define my_delete {
 |    \copy "$@" /tmp/undelete.mbox
 |    \delete "$@"

Even better would be

      \copy "$@" /tmp/undelete.mbox
      \delete `

since the messages are collected only once.

 |}
 |  commandalias d '\call my_delete'
 |
 |And then you say "d *" as before.  Just replace my_delete with
 |whatever is your desire, but note that this is inefficient unless
 |you stay under the same IMAP account (for a while).  You could
 |also just use \move instead of \copy, which is likely very much

And "move" is likely what you really want.

 |more efficient than the above.  But there is no automatic and
 |builtin way to say, for example, "just let delete do x and y", no.
 |
 ||Thanks.
 |
 |Hope this help.
 |Merry Christmas ;) i wish from Germany,

Ciao.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply | Threaded
Open this post in threaded view
|

Re: s-nail copying deleted imap messages to trash

Jon Fineman
Steffen Nurpmeso <[hidden email]> wrote:

> Even better would be
>
>       \copy "$@" /tmp/undelete.mbox
>       \delete `
>
> since the messages are collected only once.
>

Thanks.

I was focused on searching for a built in similiar to the way sent uses
"record", that I didn't consider creating a function.

Jon

Reply | Threaded
Open this post in threaded view
|

Re: s-nail copying deleted imap messages to trash

Steffen Nurpmeso-2
Jon Fineman wrote in <20191224012038.4aZmY%[hidden email]>:
 |Steffen Nurpmeso <[hidden email]> wrote:
 |
 |> Even better would be
 |>
 |>       \copy "$@" /tmp/undelete.mbox
 |>       \delete `
 |>
 |> since the messages are collected only once.
 |
 |Thanks.
 |
 |I was focused on searching for a built in similiar to the way sent uses
 |"record", that I didn't consider creating a function.

Or really just "commandalias delete move" or so?  You can prefix \
if you want the real "delete", without commandalias expansion.

S-nail v14.9.10, hopefully before next summer, will bring some
updates also to the IMAP code.  For v15 IMAP however has to go, at
least temporary, until our network code no longer uses blocking
I/O and signal(3) caused siglongjmp(3), really.  But during that
the v14.10.* series will be maintained, at least a little.

Ciao!

 |Jon
 --End of <20191224012038.4aZmY%[hidden email]>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)