Re: Re: Handling multiple From addresses

2022-09-13 Thread Jan Eden via Mutt-users

On 2022-09-13 20:07, Robert wrote:
> Hi there,
> 
> On 2022-09-04 17:17, Jan Eden via Mutt-users wrote:
> > - Can I define multiple From addresses to select them from a list?
> > - Can mutt be configured to switch the default BCC address to a changed
> >   From address?
> > - If there is only a single PGP private key for each address – is it
> >   possible to have that key selected automatically (or with a single
> >   keystroke) according to the current From address?
> 
> I had the exact same problems and did a bit of an over-engineering approach:
> my profiles are defined in a yaml file and a python script generates the
> necessary (neo)mutt rc files.
> 
> The details, as well as the python script are available here:
> https://spacepanda.se/neomutt-pt7.html

Nice – I have a knack for over-engineering. :)

Cos had already suggested a similar approach to your "tedious and
annoying" version  which I adapted
(http://lists.mutt.org/pipermail/mutt-users/Week-of-Mon-20220905/003863.html)
to manually select the desired identity. Using reply-hooks is a better
solution, but unfortunately, they are executed too late in the
composition workflow to change the Bcc header
(http://mutt.org/doc/manual/#compose-flow). Some of my addresses have
more than one recipient, so the correct Bcc header is crucial.

Defining a message-hook works in most cases (if I open/view a message
before replying to it), but sometimes I want to reply to a message right from 
the
index after starting mutt.

Do you have any suggestion on how to change the Bcc header
automatically?

Thanks,
Jan




signature.asc
Description: PGP signature


Re: Handling multiple From addresses

2022-09-13 Thread Robert
Hi there,

On 2022-09-04 17:17, Jan Eden via Mutt-users wrote:
> - Can I define multiple From addresses to select them from a list?
> - Can mutt be configured to switch the default BCC address to a changed
>   From address?
> - If there is only a single PGP private key for each address – is it
>   possible to have that key selected automatically (or with a single
>   keystroke) according to the current From address?

I had the exact same problems and did a bit of an over-engineering approach:
my profiles are defined in a yaml file and a python script generates the
necessary (neo)mutt rc files.

The details, as well as the python script are available here:
https://spacepanda.se/neomutt-pt7.html

Toodles,
  Robert


Re: Re: Handling multiple From addresses

2022-09-07 Thread Jan Eden via Mutt-users
On 2022-09-07 08:04, Cameron Simpson wrote:
> On 06Sep2022 09:26, Jan Eden via Mutt-users  wrote:
> > Thank you! This is exactly what I needed. I tweaked your version a bit
> > to use the standard parameters for setting the required values:
> > 
> > set from="x...@eden.one"
> > set pgp_default_key = '0x20F7FHD80EC4C17294434A0220D37B3CE755FE8A'
> > set status_format="-%r x...@eden.one: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? 
> > Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? 
> > %l?]---(%s/%S)-%>-(%P)---"
> > unmy_hdr *
> > my_hdr Bcc: t...@eden.one
> 
> I've got a slightly tweaked $status_format which begins:
> 
> set status_format="$my_account_email .."
> 
> because I've parameterised the email address, since it gets used in a few
> places.

FWIW, my final setup looks like this:

# .muttrc
source ~/.mutt/default_address.cf
macro generic \e1 ":source ~/.mutt/default_address.cf\r"
macro generic \e2 ":source ~/.mutt/alternative_address1.cf\r"
macro generic \e3 ":source ~/.mutt/alternative_address2.cf\r"
macro generic \e4 ":source ~/.mutt/alternative_address3.cf\r"

# default_address.cf
set my_address = "x...@eden.one"
set my_pgp_key = '257A9B6F3DEDCA11319000877CD4656792A3A1F4'
source '~/.mutt/set_address.cf'

# set_address.cf
set from=$my_address
set pgp_default_key = $my_pgp_key
set status_format="-%r $my_address: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? 
Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? 
%l?]---(%s/%S)-%>-(%P)---"
unmy_hdr *
my_hdr Bcc: $my_address

- Jan


signature.asc
Description: PGP signature


Re: Handling multiple From addresses

2022-09-06 Thread Cameron Simpson

On 06Sep2022 09:26, Jan Eden via Mutt-users  wrote:

Thank you! This is exactly what I needed. I tweaked your version a bit
to use the standard parameters for setting the required values:

set from="x...@eden.one"
set pgp_default_key = '0x20F7FHD80EC4C17294434A0220D37B3CE755FE8A'
set status_format="-%r x...@eden.one: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? 
Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? 
%l?]---(%s/%S)-%>-(%P)---"
unmy_hdr *
my_hdr Bcc: t...@eden.one


I've got a slightly tweaked $status_format which begins:

set status_format="$my_account_email .."

because I've parameterised the email address, since it gets used in a 
few places.


Cheers,
Cameron Simpson 


Re: Re: Handling multiple From addresses

2022-09-06 Thread Jan Eden via Mutt-users
On 2022-09-05 19:16, Ofer Inbar wrote:
> What I did for this was select a few esc-capital hotkey combos
> and define macros like this in my muttrc:
> 
> macro generic \eF ":source ~/.mutt/headers.f...\r"
> macro generic \eH ":source ~/.mutt/headers.h...\r"
> 
> And so on.  (I replaced the actual filenames with "...")
> 
> Each .mutt/headers... file looks somewhat like this:
> --
> unmy_hdr *
> my_hdr X-URL: ...
> my_hdr From: Ofer Inbar 
> set status_format="-%r- %f: cos@somedomain ---[Msgs:%?M?%M/?%m%?n?New:%n?%?d? 
> Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? 
> Inc:%b?%l]---(%s%?S?/%S?)-%>-(%P)---"
> set signature="..."
> --
> 
> So in the index I can hit esc-F, esc-H, etc., and it loads the set of
> headers I want, and also sets my status line to show me which header
> set I currently have loaded.

Thank you! This is exactly what I needed. I tweaked your version a bit
to use the standard parameters for setting the required values:

set from="x...@eden.one"
set pgp_default_key = '0x20F7FHD80EC4C17294434A0220D37B3CE755FE8A'
set status_format="-%r x...@eden.one: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? 
Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? 
%l?]---(%s/%S)-%>-(%P)---"
unmy_hdr *
my_hdr Bcc: t...@eden.one

Thanks again,
Jan


signature.asc
Description: PGP signature


Re: Handling multiple From addresses

2022-09-05 Thread Ofer Inbar
What I did for this was select a few esc-capital hotkey combos
and define macros like this in my muttrc:

macro generic \eF ":source ~/.mutt/headers.f...\r"
macro generic \eH ":source ~/.mutt/headers.h...\r"

And so on.  (I replaced the actual filenames with "...")

Each .mutt/headers... file looks somewhat like this:
--
unmy_hdr *
my_hdr X-URL: ...
my_hdr From: Ofer Inbar 
set status_format="-%r- %f: cos@somedomain ---[Msgs:%?M?%M/?%m%?n?New:%n?%?d? 
Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? 
Inc:%b?%l]---(%s%?S?/%S?)-%>-(%P)---"
set signature="..."
--

So in the index I can hit esc-F, esc-H, etc., and it loads the set of
headers I want, and also sets my status line to show me which header
set I currently have loaded.
  -- Cos