In wanderlust, I have several folders with which I use wl-template-alist to set up default values for some of the headers when I am writing messages. In one of these folders (not all of them), I want to use the "To" value from wl-template-alist only for new messages. If I am replying, I want To to be automatically set to the sender's address.

For example ...

(setq wl-template-alist
    ("To" . "default-recipient-address@domain.com")
    ;;; other stuff

In this case, I want To to be set to default-recipient-address@domain.com when I'm in "certainfolder" and writing a new message, but I want this to be ignored and the sender's address (or their Reply-To) to be used in To when I'm generating a reply to any messages in that folder.

How can I do this via wl-template-alist for this one, single folder?

Thank you very much.

  • I believe you could accomplish what you want (more or less) via a combination wl-draft-config-alist and wl-template-alist. But in Wanderlust you have two choices: either choose a template for a list, or automatically apply changes to an email, based on matching various. It kind of sounds like you want to do both at once, which isn't possible as far as I know. – Erik Hetzner Aug 6 '18 at 4:27
  • I was afraid of this. Hmm ... but is there a way I can associate a function with "To" in wl-template-alist instead of a hard-coded string? If so, perhaps I could have the function check whether I'm creating a new message or a reply and then generate the "To" string accordingly. Could that be possible? – HippoMan Aug 11 '18 at 15:19
  • It appears that you can use arbitrary code in the cdr, so there might be something you can do: ` (setq wl-template-alist (("my-template" ("To" . (if (and (stringp wl-draft-parent-folder) (string-match ".*gmail.com.*" wl-draft-parent-folder)) "me@gmail.com" "me@other.com")) – Erik Hetzner Aug 12 '18 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.