Re: [VM] VM-Pcrisis and smtp servers

2019-04-06 Thread Ulrich Mueller
> On Sat, 06 Apr 2019, Uday Reddy wrote:

> I am wondering if anybody has figured out how to program VM-Pcrisis
> (VMPC) to set smtp servers based on the message being composed?

> I know that Rob F used to recommend using esmtpmail.el for this
> purpose. But it seems that VMPC ought to be able to do it.

One possible solution is to customise send-mail-function to point to
message-multi-smtp-send-mail.

Then add a line like following line to each entry in vmpc-actions:

(vmpc-substitute-header "X-Message-SMTP-Method"
"smtp mail.example.com 587 mylogin")

message-multi-smtp-send-mail will evaluate that header line and
redirect the message to the appropriate SMTP server.

Of course, this isn't a standalone solution either, but relies on
message.el from Gnus.

Ulrich



[VM] VM-pcrisis and the From header

2013-08-13 Thread Matthew Vernon
Hi,

I have set up vm-pcrisis to set my From: line based on which account I'm
replying to emails from (IYSWIM). This seems to mostly work, but there's
one slight annoyance - setting the from line results in it being the
last header, whereas I'd rather it was at the top of my mail buffer.

I appreciate this is hardly the most critical thing ever, but I'm used
to eyeballing the top line of my Mail buffers for From. Can I arrange
for vmpc to put it there?

Thanks,

Matthew

-- 
 `O'-0 `O'---.   `O'---.   `O'---.
   \___| |   \___|0-/  \___|/\___|
|  | /\   |  |  \   |  |\ |  |
The Dangers of modern veterinary life




Re: [VM] VM-pcrisis and the From header

2013-08-13 Thread Uday Reddy
Matthew Vernon writes:

 Hi,
 
 I have set up vm-pcrisis to set my From: line based on which account I'm
 replying to emails from (IYSWIM). This seems to mostly work, but there's
 one slight annoyance - setting the from line results in it being the
 last header, whereas I'd rather it was at the top of my mail buffer.

I have always found it to put the From header at the top of the mail buffer.

The preset value of `vm-mail-header-order' has From at the top.  So,
unless you changed the variable, that is where it should be.

Cheers,
Uday



Re: [VM] VM-pcrisis and the From header

2013-08-13 Thread Uday Reddy
Matthew Vernon writes:

 Ah. If I set vm-mail-header-from and let vm-pcrisis change it, then it
 appears at the top. If I leave vm-mail-header-from as nil, and let
 vm-pcrisis create the header, it ends up at the bottom.

It probably means that VM's header-ordering works before VMPC does its
hacking.  So, if you set the variable to nil, there would have been no
From header when the header-ordering happens.

So, don't set the variable to nil.

VMPC is an add-on.  You can't expect it to be perfect.

Cheers,
Uday



Re: [VM] vm-pcrisis

2012-12-06 Thread Uday Reddy
Jay Borkenhagen writes:

 One thing that isn't quite working as I used to have or as is
 documented in the texinfo is the prompting.  Per the texinfo:
 
   One thing to bear in mind is that when you are prompted, there will
   be auto-completion available -- you'll only need to type enough to
   uniquely identify a profile (you won't even need to hit TAB).
 
 I find that I do need to hit tab now to get the auto-completion.  

I have now investigated what has happened to VMPC.  VMPC was written by Rob
Hodges, and probably posted on the VM newsgroup.  Rob Fenk picked it up and
included it in his unofficial distribution, which eventually became the
current VM distribution (VM 8.0.x, 8.1.x,...).

In July 2006, Rob Fenk writes in the development log

  Added vm-pcrisis.texi and set versions of VMPC to 1.0
  The maintainer will not come back so I will take over!

which suggests that Rob Hodges had discontinued contact and the control
passed to Rob Fenk.  I see that Rob F made significant changes to VMPC, some
that are not consistent with the manual.  He did not always update the
manual to reflect the changes.

The inconsistency you found here is an instance of that situation.  In the
original VMPC, a profile was a single VMPC action, which was
auto-completed.  Rob F changed profile to mean a list of actions, and the
list elements had to be entered by typing RET.  So, I presume
auto-completion via RET was discarded.  The doc string for
`vmpc-prompt-for-profile' describes what is going on.  The manual continues
to say what it used to say, but the code has diverged.

I would agree that this is an unsatisfactory situation.  But there have been
regular users of VMPC on this list, and they don't seem to have complained
about these issues.  And, users like you that continued to use old
versions didn't complain either.  Now Rob F has also discontinued contact.
So, until and unless we get a new maintainer for VMPC, we have to make do
with what we have.

I might at some point decide to write my own version of VMPC.  But it will
be a new package which will strive to avoid all the mess with the current
package.  I won't bother to maintain consistency with any of the existing
versions.

Cheers,
Uday




Re: [VM] vm-pcrisis

2012-12-05 Thread Uday Reddy
Hi Jay, when I corrected the two typos in your customization (changing
`vmpc-action-alist' to `vmpc-actions-alist', and `vmpc-replies-alist' to
`vmpc-reply-alist'), it ran perfectly fine as you were wanting.

By the way, I recommend using standard symbols, e.g., always-true, instead
of elaborate strings like condition that's always true.  The more fancy
you make these names, the more chance of typos there will be.  And, they
don't have to be strings either.  I don't know why Rob Hodges was so fond of
strings.  Symbols work perfectly fine.

Cheers,
Uday



 (require 'vm-pcrisis)
 
 (setq vmpc-conditions 
   '(
 (condition that's always true
't
)))
 
 (setq vmpc-actions
   '(
   (work
(vmpc-substitute-header From Jay Borkenhagen j...@work.com)
(vmpc-substitute-header Reply-To Jay Borkenhagen j...@work.com)
)
 
   (braeburn
(vmpc-substitute-header From Jay Borkenhagen j...@braeburn.org)
(vmpc-substitute-header Reply-To Jay Borkenhagen 
 j...@braeburn.org)
)
 
   (prompt for a profile
(vmpc-prompt-for-profile)
)
   )
   )
 
 
 (setq vmpc-action-alist 
   '(
   (condition that's always true prompt for a profile)
   )
   )
 
 (setq vmpc-newmail-alist 
   '(
   (condition that's always true prompt for a profile)
   )
   )
 
 (setq vmpc-replies-alist 
   '(
   (condition that's always true prompt for a profile)
   )
   )
 
 ;;; END pcrisis stuff
 ;
 
 
 



Re: [VM] vm-pcrisis

2012-12-05 Thread Jay Borkenhagen
Thanks, Uday!  I guess I did not suspect that I had some typos of that
kind because I did not receive any error messages.

As for the overly-elaborate strings: I agree with you wholeheartedly.
I was using them only to help me stick closer to the texinfo manual.
If you would like me to take a shot at simplifying/correcting the
texinfo, I would gladly do so as my contribution to the cause.

One thing that isn't quite working as I used to have or as is
documented in the texinfo is the prompting.  Per the texinfo:

  One thing to bear in mind is that when you are prompted, there will
  be auto-completion available -- you'll only need to type enough to
  uniquely identify a profile (you won't even need to hit TAB).

I find that I do need to hit tab now to get the auto-completion.  If
my two profiles are work and braeburn, I would like to be able to
type w RET and have vm-pcrisis behave as if I had entered the entire
work RET.  But now w RET leaves 'Action w does not exist!' in
the minibuffer.


Jay B.


Uday Reddy writes:
  Hi Jay, when I corrected the two typos in your customization (changing
  `vmpc-action-alist' to `vmpc-actions-alist', and `vmpc-replies-alist' to
  `vmpc-reply-alist'), it ran perfectly fine as you were wanting.
  
  By the way, I recommend using standard symbols, e.g., always-true, instead
  of elaborate strings like condition that's always true.  The more fancy
  you make these names, the more chance of typos there will be.  And, they
  don't have to be strings either.  I don't know why Rob Hodges was so fond of
  strings.  Symbols work perfectly fine.
  
  Cheers,
  Uday
  
  
  
   (require 'vm-pcrisis)
   
   (setq vmpc-conditions 
 '(
   (condition that's always true
   't
   )))
   
   (setq vmpc-actions
 '(
  (work
   (vmpc-substitute-header From Jay Borkenhagen j...@work.com)
   (vmpc-substitute-header Reply-To Jay Borkenhagen j...@work.com)
   )
   
  (braeburn
   (vmpc-substitute-header From Jay Borkenhagen j...@braeburn.org)
   (vmpc-substitute-header Reply-To Jay Borkenhagen 
   j...@braeburn.org)
   )
   
  (prompt for a profile
   (vmpc-prompt-for-profile)
   )
  )
 )
   
   
   (setq vmpc-action-alist 
 '(
  (condition that's always true prompt for a profile)
  )
 )
   
   (setq vmpc-newmail-alist 
 '(
  (condition that's always true prompt for a profile)
  )
 )
   
   (setq vmpc-replies-alist 
 '(
  (condition that's always true prompt for a profile)
  )
 )
   
   ;;; END pcrisis stuff
   ;
   
   
   



[VM] vm-pcrisis

2012-12-04 Thread Jay Borkenhagen
Hi,

I only recently subscribed viewmail-info, but I've been using VM since
the Kyle Jones days.  Most recently I had been using vm-7.18 with
vm-pcrisis 0.85 beta -- still with only Rob Hodges's name on it. :-)

I'm now trying to bring my VM environment more up-to-date with
vm-8.2.0b and its vm-pcrisis, but I'm having difficulty with the
vm-pcrisis set-up.

I think what I'm looking to do should be pretty straightforward.  I
want to be prompted for one of my two profiles every time I begin to
compose a mail message regardless of whether it's a new message, a
reply, anything.  I would also like my profiles name to auto-complete,
so I can select work with just w RET and braeburn with just b
RET.

With the config below in my .vm file I am getting prompted but
only for newmail, and the auto-complete requires TAB.

Sorry for the cry for help, but I've been messing with the set-up and
reading 'info vm-pcrisis' for quite a while now, and I don't feel like
I'm getting closer.  Thanks in advance for your help!

   Jay B.


(require 'vm-pcrisis)

(setq vmpc-conditions 
  '(
(condition that's always true
 't
 )))

(setq vmpc-actions
  '(
(work
 (vmpc-substitute-header From Jay Borkenhagen j...@work.com)
 (vmpc-substitute-header Reply-To Jay Borkenhagen j...@work.com)
 )

(braeburn
 (vmpc-substitute-header From Jay Borkenhagen j...@braeburn.org)
 (vmpc-substitute-header Reply-To Jay Borkenhagen 
j...@braeburn.org)
 )

(prompt for a profile
 (vmpc-prompt-for-profile)
 )
)
  )


(setq vmpc-action-alist 
  '(
(condition that's always true prompt for a profile)
)
  )

(setq vmpc-newmail-alist 
  '(
(condition that's always true prompt for a profile)
)
  )

(setq vmpc-replies-alist 
  '(
(condition that's always true prompt for a profile)
)
  )

;;; END pcrisis stuff
;




Re: [VM] vm-pcrisis

2012-12-04 Thread Terry Jones
Hi Jay

 I think what I'm looking to do should be pretty straightforward.  I want to
 be prompted for one of my two profiles every time I begin to compose a mail
 message regardless of whether it's a new message, a reply, anything.

This is not a vm-pcrisis approach (whatever that is), but I have a setup
that might work for you and which sounds like it needs less effort to use.

I have several email addresses that I use regularly. Part of my setup is a
function called my-set-reply-to that I call via vm-select-message-hook The
function is pretty dumb, it's just a big cond that looks at the message
being replied to to find one of my email addresses (or domains) in a
header, and calls a function to set variables like vm-mail-header-from and
mail-default-reply-to etc.  With that in hand, pretty much 100% of my reply
buffers are automatically populated with the right values.

When it comes to composing new mails, I'll be in the profile of whatever
mail I read last, which is very often what I want (even though I'm not
writing a reply, I'm most likely to be in that work/home/play etc context).
If that's not right, I manually invoke one of the functions I mentioned in
the paragraph above. E.g., M-x mail-from-jon.es I have to do that maybe
once a week (and I usually avoid it by just moving to a message sent to the
address I'd like to write the new mail from).

I hope that makes sense.

My elisp skills are pathetic, I'm afraid, but you can see the code (and
lots of personal details) at:
https://github.com/terrycojones/emacs-setup/blob/master/elisp/my-vm.el#L134
https://github.com/terrycojones/emacs-setup/blob/master/elisp/my-misc.el#L670

Terry



Re: [VM] vm-pcrisis configuration using vmpc-substitute-replied-header

2011-12-28 Thread Konrad Hinsen
Uday Reddy writes:

  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.