Re: Using send and reply hooks to set from address and reverse_name

2013-05-10 Thread Suvayu Ali
Hi Patrick,

On Tue, May 07, 2013 at 08:23:41AM -0400, Patrick Shanahan wrote:
> * Suvayu Ali  [05-07-13 08:14]:
> > On Tue, May 07, 2013 at 01:58:57PM +0200, Suvayu Ali wrote:
>  [...]
> > > This is what I did:
> > > 
> > > 1. I removed all reply and send-hooks, `set reverse_name' (not
> > >reverse_name=yes), and then I set an empty default send-hook as you
> > >show above.  I also made sure all my addresses are matched with
> > >alternates.
> > > 
> > >The above allows me to respond to my own responses in a thread
> > >correctly, i.e. my email address from my response is picked as from.
> > > 
> > >However, I cannot respond to mailing list emails delivered to any of
> > >these alternate email addresses with the correct email address (I use
> > > or ).  Responding to messages addressed directly
> > >to any of the alternates work well.
> > > 
> > > 2. To solve this, I added send-hooks for mailing lists delivered to my
> > >alternates.
> > > 
> > >  send-hook "%C work-lists" my_hdr From: wor...@domain.com
> > >  send-hook "%C foss-lists" my_hdr From: l...@gmail.com
> > > 
> > >Note work-lists and foss-lists are groups with mailing list
> > >addresses, and I still have the default empty send-hook.
> > > 
> > >After this change,  and  works correctly again.
> > >But now, I have a problem with composing new messages.  The new
> > >message has the from address of the last email I started to compose
> > >(it does not matter if I aborted the message or sent it).  I guess
> > >this means the last my_hdr command "persists" through the rest of the
> > >session.
> > > 

 [...chomp...chomp...chomp...]

> > > 4. Now to solve this issue, I re-introduce the old reply-hooks.
> > > 
> > >  reply-hook '~h "Delivered-To: +list@gmail\\.com"' my_hdr From: 
> > > l...@gmail.com
> > >  reply-hook '~h "Delivered-To: +wor...@domain.com"' my_hdr From: 
> > > wor...@domain.com
> > > 
> > >This does not work right away because of (3).  So I remove (3), set
> > >the default send-hook back to empty, as in (1), and introduce a
> > >default reply-hook as below:
> > > 
> > >  reply-hook . my_hdr From: prim...@gmail.com
> > > 
> > >This fixes reply, but $reverse_name is still broken.
> > 
> > I forgot to mention, this last step reintroduces the problem with
> > composing new messages I mentioned in (2).  This stands to reason since
> > I removed the `my_hdr From: ...' command from the default send-hook.
> 
> Have a look at "send2-hook" in tfm.

I did some thinking; I think proceeding on this path will keep me going
round in hoops.  I need to find a way to break the spiral after (2).

My partial solution for the moment is to use the following after (2)

  send2-hook . "unmy_hdr From"

reverse_name still breaks very subtly ( fails when I want to send
to the poster on a mailing list message).  I'll experiment some more.

Thanks for the help.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.


Re: Using send and reply hooks to set from address and reverse_name

2013-05-10 Thread Suvayu Ali
Hi Andre,

On Tue, May 07, 2013 at 08:28:46PM +0200, Andre Klärner wrote:
> 
> small question: why don't you use "set from=wor...@domain.com" etc?

As far as I'm aware, 'set from=..' and 'my_hdr From ..' serves the same
purpose.

> I have the setup as following:
> each mail is filed to a matching folder, my personal mail go to ~/Maildir,
> my work email are accessed via imap://work-server/…, some of the other
> accounts follow the same pattern.

I do not use IMAP directly.  I use OfflineIMAP to sync to a maildir in
my home directory.  I also use one SMTP (gmail) with different from
addresses to reply to my emails from different accounts.  Gmail lets you
do this once you have authenticated that these alternate from addresses
are indeed yours.

> Depending on the folder I'm in the correct from address is set with "set 
> from=…"
> As each IMAP account use different SMTP-Servers these are set via some
> send-hooks that depend on the from: address. This also matches my workflow
> that new mails are edited/sent using a second mutt-instance in a new
> screen-window.
>
> Maybe this gives you an idea how to accomplish your setup.

The idea about using another screen window sounds intriguing.  I'll play
with this.

> If someone wants to read it I can post my current mutt-setup tomorrow.

That might help actually.  Of course only if it is not too much trouble :).

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.


Re: Using send and reply hooks to set from address and reverse_name

2013-05-10 Thread Patrick Shanahan
* Suvayu Ali  [05-10-13 20:09]:
> On Tue, May 07, 2013 at 08:28:46PM +0200, Andre Klärner wrote:
> > 
> > small question: why don't you use "set from=wor...@domain.com" etc?
> 
> As far as I'm aware, 'set from=..' and 'my_hdr From ..' serves the same
> purpose.
 [...]

http://dev.mutt.org/trac/wiki/MuttFaq/Header

How do I set mutt to allow editing of the From: header during composition?

The primary way to set your default sender address is through the $from
and $realname variables in muttrc:

set realname="Joe User" set from="user@host" set use_from=yes

: NOTE: Another way is to use my_hdr From: but it is discouraged
because it has drawbacks: It breaks the $reverse_name feature, and
doesn't work for messages resent using the  function.
While my_hdr From: can be a convenient temporary override of the
default address, it is not as convenient for setting the default
address.



I set $reverse_name, but it's not working!

The original message (the one to which you are replying) must have been
sent to an address which matches $alternates (v<=1.5.5) or
alternates-cmd (v>=1.5.6). Also there must be no my_hdr From:
active: It would overrule $reverse_name. See the previous question for a
way to do it.
 

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  HOG # US1244711
http://wahoo.no-ip.orgPhoto Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org   openSUSE Community Member
Registered Linux User #207535@ http://linuxcounter.net


Re: using a file selection command

2013-05-10 Thread Luis Mochan
> To a degree. In edit mode, add an Attach: header. When you exit
> edit mode, mutt will attach the named file.
> 
Thanks! Very nice trick. 


-- 

  o
W. Luis Mochán,  | tel:(52)(777)329-1734 /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388 `>/   /\
Apdo. Postal 48-3, 62251 |   (*)/\/  \
Cuernavaca, Morelos, México  | moc...@fis.unam.mx   /\_/\__/
GPG: DD344B85,  2ADC B65A 5499 C2D3 4A3B  93F3 AE20 0F5E DD34 4B85