Discussion:
[VM] vm-pcrisis configuration using vmpc-substitute-replied-header
Konrad Hinsen
2011-12-23 12:59:34 UTC
Permalink
Does anyone have a working configuration for vm-pcrisis that uses
vmpc-substitute-replied-header? I tried the example action from the
manual:

(vmpc-substitute-replied-header "To" "From")

but it doesnt do anything. Looking at the source code, and running it
through the debugger, I understand why it doesn't work: it needs to be
called twice, once with the current buffer being the original message,
and then with the current buffer being the composition buffer. Setting
it up as described in the manual takes care of the first call, but not
of the second. So I suspect I need a more elaborate configuration -
but how?

Konrad.
Uday Reddy
2011-12-23 15:25:24 UTC
Permalink
Post by Konrad Hinsen
So I suspect I need a more elaborate configuration -
but how?
I found vmpc-substitute-replied-header to be quite useless.

I use something like this

(setq vmpc-conditions
'((to-work (vmpc-header-match "To\\|Cc" (regexp-quote "...")))
(to-home (vmpc-header-match "To\\|Cc" (regexp-quote "...")))))
(setq vmpc-actions
'((work (vmpc-substitute-header "From" "..."))
(home (vmpc-substitute-header "From" "..."))))
(setq vmpc-reply-alist
'((to-work work)
(to-home home)))
(setq vmpc-forward-alist
vmpc-reply-alist)

Cheers,
Uday
Konrad Hinsen
2011-12-28 15:25:57 UTC
Permalink
Post by Uday Reddy
I found vmpc-substitute-replied-header to be quite useless.
I use something like this
(setq vmpc-conditions
'((to-work (vmpc-header-match "To\\|Cc" (regexp-quote "...")))
(to-home (vmpc-header-match "To\\|Cc" (regexp-quote "...")))))
That's fine for "home" and "work", but I have about a dozen e-mail
address I use regularly and I also often create ad-hoc addresses for
one-time use. I have a whole domain at my disposal, which allows me to
generate throw-away addresses to reduce spam.

Konrad.
Uday Reddy
2011-12-28 18:29:29 UTC
Permalink
Post by Konrad Hinsen
Post by Uday Reddy
(setq vmpc-conditions
'((to-work (vmpc-header-match "To\\|Cc" (regexp-quote "...")))
(to-home (vmpc-header-match "To\\|Cc" (regexp-quote "...")))))
That's fine for "home" and "work", but I have about a dozen e-mail
address I use regularly and I also often create ad-hoc addresses for
one-time use. I have a whole domain at my disposal, which allows me to
generate throw-away addresses to reduce spam.
Then you can write functions that can automate the generation of
vmpc-conditions and correspondingly vmpc-actions.
Post by Konrad Hinsen
Does anyone have a working configuration for vm-pcrisis that uses
vmpc-substitute-replied-header? I tried the example action from the
(vmpc-substitute-replied-header "To" "From")
this code is backwards. You want

(vmpc-substitute-replied-header "From" "To")

to copy the "To" header of the original message into the "From" header of
your response. I believe it does work. But the reason it is useless is
that if a message was sent from Mike to John and copied to you, and you
respond to it using this action, VMPC will use John as the "From" address in
your reponse. That would be a fine way to irritate John!

Cheers,
Uday
Konrad Hinsen
2011-12-29 20:56:14 UTC
Permalink
Post by Uday Reddy
Post by Konrad Hinsen
Does anyone have a working configuration for vm-pcrisis that uses
vmpc-substitute-replied-header? I tried the example action from the
(vmpc-substitute-replied-header "To" "From")
this code is backwards. You want
(vmpc-substitute-replied-header "From" "To")
Oops, right, that way it works. I was being lazy and blindly copied an
example from the manual, instead of reading the documentation. It's probably a good idea to fix that example under "2.3 vmpc-actions":

Only under certain conditions do we want to set our To: field to the
contents of the From: field in the replied message. The action to do
this would look like this:

("set To to From"
(vmpc-substitute-replied-header "To" "From"))
Post by Uday Reddy
your response. I believe it does work. But the reason it is useless is
that if a message was sent from Mike to John and copied to you, and you
respond to it using this action, VMPC will use John as the "From" address in
your reponse. That would be a fine way to irritate John!
Indeed. As I just found out, another weakness of
vmpc-substitute-replied-header is that it happily transforms a To line
with multiple addresses into a

Loading...