Hi mutters,

a couple of days ago I sent a question related to sender profiles.
Thanks to Mikko, I managed to make a working configuration.
The best part of it is that you can include pretty much
anything in the profile and you can also assign profiles
with certain addresses using send-hooks. There are still a 
couple of minor problems left, but here is the solution.

1) add something like this to your muttrc:

#
# Profiles
# (defined in separate files)
#

# default
source ~/.mutt/profile.default

# macros to invoke a profile
macro   index   <F1>    ":source ~/.mutt/profile.default\n" "Load default profile"
macro   index   <F2>    ":source ~/.mutt/profile.personal\n" "Load profile: personal"

# You can still use send-hooks to automatically choose a profile!
send-hook ([EMAIL PROTECTED])$ \
        "source ~/.mutt/profile.personal\n"

2) create the profiles, here are the two examples from above

profile.default:
---
# Mutt profile: default
# From, Reply-To, Fcc, Bcc, Pgp sign-key, attribution, signature etc.

set locale=""
set signature='~/.signature'
set indent_string="> "          # Quoting mails with this string.
set attribution='On %{%a, %d %b %Y}, %n wrote:\n'
set post_indent_string=""       # Footer (after quotes, before signature).

# Pretty Good Privacy (PGP):
set pgp_sign_as="0x0000000"     # UserID/KeyID for signing
set nopgp_autoencrypt 
set nopgp_autosign

# Customized headers
unmy_hdr *                      # remove all extra headers first.

my_hdr From: Martti Rahkila <[EMAIL PROTECTED]>
my_hdr Reply-To: Martti Rahkila <[EMAIL PROTECTED]>
#my_hdr Bcc: [EMAIL PROTECTED]
#my_hdr Organization: org

# Fcc stuff
fcc-hook . "=sent"
---

profile.personal
---
# Mutt profile
# From, Reply-To, Fcc, Bcc, Pgp sign-key, attribution, signature etc.

# Settings for personal mail (in Finnish)

set signature='fortune|'        # get the signature from fortune program
set locale=fi_FI
set indent_string="> "          # Quoting mails with this string.
set attribution='\n%n kirjoitti %{%Ana, %d. %Bta %Y}:\n'
set post_indent_string=";-)"    # Footer (after quotes, before signature).

# Pretty Good Privacy (PGP):
set pgp_sign_as="0x11111111"    # UserID/KeyID for signing
set pgp_autoencrypt 
set pgp_autosign

# Customized headers
unmy_hdr *                      # remove all extra headers first.

my_hdr From: Martti Rahkila <[EMAIL PROTECTED]>
my_hdr Reply-To: Martti Rahkila <[EMAIL PROTECTED]>
#my_hdr Bcc: [EMAIL PROTECTED]
#my_hdr Organization: org

# Fcc stuff, does this need to be hook?
fcc-hook . "=sent.personal"
---

3) Check that muttrc doesn't contain any of the profile definitions,
I noticed that muttrc defaults and/or send-hooks will override
some of these! (Should it do that?)

4) start mutt and enjoy!

When you want to send someone a message using your personal profile,
press F2 to load profile (possibly do ^F before that, if you've
used a different PGP key earlier!).


This was tested with mutt 1.0.1 on linux.

Known problems/questions:
- Is there a way to include a message on the status bar with a macro?
In this case it would be nice have something like "Loaded profile: personal"
(Now it's pretty difficult to remember which profile is active)
- what would be an elegant way to include "forget-passphrase" command
either in the macro or the profile?
- the problems mentioned in step 3

Have fun,
--
        Martti Rahkila

        E-mail: [EMAIL PROTECTED]

        Helsinki University of Technology
        Department of Electrical Engineering and Communications
        Laboratory of Acoustics and Audio Signal Processing

Reply via email to