leahneukirchen / mblaze

Unix utilities to deal with Maildir
Other
419 stars 48 forks source link

Add Drafts profile key #241

Closed thyssentishman closed 1 year ago

thyssentishman commented 1 year ago

Allow the user to set a Drafts key in profile to store draft messages and sent messages separately if Outbox is set.

This commit closes #240

leahneukirchen commented 1 year ago

The code should fallback to Outbox if Drafts isn't set.

I'd use mflag + mrefile to mark as sent and move it.

thyssentishman commented 1 year ago

The code should fallback to Outbox if Drafts isn't set.

Done :)

I'd use mflag + mrefile to mark as sent and move it.

For some reason neither

mflag -d -S "$draft" | mrefile - "$outbox"

nor

mrefile -v "$draft" "$outbox" | mflag -d -S -

worked for me. Both of these made a copy of the draft file in the destination directory without flags and changed the flag from 'D' to 'S' of the original file.

leahneukirchen commented 1 year ago

Oh, you need to do it in two steps, without pipe.

I guess with $() it works too.

thyssentishman commented 1 year ago

Should we perhaps quote the subshell "$()" to deal with maildir paths with spaces?

A little late sorry, but just noticed it now.

EDIT: just tested it with maildir paths with spaces and it does indeed need the quoting, sorry. PR Sent.