About saving outgoing messages

2015-09-29 Thread steve

Hi there!

Let's say I'm sending a message to mom and dad and writing it from the 
Inbox folder. Once this message is sent, it is saved in $record=Sent 
folder.


Now if I write the message from within the family/mom folder, it gets 
saved in the family/mom folder since I have defined


set record=+family/mom

in a file being sourced when I enter the family/mom folder.

but I don't have a copy of this message in the family/dad folder.

So I have two questions here. First, say I have n recipients in the 
From: line, is it possible to save a copy of the message n times, each 
in the right folder? If so, how can I do that (and as a corollary, is it 
a good policy?)


A second, how can I manage to save a message in the right folder even if 
I'm not writing it in that folder?


I've been playing with folder-hook and fcc-hook but never managed to get 
where I would like.


Thanks for any help.

 Steve


Re: status_format per account-hook or folder-hook

2015-09-29 Thread Paul Tansom
** Paul Tansom  [2015-09-26 17:43]:
> ** Cameron Simpson  [2015-09-26 12:58]:
> > On 26Sep2015 08:00, Cameron Simpson  wrote:
> > >The muttrc is read just once at startup. It looks like you want to source
> > >your per-domain files on folder switch. I'd be inclined to prepend "set
> > >imap_user = p...@domain1.com" to your muttrc.domain1.com file, and write
> > >the hooks like this:
> > >
> > >account-hook imaps://em...@domain1.com@imap.localdomain.com 'source 
> > >~/.mutt/muttrc.domain1.com'
> > >account-hook imaps://em...@domain2.com@imap.localdomain.com 'source 
> > >~/.mutt/muttrc.domain2.com'
> > >
> > >and so forth. That way the _entire_ domainX.com setup is sources on folder 
> > >switch.
> > 
> > I've been doing some tests (and swanking up my muttrc config). And reading
> > the Fine Manual:
> > 
> >  http://www.mutt.org/doc/devel/manual.html#account-hook
> > 
> > It seems that the account-hooks are only consulted when mutt needs to access
> > a remote folder (IMAP, etc). It is consulted not just when you visit an IMAP
> > folder but also whe mutt polls a remote folder, etc. So anything in an
> > account-hook might be run at any time, depending on your config.
> > 
> > By contrast the folder-hooks are used reliably for every folder entry.
> > 
> > So I've now got the following in my setup (somewhat edited here):
> > 
> >  set my_cs='c...@zip.com.au'
> >  set my_cs_iphone='email-which-delivers-to-my-phone@blah'
> >  set my_cs_clipboard='email-which-delivers-a-shared-folder@glargh'
> >  set my_local_mail="$HOME/mail"
> > 
> >  folder-hook . 'set my_account_email=$my_cs; set folder=$my_local_mail'
> >  folder-hook 'imaps://my-phone-imap/' 'set my_account_email=$my_cs_iphone'
> >  folder-hook 'imaps://the-clipboard-imap/' 'set 
> > my_account_email=$my_cs_clipboard'
> >  folder-hook . 'set status_format="$my_account_email [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)"'
> > 
> >  account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
> >  account-hook 'imaps://my-phone-imap/' 'source "cs-mutt-imap-settings 
> > cs-iphone-cc |"'
> >  account-hook 'imaps://the-clipboard-imap/' 'source "cs-mutt-imap-settings 
> > clipboard |"'
> > 
> > The folder-hooks run on every folder entry, including the last one which
> > sets a per-folder $status_format. The account-* files set only usernames and
> > passwords, sucked from my .fetchmailrc.
> > 
> > You might find it useful to move your status_format into folder-hooks and
> > keep the account-hooks purely for passwords.
> ** end quote [Cameron Simpson]
> 
> Looks interesting, I'll have to explore further. I've been tidying my config 
> too. Initially removed some folder-hook lines at the bottom that seemed to 
> duplicate everything that was in the source files for my account-hook lines 
> (a legacy from earlier configs I think). Having looked at your previous email 
> I experimented with moving the imap_user into the source'd file and it did 
> allow the config to modify the status_format.
> 
> There were a few downsides to this:
> 
> Firstly, the tab completion of the accounts when changing directory vanished; 
> I used to be able to start with im for imaps:// and tab complete from there.
> 
> Secondly, once all accounts were modified it stalled on sorting mail; this 
> was fixed by putting an imap_user in for the default account.
> 
> Thirdly, once I manually type account details in (imaps://... etc.) and 
> switch to a different account the performance nose dives and everything 
> pauses before each action, even when I switch back to the main account 
> performance is poor - likely due to the fact that using = hasn't switch to 
> referring to the main account. I've also just noticed I've lost my signature.
> 
> Clearly this needs more work, and I'm learning quite a bit in the process. It 
> is amazing how long you can get along using some software without fully 
> understanding everything about it. I started using Mutt back in 2001 I think.
** end quote [Paul Tansom]

I think I've got it sorted. I've had a bit of fun with my muttrc and will
probably experiment further as I'm sure I could tidy and improve things more.

My account-hook lines now just have the imap_user line with them and everything
else that was in the file sourced has moved to matching folder-hook lines. For
a while I had these in separate files linked using a source entry, but in the
end I moved the account-hook line into my main muttrc and left the rest of the
configuration in the sourced file. I suspect I might be able to put things back
the way they were since the reason I tried that change has been solved by
another modification - namely putting all my mailbox lines into a single file
that is sourced higher up the main muttrc. That said, with the folder-hook
within the source'd files I did find I had problems with multiple timeouts of
the connection to the IMAP server, so I'm not rushing t

mutt importing attached secret keys by default? [Was: unlock keychain with pam authentication]

2015-09-29 Thread SGT. Garcia
following is from earlier discussion on gnupg-us...@gnupg.org. i'm wondering if
mutt imports any attached key into gnupg's keyring by default.

On Tue, Sep 29, 2015 at 03:33:38PM +0100, Andrew Gallagher wrote:
> On 29/09/15 15:28, Daniel Kahn Gillmor wrote:
> > On Tue 2015-09-29 08:53:32 -0400, Andrew Gallagher  
> > wrote:
> >> On 28/09/15 23:16, SGT. Garcia wrote:
> >>> On Mon, Sep 28, 2015 at 04:10:10PM -0400, Daniel Kahn Gillmor wrote:
> 
>  Do you ever import keys that other people
>  send you?  or keys you find on the web?  or keys attached to e-mail
>  messages?  Are you sure the things imported can't include a secret key?
> >>>
> >>> this is the first time i hear about *importing* to be honest. after 
> >>> reading, yes
> >>> just reading, your email a new key was added and on the next run of 
> >>> 'notmuch
> >>> new' i was asked for it by pinentry. i'm guessing mutt imports any key it 
> >>> finds
> >>> in attachments.
> >>
> >> Surely that 'feature' needs removing asap?
> > 
> > I'm surprised to hear that notmuch has this feature, and i haven't seen
> > it happen myself.  I'm one of the people who helped contribute to
> > notmuch's OpenPGP mechanisms.
> > 
> > This sounds like something to be raised on the notmuch mailing list,
> > though.
> 
> I was referring to mutt (allegedly) importing random secret keys that it
> finds attached to arbitrary mails... but yes, a discussion for elsewhere.
> 
> A
> 

mutt indeed; not notmuch. notmuch; well in fact in my setting isync is going to
sync _everything_ with upstream imap repo regardless. my best guess is that it's
mutt that imports the key. i will resend a copy of this to mutt's mailing list.


sgt



Re: Sort by newest in thread?

2015-09-29 Thread Grant Edwards
On 2015-07-13, Ian Zimmerman  wrote:
> On 2015-07-13 11:09 -0700, Kevin J. McCarthy wrote:
>
>> Does 'set sort_aux=last-date-received' do what you want?
>
> Not quite, but
>
> set sort_aux=last-date

Brilliant!

That's been a minor annoyance for yonks.  Every week or two I'd tell
myself "there's got to be a setting for that -- I should look into
that when I have a second..."

-- 
Grant Edwards   grant.b.edwardsYow! The Korean War must
  at   have been fun.
  gmail.com



Re: About saving outgoing messages

2015-09-29 Thread Cameron Simpson

On 29Sep2015 15:18, steve  wrote:
Let's say I'm sending a message to mom and dad and writing it from the Inbox 
folder. Once this message is sent, it is saved in $record=Sent folder.


Now if I write the message from within the family/mom folder, it gets 
saved in the family/mom folder since I have defined


set record=+family/mom

in a file being sourced when I enter the family/mom folder.

but I don't have a copy of this message in the family/dad folder.

So I have two questions here. First, say I have n recipients in the 
From: line, is it possible to save a copy of the message n times, each 
in the right folder? If so, how can I do that (and as a corollary, is 
it a good policy?)


A second, how can I manage to save a message in the right folder even 
if I'm not writing it in that folder?


I've been playing with folder-hook and fcc-hook but never managed to get where 
I would like.


Mutt has a few mechanisms for deciding where to save outbound messages, but 
each will cause mutt to only save it once. Hmm; I think. It is possible that 
$save_name might to it for every recipient - the documentation (man muttrc) 
speaks in terms of a single recipient.


This leaves you with two choices:

 - run with a suitable purely mutt system

 - create your own

For the former, look at $record (you use it already), $save_name and 
$force_name settings. It sounds like they won't quite do what you want.


For the latter, I use two approaches (at once!):

 - use a custom $sendmail program which takes copies of the message after 
   submitting it to the mail system


 - use my mail filing system to file multiple copies of the message

For the former, I use this script:

 https://bitbucket.org/cameron_simpson/css/src/tip/bin/sendmesg-fcc

which tries to dispatch the message normally (it calls "sendmesg", but that 
calls sendmail) and if that succeeds if files a copy of the message in every 
folder in the $SENDMESG_FCC environment variable. Personally, I contrive that 
to be the current mail folder and my "spool-out" folder, where more filing 
happens. That way a copy of the message is in the folder where the source 
message was, giving me the whole thread.


For the latter, this depends on how you file your email. I use my mail filing 
system to takes the extra copies of the message.


Most people who autofile their inbound email run something like fetchmail or 
getmail, and hand message delivery to a tool like procmail, so it looks like 
this:


 getmail => procmail

I use a mail filer which watches Maildir mail folders, and I have it set to 
watch several. I collect with getmail, so that phase looks like:


 getmail => "+spool"

The mail filer handles the rest, disconnected from getmail.

Any message added to that folder is filed according to my inbound email rules.  
The mailfiler also watches my "+spool-out" folder (mentioned above), and that 
is where the "save a message in multiple places" stuff happens. Its rules look 
like this:


   out,me,spool-to-phone,spool-xref . .

   "| cs-aliases-add-email sent" . .

   work,"|buglog -n -B dlog -d \"$header_date\" \"WORK: 
$shortlist_from->$shortlist_to_cc_bcc: $header_subject\""   .  
to,cc,bcc,from:(WORK1|WORK2|@workdomain1|@workdomain2|...)

That's 3 lines, in case it gets folded.

The first rule saves a copy in the folders "+out" (like Sent), "+me" (my 
primary inbox - stuff "for me", as apposed to lists etc), "+spool-to-phone" 
(also monitored, copies message to the phone mailbox), "+spool-xfer" (also 
monitored, cross reference filing).


The second pipes messages through my address learning script, adding all the 
messages to the group "sent", which is part of my whitelist of addresses that 
get to my main inbox. So if I email someone, I hope to see their replies.


The third line matches "work" email (munged for privacy) and takes a copy in my 
"work" folder (where all work related email is supposed to be should I need it) 
and also writes a log line to my logging system, which records 
from/to/subject/time.


You can see that you could easily file messages associated with your family by 
such a system, and so forth.


Cheers,
Cameron Simpson 

I must construct my own System, or be enslaved to another Man's.
   - William Blake