<<< Date Index >>>     <<< Thread Index >>>

Saving to maildir with date without sending



Hi, 

In addition to my regular emails activities, I use mutt to take notes.
Each note is an email I send to myself and then save to a "notes"
folder. I use many "notes" folders associated to various projects.

I'm trying to configure mutt to skip the "sending" part of the process:
I want it to save the note directly to the current folder when it is a
".*notes" folder instead of sending the mail. To this end, I use the
following folder-hook:

        folder-hook .*notes macro compose y "<write-fcc>^\r<exit>n"

It does exactly what I want, except that it does not set the date. As
far as I understand, this is because the mail is never actually send and
processed.

I tried to set the date with my_hdr using

        folder-hook .*notes my_hdr Date: `date +"%a, %e %b %Y %H:%M:%S %z"`

When I edit a new message, the date header shown in the editor (with
edit_headers set) has the correct field value, but when I "send" it with
the above macro in place, the saved message does not have the correct
date header -- it is set to the unix epoch.

I know that I could set up for filter or pipe to send the mail then save
it in the proper folder with the right date; I want to know if what I
want to do is possible with mutt. 

To do my homework, I read what RFC2822 has to say about the meaning of
the date header to see if my usage is compatible with the standard:

   The origination date specifies the date and time at which the creator
   of the message indicated that the message was complete and ready to
   enter the mail delivery system.  For instance, this might be the time
   that a user pushes the "send" or "submit" button in an application
   program.  In any case, it is specifically not intended to convey the
   time that the message is actually transported, but rather the time at
   which the human or other creator of the message has put the message
   into its final form, ready for transport.

In a sense, my "notes" are "ready to enter the mail delivery system"
when I save them, so they should get the current date set when
<write-fcc> saves them, even if they do not want them to actually enter
the mail delivery system! It is even possible that I decide to mail the
note to someone later one, but would like to keep the date as it is.

Thanks for any help or clarification!

--
Yannick Delbecque
http://yannick.delbecque.org