Re: adventures in quoted-printable

2012-07-17 Thread Christian Brabandt
On Mon, July 9, 2012 23:12, Jack M wrote:
> Cameron Simpson wrote on 07/09/12 at 08:41:26 +1000:
>> On 08Jul2012 18:32, Jack M  wrote:
>> | However, I do keep copies of my sent
>> | mail in $record, and when I look at the saved copy, it is not
>> QP-encoded.
>> | Also, the mysterious QP only happens on *some* mails that I send,
>> indeed, only
>> | on *some* of the mails with non-ASCII in them.  This makes me think
>> mutt isn't
>> | the culprit.
>>
>> It does sound that way. Is it associated with particular target
>> addresses?
>> That would involve particular mail systems in the transport.
>
> The phenomenon hasn't yet happened enough for me to detect a pattern,
> although
> the instance that made me start this thread was a message I sent to a
> googlegroups mailing list; it was fine when I sent it, but when the list
> sent
> me a copy, it was QP-encoded.

Googlegroups is known to be broken in this respect. It somehow "changes"
the mails by advertising utf8 although the mail is still in latin1 or
something like this (I suspect this happens by trying to convert the
message to utf-8, but this silently fails, and the mail is bogus).

This has been discussed numereous times on the vim list, e.g.:
https://groups.google.com/d/msg/vim_use/Qcr2rJW7lFY/AnWOilJTmd0J
http://groups.google.com/group/vim_use/msg/dded7a677f5ee420
http://groups.google.com/group/vim_use/msg/1d2384d110b4fc1b
http://groups.google.com/group/vim_use/msg/2a3a6d5a5e19f340?hl=de

(those are just the once I could google quickly, I am pretty sure,
this has been discussed even more often). If you sent the message
correctly in utf-8, everything is ok, it only happens when you are
sending the message in a charset different then utf-8.

regards,
Christian



Re: Killfiling, anyone?

2012-07-25 Thread Christian Brabandt
Hi John!

On Mi, 25 Jul 2012, John Long wrote:

> Guys, what are you using for killfiling/mail filtering?
> 
> I am using Mutt's built in POP and SMTP at this point, is there any way to
> killfile emails based on header contents? Scoring won't be enough, I want to
> delete this crap as the email is being downloaded from my mail provider.
> 
> I am not looking for bayesian or other high-falutin' anti spam measures. I
> want to create my own killfile like I do with my newsreader, basically just
> creating rules that match the idiots that spam the mailing lists I'm in.

I used to have a little shell-script, that was killfiling within mutt 
for me (attached). It simply generates a pattern, that can be used by 
mutt to delete messages by scoring.

Additionally, I needed to set up scoring for mutt like this:

#v+
~$ cat ~/.mutt/score
##
# Scoring  Definitions for Mutt/Muttng
#
# Last update: Mi 2010-02-17 22:02
#
##

set score   # enable Scoring
set score_threshold_delete=0# delete messages with score 0
set score_threshold_flag=65 # auto-flag messages w/ score >= 35
set score_threshold_read=5  # mark messages w/ score <= 5 as read

# Remove all scorings
unscore *

# Default - Scoring
score '~N'   +10 # new mails have a higher score than old mail
score '~A'   +10 # all messages start with score 10
score '~g|~G'+2  # PGP signed / encrypted messages
score ~F +20 # flagged mails are important
score ~D =0  # this is a deleted email
score ~S =0  # superseded messages
score ~V +3  # cryptographic verified message
score '~x @256bit.org' +5# Message references one of my message

# Subject dependent scoring
score '~s [Vv][Ii][Mm]' +10  # vim
score '~s [Mm][Uu][Tt][Tt]' +10  # mutt
score '~s [Ss][Hh][Ee][Ll][Ll]' +10  # shell
score '~s [Bb][Aa][Ss][Hh]' +10  # bash
score '~s [Zz][Ss][Hh]' +10  # zsh

# The good one ;)
score '~P'   =20 # Message is from me

# SPAM
score '~f @aol.com'   -2 # AOL is usually less important
score '~f webmaster@*'-2 # Webmasters kidnapped by evil cult :>
score '~s ^test$' -2 # all messages w/ subject "test" are killed
score '~s sex | ~s adult' -10 # STFU
score '~f anonymous'  -10 # Yeah. Sure. Evil hackers from Serbia.
score '~='   -   # all duplicates are killed
score '~s ^unsubscribe$ !(~p|~P|~Q|~F)' -   # all msgs w/ subject 
"unsubscribe" not by myself are killed
#score '!~f@' -10   # no mail address present?
score "~f '^([^ <>@]+ ){5,}'"  -2   # a realname consisting of >=5 portions is 
invalid, too
score "!~s .*"-2  # no Subject line

source ~/.mutt/score_gen
$~
#v-

That was basically it. It still works, although I don't use it anymore.

PS: No, procmail was no option, since I used sieve scripts to deliver my 
mails.

regards,
Christian


mutt_score.sh
Description: Bourne shell script


Re: Killfiling, anyone?

2012-07-26 Thread Christian Brabandt
On Thu, July 26, 2012 11:38, John Long wrote:
> On Wed, Jul 25, 2012 at 08:53:03PM +0200, Christian Brabandt wrote:
>> Hi John!
>
> Hello! :)
>
>> I used to have a little shell-script, that was killfiling within mutt
>> for me (attached). It simply generates a pattern, that can be used by
>> mutt to delete messages by scoring.
>
> I like what you did here and it is actually pretty close to what I wanted,
> but I guess it requires you to press the $ key to actually do the delete
> once the messages are scored and until then they actually show up in the
> index. What I would like to do is never see the messages at all. Is there
> any way to do this with your method or do I really need to take the advice
> of the (let me count...5 guys...did I miss anybody) who voted for
> procmail?

folder-hook . 'push ' should apply the settings.

>> PS: No, procmail was no option, since I used sieve scripts to deliver my
>> mails.
>
> Then couldn't you have filtered from sieve? Why did you choose to do it
> from
> Mutt itself?

I could possibly discard mails using Sieve, but I didn't know how to
automate it and this was easier for me and a nice litte task to see,
if I can make use of scoring.

regards,
Christian



Re: Killfiling, anyone?

2012-07-26 Thread Christian Brabandt
Hi John!

On Do, 26 Jul 2012, John Long wrote:

> On Wed, Jul 25, 2012 at 08:53:03PM +0200, Christian Brabandt wrote:
> 
> > Additionally, I needed to set up scoring for mutt like this:
> 
> Christian, your idea is working pretty good so far but I didn't figure out
> how to source the script by binding it to a key. Is that possible somehow?

I am afraid I don't understand. What doesn't work?

regards,
Christian
-- 


Re: mutt on an IMAP-Server (dovecot): folder names and structure

2012-08-16 Thread Christian Brabandt
Hi martin!

On Do, 16 Aug 2012, martin f krafft wrote:

> also sprach Luis Mochan  [2012.08.16.1850 +0200]:
> > Would this be considered unsafe?
> 
> To store the password clear-text in a file? Yes.

What exactly is the problem with entering the password manually?


regards,
Christian
-- 
Humor in the Court:
Q: (Showing man picture.) That's you?
A: Yes, sir.
Q: And you were present when the picture was taken, right?


Re: mutt and not really read only mailboxes

2012-08-23 Thread Christian Brabandt
On Thu, August 23, 2012 08:53, Joerg Dorchain wrote:
> I have a setup where my MTA delivers mail to an mbox file, which
> then is in turn exported via nfs read only to the client where
> mutt is running. Main purpose of this construction is viewing
> certain attachments.
>
> While all this works fine the first time mutt is started, after a
> while there is the situation that new mail arrives, however the
> mutt instance with the read only filesystem does not notice.
>
> Would it be possible to make mutt check for changes to the
> mailbox, even when this is located on a read-only filesystem?

Try the check_mbox_size option.

regards,
Christian



Re: Sender name in the vim statusline

2012-11-09 Thread Christian Brabandt
Hi Eric!

On Fr, 09 Nov 2012, Eric Smith wrote:

> How do I get the sender's name to whom I am replying in the vim
> statusline?

That is not easy. You must rely on parsing the attribution line.

Say your attribution line looks like mine:

#v+
~$ grep attribution ~/.mutt/muttrc
set  attribution='Hi %v!\n\nOn %{%a, %d %b %Y}, %n wrote:\n'
~$
#v-

Now create a ~/.vim/after/ftplugin/mail.vim (create directories that 
don't exist yet) and put into it:

let _a = winsaveview()
if exists("b:mutt_from_statusline")
 finish
endif
0

if &ft == 'mail'
let &l:stl = (&l:stl ? &l:stl : &g:stl) . '[From: '. 
matchstr(getline(search('^On.*, \(.*\)wrote:$')), '.*, \zs.*\ze wrote:$'). ']'
let b:mutt_from_statusline=1
endif
call winrestview(_a)


regards,
Christian
-- 
By failing to prepare, you are preparing to fail.


Re: Seeing subfolder - dovecot - imap - maildir

2012-11-14 Thread Christian Brabandt
On Wed, November 14, 2012 05:55, Linda wrote:
> I use dovecot with Maildir for the imap server. I can view
> the inbox fine but can't access or list  the subdirectories
>
> Here is the .muttrc lines that would be relevant
>
> set spoolfile=imap://office-mail@star/
> set folder=imap://office-mail@star/
> set record=imap://office-mail@star/Sent
> set imap_user=office-mail
> mailboxes =/home/office-mail/Maildir/
>   mailboxes + `\
>   for file in ~/.maildir/.*; do \
> box=$(basename "$file"); \
> if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" =
> '.customflags' \
> -a ! "$box" = '.subscriptions' ]; then \
>   echo -n "\"+$box\" "; \
> fi; \
> done; \
>   for folder in ~/.maildir/*; do \
> if [ -x $folder]; then \
>   box=$(basename "$folder"); \
>   for file in ~/.maildir/$box/.*; do \
>  box2=$(basename "$file"); \
>  if [ ! "$box2" = '.' -a ! "$box2" = '..' -a
> ! "$box2" = '.customflags' \
>   -a ! "$box2" = '.subscriptions' ]; then \
> echo -n "\"+$box/$box2\" "; \
>  fi; \
>   done; \
>  fi; \
>done`
>
> I am pretty sure I need to change ~/maildir to something but
> don't know what to use in its place.  Also I changed
> mailboxes from Mail to Maildir but it doesn't seem to change
> anything. I also tired a set mask command I found in some
> howtos but then I lost the inbox.

I used to generate the folder list on the fly, using a small perl
script, which queries the IMAP Server directly:¹

¹ http://article.gmane.org/gmane.mail.mutt.user/29341

regards,
Chstian



Re: Change the header Attach: to Attached:

2012-11-20 Thread Christian Brabandt
On Tue, November 20, 2012 16:59, Eric Smith wrote:
> Is there a non sourcecode way to change mutt's interpretation of
> the header named Attach: to an arbitrary string (like Attached:)?

I don't think there is. Why?

regards,
Christian



Re: Change the header Attach: to Attached:

2012-11-20 Thread Christian Brabandt
On Tue, November 20, 2012 17:07, Eric Smith wrote:
>
> So when I write emails I refer to the attachments.
>
> I copy and paste the list of headers as a block like this;
> Attach: Foobar.baz
> Attach: Foobar_1.baz
> Attach: Foobar_2.baz
>
> into my text and reference them in a way that it is more professional and
> grammatical to say "Attached" rather than "Attach"

Well, we are talking about a pseudo-header here. It is not visible in your
mail and only used by mutt internally to detect which files need to be
attached. Those headers won't end up in your sent mail.

So you can consider it as a request to mutt to simply Attach those files.

regards,
Christian



Re: Change the header Attach: to Attached:

2012-11-20 Thread Christian Brabandt
Attached: File1.jpg

On Tue, November 20, 2012 17:16, Eric Smith wrote:
> No Christian, perhpas it not clear enough.
>
> If course they are pseudo headers.
>
> So in my vim when composing (usually large) emails. I develop a
> collection of *pseudo* headers like in the block below.
> Then I copy and paste these in the text with descriptions and
> comments relevant to each header.
>
> So I want to copy and paste a grammatically more useful *pseudo*
> header text. Of course mutt could be made to accept anything
> unique as this pseudo header, so I asked if it is changeable
> without a hack of the source.
>
> Thats all.

Since your are using Vim, you can make Vim convert your new pseudo-
header to the one mutt expects using an autocommands (let's say BufWrite
autocommand):

augroup MyMailGroup
au!
au InsertEnter  let _a=winsaveview()
\ 1,/^$/s/^\(Attach\)\(:.*$\)/\1ed\2/e
\ call winrestview(_a)
au BufWrite  let _a=winsaveview()
\ 1,/^$/s/^\(Attach\)ed\(:.*$\)/\1\2/e
\ call winrestview(_a)
augroup END

Put that into a file called ~/.vim/after/ftplugin/mail.vim and it
should work. (Make sure, your vimrc includes a :filetype plugin on
statement to have vim load filetype specific settings)

regards,
Christian



Re: Putting table in email?

2012-11-20 Thread Christian Brabandt
On Wed, November 21, 2012 07:39, David Champion wrote:
> * On 20 Nov 2012, Brian Salter-Duke wrote:
>>
>> OK, I have done that. I also changed nroff to groff as I have both and
>> they are different sizes. However, I still do not really understand by
>> "press T over table to format. I type the table, hit >esc> and then
>> shift-T. Nothing happens. What am I supposed to do?
>
> Does your cursor move at all?  If the macro is defined when you invoke
> vim, then pressing T should move to the top of the current/previous
> paragraph, then pipe text to the end of the paragraph, moving the cursor
> twice.  If the cursor is not moving, then I imagine vim isn't creating
> the macro.
>
> Sometimes vi/vim/etc have trouble with macros that overlap builtin
> behaviors.  Maybe there's a problem with T as a binding?  Does anyone
> who uses vim know?

I have never seen the case that vim had trouble overriding internal
keys. If it does, it needs to be reported and I am pretty sure Bram
fixes this.

Anyways, using the
nmap T {^M!}foobar
works here. Perhaps Vim doesn't correctly understand
the Carriage Return part within the mapping, in that case, simply try
nmap T {+!}foobar
or something. If that still doesn't work, I suppose some plugin interfers,
so in this case try explicitly with a vim started with
vim -u NONE -U NONE -N
and enter the mapping verbose into your commandline.

regards,
Christian



Re: Putting table in email?

2012-11-23 Thread Christian Brabandt
Hi Christoph!

On Mi, 21 Nov 2012, Christoph Möbius wrote:

> Also sprach Bernard Massot am Mi, 21 Nov 2012 um 00:18:09 +0100:
> > On Tue, Nov 20, 2012 at 04:37:11PM -0600, Jim Graham wrote:
> > > Note the corners:  periods on top, and ` ' on the bottom.  IMHO, this
> > > looks better.  But that IS just my opinion.  :-)   And just on a style
> > > note, I would also condense it to something like this (avoiding
> > > redundancy):
> > >
> > >.---.
> > >|  Hurricane   | Deaths  | Location |
> > >|===|
> > >| Great Hurricane of 1780  | 27,500+ | Antilles |
> > >|--+-+--|
> > >| Mitch, 1998  | 18,974 - 21,000 | Honduras |
> > >|--+-+--|
> > >| Galveston, 1900  | 8,000 - 12,000  |   Cuba, Texas|
> > >|--+-+--|
> > >|  Fifi, 1974  | 8,000 - 10,000  | Honduras, Belize |
> > >|--+-+--|
> > >| Dominican Republic, 1930 |  2,000 - 8,000  |  Antilles, D.R.  |
> > >|--+-+--|
> > >| Flora, 1963  |  7,186 - 8,000  |   Haiti, Cuba|
> > >`--+-+--'
> > What about the following one? (Unicode-enabled terminal needed)
> > ╭──┬─┬──╮
> > │  Hurricane   │ Deaths  │ Location │
> > ╞══╪═╪══╡
> > │ Great Hurricane of 1780  │ 27,500+ │ Antilles │
> > ├──┼─┼──┤
> > │ Mitch, 1998  │ 18,974 - 21,000 │ Honduras │
> > ├──┼─┼──┤
> > │ Galveston, 1900  │ 8,000 - 12,000  │   Cuba, Texas│
> > ├──┼─┼──┤
> > │  Fifi, 1974  │ 8,000 - 10,000  │ Honduras, Belize │
> > ├──┼─┼──┤
> > │ Dominican Republic, 1930 │  2,000 - 8,000  │  Antilles, D.R.  │
> > ├──┼─┼──┤
> > │ Flora, 1963  │  7,186 - 8,000  │   Haiti, Cuba│
> > ╰──┴─┴──╯
>
> This looks all great.
>
> Is there a script/plugin for doing this with vim?

Hm, I have been implementing something similar in the csv.vim filetype 
plugin and since it almost worked, I made :Table available as general 
plugin. You would need the csv filetype plugin from github:
https://github.com/chrisbra/csv.vim


Then you can do something like:

Header1|Header2|Header3|Header4
foobar|eins|zwei|drei
one|two|three|foor

Visually select the lines and type: :'<,'>Table
and it turns it into:

┌┬┬┬┐
│ Header1│ Header2│ Header3│ Header4│
├┼┼┼┤
│  foobar│eins│zwei│drei│
│ one│ two│   three│foor│
└┴┴┴┘

Doesn't work with having certain fields span several columns so.

regards,
Christian


Re: Documentation on L[ist reply] doesn't tell the whole truth

2012-11-29 Thread Christian Brabandt
Hi Chris!

On Do, 29 Nov 2012, Chris Green wrote:

> On Thu, Nov 29, 2012 at 11:23:56AM -0500, Patrick Shanahan wrote:
> > * Chris Green  [11-29-12 11:08]:
> > > I have been trying to work out for a while why I sometimes send two
> > > copies of some messages to mailing lists.  I finally worked out why, the
> > > L[ist reply] command will send to any address which is like:-
> > > 
> > > List-Post: 
> > > 
> > > *as well as* any message that matches the name found in the subscribe
> > > and/or lists commands in muttrc.
> > > 
> > > Is there any way to disable the use of the List-Post: entry, or any way
> > > to prevent mutt from sending to two addresses?
> > > 
> > > On this list there's always a List-Post: header and, sometimes there is
> > > also a To: ix...@ixion.org.uk which also works for the same list. 
> > 
> > I have not found this a problem.  I haven't noticed *myself* sending dups
> > to the/any list using the "list reply" function "L".  You undoubtedly have
> > something in ~/.muttrc.  W/o seeing your .muttrc, I can only suggest
> > saving your present .muttrc to another name and making a new minimal
> > .muttrc to use for testing.  Set a fictitious mailing list in .muttrc with
> > an address you control and use it for testing.  Add sections of your
> > original .muttrc between tests until you notice dups occuring.
> > 
> > If you have recorded or can identify the list[s] where the dups occur,
> > look in your .muttrc for similarities to those list posting addrs. 
> > Playing with them could minimize the effort necessary.
> > 
> It's not my .muttrc, it's just one list that I subscribe to which has
> two addresses.  Only one address ever appears in List-Post: but the
> alternative address sometimes appears in To: or Cc: headers, thus there
> can be messages with the following:-
> 
> List-Post: 
> Cc: ix...@ixion.org.uk
> 
> Since I have ix...@ixion.org.uk in 'subscribes' and 'lists' mutt will
> reply to *both* ix...@ixiemaster.ixion.org.uk and ix...@ixion.org.uk
> when I hit L[ist reply].

Can't you do something like
lists ixion@([^.]*\.)?ixion.org.uk
? This should make mutt treat both addresses as the same list and make 
it only list-reply to one of it (My guess would be the List-Post 
adress).


regards,
Christian
-- 
And if sometime, somewhere, someone asketh thee,
"Who kilt thee?", tell them it 'twas the Doones of Bagworthy!


Re: Importing addresses from ClawsMail --> Export --> Html | LDIF?

2012-12-12 Thread Christian Brabandt
Hi Csányi!

On Do, 15 Nov 2012, Csányi Pál wrote:

> Paul Hoffman  writes:
> 
> > On Wed, Nov 14, 2012 at 09:27:46PM +0100, Csányi Pál wrote:
> >> David Champion  writes:
> >> 
> >> > * On 14 Nov 2012, Csányi Pál wrote: 
> >> >> > so export from clawsmail in ldif? :)
> >> >> 
> >> >> I already did it, I exported from clawsmail into ldif file.
> >> >> 
> >> >> However I can't add this resulting ldif file into ldap server, because I
> >> >> get error message: ldap_bind: Invalid credentials (49)
> >> >> when I enter the admin password.
> >> >
> >> > That seems like an LDAP problem.
> >> >
> >> > However, more the point, abook can import the LDIF to its own internal
> >> > database.  Why do you need to load it into LDAP at all?
> >> 
> >> Because when I'm trying to do this in Abook, I get an error message:
> >> 
> >> File does not seem to be a valid addressbook
> >
> > Maybe Clawsmail is producing invalid LDIF, or maybe abook can only 
> > handle a subset of LDIF.  Send us a (sanitized) copy or excerpt to look 
> > at.
> 
> OK, here it is in this mail as attachment.
> 
,
| [...]
| dn: uid=343637306,SomeTag
| objectClass: inetOrgPerson
| cn: AA 
| sn: Some SN
| displayName: AA 
| mail: ...@yahoo.com
`

Looks like a bug in abooks ldif parser, since it expects fieldnames to 
be lowercase. You need to convert the objectClass to objectclass and 
then abook imports it.


regards,
Christian
-- 


Re: Importing addresses from ClawsMail --> Export --> Html | LDIF?

2012-12-13 Thread Christian Brabandt
Hi mutt-users!

On Mi, 12 Dez 2012, Christian Brabandt wrote:

> Looks like a bug in abooks ldif parser, since it expects fieldnames to 
> be lowercase. You need to convert the objectClass to objectclass and 
> then abook imports it.

Upstream has included a patch that fixes this bug.

regards,
Christian
-- 
They went rushing down that freeway,
Messed around and got lost.
They didn't care... they were just dying to get off,
And it was life in the fast lane.
-- Eagles, "Life in the Fast Lane"


Re: Remove prefix from subject header in index view

2012-12-14 Thread Christian Brabandt
Hi Marco!

On Fr, 14 Dez 2012, Marco wrote:

> Hi,
> 
> I already asked this question on unix.stackexchange.com¹, but got no
> response.
> 
> I subscribed to several mailing lists that prefix the Subject:
> header with a fixed string like [list-foo]. This clutters my index
> view and limits the usable space.
> 
> I'd like to strip this [list-foo] header from the index view. What's
> the best way to achieve that? Maybe a regular expression can be
> hooked into the index_format setting? I don't necessarily need to
> strip the prefix permanently, it's sufficient to not display it in
> the index to leave more space to the real subject. It may still show
> up in the pager and be included in responses.
> 
> I know that Claws-Mail has a function that does exactly that. It's
> called “Simplify Subject RegExp”.
> 
> Marco

See the thread, that was discussed here recently "mailing list subject 
line tags"
http://thread.gmane.org/gmane.mail.mutt.user/39591/focus=39629


regards,
Christian
-- 
"Cable is not a luxury, since many areas have poor TV reception."
-- The mayor of Tucson, Arizona, 1989


Re: Remove prefix from subject header in index view

2012-12-15 Thread Christian Brabandt
Hi Marco!

On Fr, 14 Dez 2012, Marco wrote:

> On 2012–12–14 Christian Brabandt wrote:
> 
> > See the thread, that was discussed here recently "mailing list subject 
> > line tags"
> > http://thread.gmane.org/gmane.mail.mutt.user/39591/focus=39629
> 
> Thanks for the info. As far as I understand mutt does not have such
> a feature, but someone wrote a patch for it.
> 
> What's the reason that the “subjectrx” patch is not included in
> mutt? Apparently I'm not the only one interested in a subject regex.

Probably it is not yet in mutt, but might be included later. Many 
features from mutt started as separate patches (or are still flying 
around as patches) until they have been included into main mutt.


regards,
Christian
-- 
Substantial penalty for early withdrawal.


Re: pressing doesn't bring up anything

2012-12-20 Thread Christian Brabandt
On Thu, December 20, 2012 14:55, Woody Wu wrote:
> On Thu, Dec 20, 2012 at 09:29:25PM +0800, Woody Wu wrote:
>> On the hand, I found my .muttrc has some default alias definitions like
>> what you guy said. For example:
>>
>> alias mutt-users Mutt User List 
>>
>> I tried to use this alias by pressing  after I inputted words
>> 'mutt-users' after the 'To:' header in mutt.  But I still got nothing.
>> Is there something to do with my message editor? Here it is vim.
>
> This still doesn't work.  I tried to remove my vimrc file and all the
> locally installed plugins. I still cannot use the  :(  What's wrong
> with my system?

Well, by default, vim does nothing about mutt, aliases or your .muttrc.
So you have to configure Vim to complete aliases when writing mails.

This might be of help for you, if you use Vim for writing mails:
http://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html

regards,
Christian



Re: Mutt+Abook: questions about addresses and multiple addressees

2012-12-23 Thread Christian Brabandt
Hi leo!

On Sa, 22 Dez 2012, leo wrote:

> ::First question::
> When I write an e-mail and I choose the addressee, abook automatically always 
> insert into the field To (or Cc or Bcc) the name and the e-mail address 
> (example: name surname . I would like that in the 
> field To (or Cc or Bcc) appears only the e-mail address without name and 
> surname.
> Is it possible?
> In my muttrc I recall abook with this command:
> 
> set query_command= "abook --mutt-query '%s'"

Recent development versions of abook support this:

abook --mutt-query "%s" --outformat=custom  --outformatstr "{email}"

regards,
Christian
-- 
Stay seated until bus comes to a complete stop.


Re: Macro to limit view to sender messages

2012-12-25 Thread Christian Brabandt
Hi xing!

On Di, 25 Dez 2012, xing wrote:

> I'd like to set up a macro which will set the  to all mail sent
> by the selected message sender.
> 
> I've looked in the docs and searched the web and can't find any
> information on how to expand something like ~f in a macro. Is this
> possible at all?

There is no easy way to extract the email address from a selected entry. 
What I have done, is pipe the entry through a script that uses formail 
to extract the senders email address and returns a command that can be 
used by mutt to limit the index to messages by that sender. It sounds 
cumbersome, but works well enough:


macro index A "unset wait_key\
~/bin/mutt_address.sh ~/temp/mutt_source.txt\
set wait_keysource ~/temp/mutt_source.txt" "limit 
message view by selected author"


,[ mutt_address.sh ]-
| #!/bin/sh
| 
| FORM=`which formail`
| ARGS="`cat`"
| 
| # The sed statement will cut out only the relevant part from
| # the e-mail address between (e.g. for "Foo"  it 
| # will only print foo\.bar@foobar\.xyz) and will also translate
| # allowed characters like "." or "+" by escaping them
| OUTPUT=`echo "${ARGS}"|"${FORM}" -tzx "From:" | sed 
's/.*//;s/\./&/g;s/+/&/g'`  
| if [ -n "$1" ]; then
| TEMP="$1"
| exec >"${TEMP}" || { echo "Could not output to $1, exiting..." &&  exit 
1; }
| 
| cat <~f \"${OUTPUT}\""
| EOF
| else
| echo "You must supply a filename in which to store the result!" && exit 2
| fi
`


regards,
Christian
-- 


Re: How to create a new aliase (key-binding)?

2012-12-25 Thread Christian Brabandt
Hi Woody!

On Di, 25 Dez 2012, Woody Wu wrote:

> Copy/paste into the .mail_aliases file is boring.  Is there a key
> binding that inserts a new aliase based on the current reading message?

Have you read the manual?

regards,
Christian
-- 


Re: Macro to limit view to sender messages

2012-12-26 Thread Christian Brabandt
Hi Patrick!

On Di, 25 Dez 2012, Patrick Shanahan wrote:

> limit from 
> 
> :l ~f 
> 
> perhaps a little reading of the documentation would make it possible.

Perhaps reading the message to which you answered helps. Nobody is 
denying, that the  basic principle for limiting is using ~f . 
The problem is getting the  from a mail visually selected in 
the index, so that you can bind it to a key.

regards,
Christian
-- 
Prediction is very difficult, especially of the future.
-- Niels Bohr


Re: Macro to limit view to sender messages

2012-12-26 Thread Christian Brabandt
Hi Patrick!

On Mi, 26 Dez 2012, Patrick Shanahan wrote:

> * Christian Brabandt  [12-26-12 10:23]:
> > Hi Patrick!
> > 
> > On Di, 25 Dez 2012, Patrick Shanahan wrote:
> > 
> > > limit from 
> > > 
> > > :l ~f 
> > > 
> > > perhaps a little reading of the documentation would make it possible.
> > 
> > Perhaps reading the message to which you answered helps. Nobody is 
> > denying, that the  basic principle for limiting is using ~f . 
> > The problem is getting the  from a mail visually selected in 
> > the index, so that you can bind it to a key.
> 
> Odd, in my xterm session a double mouse click will provide that for
> copying.  Capturing the address with the mouse is even possible in console

Yeah, I understand, first opening the message in the browser, then 
moving the hands from the keyboard to the mouse to visually select the 
address then returning to the index, pressing l ~f and pasting via the 
mouse or the keyboard is really comfortable.

> mode with gpm active.  I understand what you provided but you still have
> to access to designate a *particular* post containing a "From:" addr and
> the OP *specified* "by the *selected* message sender".
> 
> x...@synapse.plus.com asked
> 
> I'd like to set up a macro which will set the  to all mail sent
> by the selected message sender.
 ^^^
> 
> I've looked in the docs and searched the web and can't find any
> information on how to expand something like ~f in a macro. Is this
> possible at all?
> 
> 
> Maybe my reading comprehension is really failing as I still cannot see the
> requirement for a convoluted external script is necessary.  If so I 

I underlined it for you. But since you usually point out the usage of 
RTFM in this list, show us in the fine manual, how you would write such 
a macro.

regards,
Christian
-- 


Re: Macro to limit view to sender messages

2012-12-26 Thread Christian Brabandt
Hi Patrick!

On Mi, 26 Dez 2012, Patrick Shanahan wrote:

> > > x...@synapse.plus.com asked
> > > 
> > > I'd like to set up a macro which will set the  to all mail sent
> > > by the selected message sender.
> >  ^^^
> macro index,pager  "i~f "   ## insert mail addr at prompt 

You missed the underlined part.

regards,
Christian
-- 
Just to expand on what Ross said, it is undoubtedly too much to expect
of any distribution that it automatically detect whether or not the
person installing it can read simple English directions, and if he
can't, proceed without his input.  That way lies madness.
-- Shawn McMahon on debian-curiosa@l.d.o


Re: sidebar patch

2013-02-13 Thread Christian Brabandt
Hi Marco!

On Mi, 13 Feb 2013, Marco wrote:

> On 2013–02–12 Bob Proulx wrote:
> 
> > Some time ago I posted this following in a discussion about the Debian
> > alternatives and it includes a walkthrough of how alternatives are
> > used and configured.  I think it is still relevant.  Perhaps it will
> > help others understand how the alternatives work.
> > 
> >   http://lists.debian.org/debian-user/2002/08/msg02808.html
> 
> Is it possible to set up the alternatives on a per user base?

No. But you can use alias or symlinks or shell scripts or whatever you 
prefer.



regards,
Christian
-- 
Eight was also the Number of Bel-Shamharoth, which was why a sensible wizard
would never mention the number if he could avoid it.  Or you'll be eight
alive, apprentices were jocularly warned.  Bel-Shamharoth was especially
attracted to dabblers in magic who, by being as it were beachcombers on the
shores of the unnatural, were already half-enmeshed in his nets.
Rincewind's room number in his hall of residence had been 7a.  He hadn't
been surprised.
-- Terry Pratchett, "The Sending of Eight"


Re: pdf-files destroyed, where are archives?

2013-05-03 Thread Christian Brabandt
Hallo Ulrich!

Ulrich Lauther schrieb am Freitag, den 03. Mai 2013:

> Hi,
> 
> I cannot find archives of the mutt mailing lists. 
> On http://www.mutt.org/mail-lists.html is a link "MARC", but it does not seem 
> to work.

gmane offers an archive of the mutt lists as well:
http://news.gmane.org/gmane.mail.mutt.user

> I am trying to find an answer to this problem:
> When I send a pdf-file as an attachmend, it gets destroyed.
> Ubuntu 12.04, mutt Mutt 1.4.2.3i 

I am not sure whether the old mutt 1.4 stable release still is 
supported. You can safely use the latest released "development" version 
1.5.21 (which was released in 2010). Actually calling it "development" 
version is euphemistic, since development doesn't seem to be too active 
(no "development" release for 2.5 years)

regards,
Christian


Re: pdf-files destroyed, where are archives?

2013-05-04 Thread Christian Brabandt
Hallo Ulrich!

Ulrich Lauther schrieb am Freitag, den 03. Mai 2013:

> The reason why I went back to 1.4 was a strange behaviour of 1.5.21
> 
> mutt -f mbox tried to read all messages in mbox and called firefox for each 
> html-containing message,
> due to
>   auto_view text/html
>   and a corresponding .mailcap entry

And your corresponding .mailcap entry looks like what?

> I found now out that this behviour is triggered by my
> 
>   color index black red "~b text/calendar"
> 
> line in my .muttrc.

Shouldn't it be rather ~h text/calendar?


regards,
Christian
-- 
Did you know the University of Iowa closed down after someone stole the book?


Re: using a file selection command

2013-05-06 Thread Christian Brabandt
Hi Sebastian!

On Sa, 04 Mai 2013, Sebastian Tramp wrote:

> Hi there,
> 
> instead of using the file browser of mutt to select an attachment, I want to
> start a specific script / application which returns the file I want to attach.
> 
> more concrete: I want to select one of the most recent edited documents from
> the desktop index so I do not need to remember where the file is and to browse
> through many dir levels.
> 
> Is there a way to configure that somehow?

If you use Vim as editor you can use my CheckAttach¹² plugin, which 
supports ranger as external filebrowser and adds appropriate Attach: 
headers into your file. (you need :set edit_headers for this to work).

See the reference in the documentation³.

¹) https://github.com/chrisbra/CheckAttach
²) http://www.vim.org/scripts/script.php?script_id=2796
³) https://github.com/chrisbra/CheckAttach/blob/master/doc/CheckAttach.txt#L73

regards,
Christian


Re: OT making ascii tables

2013-05-06 Thread Christian Brabandt
Hi Jan-Herbert!

On Mo, 06 Mai 2013, Jan-Herbert Damm wrote:

> Thank you Erik,
> 
> Erik Christiansen wrote on 06.05.13:
>  
> > When you try ":set fenc ?" in vim, does it show:
> > 
> > fileencoding=utf-8
> Yes, it does and the interaction of vim and mutt is fine
> 
> here is an example:
> 
> cat renders:
> 
> OBST/GEMUESE
> ┌─┬───┬──┬┐
> │Bestnr.  │  Produkt  │  Hersteller  │  Menge │
> │16266│  Bananen  │golden│ 2KG│
> │21804│ Zwiebeln  │ xxx  │ 2KG│
> │16300│ Zitronen  │ xxx  │ 6‐8ST  │
> │18455│  Gurken   │ xxx  │ 2ST│
> │?│ weißkohl  │ 1ST  ││
> └─┴───┴──┴┘
> 
> -
> 
> vim or less:
> 
> OBST/GEMUESE
> ┌─┬───┬──┬┐
> │^[[1mBestnr.  ^[[22m│  ^[[1mProdukt  ^[[22m│  ^[[1mHersteller  ^[[22m│
> ^[[1mMenge ^[[22m│
> │16266│  Bananen  │golden│ 2KG│
> │21804│ Zwiebeln  │ xxx  │ 2KG│
> │16300│ Zitronen  │ xxx  │ 6‐8ST  │
> │18455│  Gurken   │ xxx  │ 2ST│
> │?│ weißkohl  │ 1ST  ││
> └─┴───┴──┴┘
> 
> could it be that the interaction with the terminal (gnome-terminal in my case)
> somehow has to do with this?
> 

What you are seeing are ANSI Term sequences, which are usually used to 
color text in the terminal. It might help to explicitly set the TERM 
variable to dumb or vt100 or possibly set the -c parameter. You might 
however need to pipe the input through col -b again.

regards,
Christian
-- 


Re: OT making ascii tables

2013-05-06 Thread Christian Brabandt
Hi Rado!

On Mo, 06 Mai 2013, Rado Q wrote:

> =- Christian Brabandt wrote on Mon  6.May'13 at 22:49:24 +0200 -=
> 
> > > vim or less:
> > > 
> > > OBST/GEMUESE
> > > ┌─┬───┬──┬┐
> > > │^[[1mBestnr.  ^[[22m│  ^[[1mProdukt  ^[[22m│  ^[[1mHersteller  ^[[22m│
> > > ^[[1mMenge ^[[22m│
> > 
> > What you are seeing are ANSI Term sequences, which are usually used to 
> > color text in the terminal. It might help to explicitly set the TERM 
> > variable to dumb or vt100 or possibly set the -c parameter. You might 
> > however need to pipe the input through col -b again.
> 
> 'less' has a "raw" mode to let ANSI pass through to the terminal,
> see it's help.

Yes, that is less -r or less -R. But that doesn't hold for other 
applications, like Vim (which can at least hides those characters using 
the ansi_escape plugin).

regards,
Christian
-- 
It is the nature of extreme self-lovers, as they will set an house on fire,
and it were but to roast their eggs.
-- Francis Bacon


Re: Relative timestamp ?

2013-05-08 Thread Christian Brabandt
On Wed, May 8, 2013 10:25, Max Rydahl Andersen wrote:
> Hi,
>
> Is it in any way possible to have mutt show relative time instead of just
> date for emails ?
>
> i.e. 10 min ago, Today, yesterday, 2 days ago and then dates when beyond a
> week.
>
> Similar to what thunderbird, gmail, apple mail and other mail clients do ?
>
> I looked in the various format strings I could find but couldn't find
> anything.

That should get you started:
http://www.mail-archive.com/mutt-users@mutt.org/msg43967.html

regards,
Christian



Re: Search utilities for use with mutt - I use mairix but it's not perfect

2013-05-08 Thread Christian Brabandt
On Wed, May 8, 2013 14:51, Erik Christiansen wrote:
> That's what I was trying to get away from, because (as described) it was
> very clumsy to step blindly through the helpgrep hits, using those
> commands. I have now tried your :copen suggestion with helpgrep, but
> that splits the window into 3, introducing a great deal if visual
> clutter.

I usually :copen the quickfix window. And in there you can search again,
e.g. I further refine my search pattern and simply press enter on
interesting hits to go straight to the match. This works pretty well,
especially since the vimgrep/helpgrep commands understand the full range
of VIM RE.

regards,
Christian



Re: Toggle output from gpg?

2013-07-30 Thread Christian Brabandt
Hi Óscar!

On So, 28 Jul 2013, Óscar Pereira wrote:

> Dear all,
> 
> Is there a way to toggle the output from gpg, when viewing signed
> and/or encrypted messages? In particular, I'm referring to the
> information about the key(s), which can be quite verbose...
> 
> Could this be done with some scripting (i.e. without hacking the
> source code?)

look into the display_filter setting and possibly also t-prot 
(http://www.escape.de/~tolot/mutt/) which can be used as display filter 
for mutt and I think, it does some gpg cleaning (I am not sure, it's too 
long ago, that I used it).


regards,
Christian
-- 
Absolutum obsoletum.  (If it works, it's out of date.)
-- Stafford Beer


Re: mutt segmentation fault and mutt.core dump file

2013-08-12 Thread Christian Brabandt
Hi James!

On Mo, 12 Aug 2013, James Griffin wrote:

> Hi, 
> 
> Same crash happened this morning. Just a few minutes ago actually. Not
> sure what the problem is. 
> 
> gdb output:
> 
> NU gdb 6.3
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "amd64-unknown-openbsd5.4"...(no debugging
> symbols found)
> 
> Core was generated by `mutt'.
> Program terminated with signal 11, Segmentation fault.
> (no debugging symbols found)
> Loaded symbols for /usr/local/bin/mutt
> Reading symbols from /usr/lib/libncurses.so.12.1...done.
> Loaded symbols for /usr/lib/libncurses.so.12.1
> Reading symbols from /usr/lib/libgssapi.so.6.0...done.
> Loaded symbols for /usr/lib/libgssapi.so.6.0
> Reading symbols from /usr/lib/libkrb5.so.19.0...done.
> Loaded symbols for /usr/lib/libkrb5.so.19.0
> Reading symbols from /usr/lib/libasn1.so.19.0...done.
> Loaded symbols for /usr/lib/libasn1.so.19.0
> Reading symbols from /usr/lib/libcrypto.so.22.0...done.
> Loaded symbols for /usr/lib/libcrypto.so.22.0
> Reading symbols from /usr/lib/libwind.so.0.0...done.
> Loaded symbols for /usr/lib/libwind.so.0.0
> Reading symbols from /usr/lib/libroken.so.0.0...done.
> Loaded symbols for /usr/lib/libroken.so.0.0
> Reading symbols from /usr/lib/libcom_err.so.19.0...done.
> Loaded symbols for /usr/lib/libcom_err.so.19.0
> Reading symbols from /usr/lib/libheimbase.so.0.0...done.
> Loaded symbols for /usr/lib/libheimbase.so.0.0
> Reading symbols from /usr/lib/libssl.so.19.0...done.
> Loaded symbols for /usr/lib/libssl.so.19.0
> Reading symbols from /usr/lib/libz.so.4.1...done.
> Loaded symbols for /usr/lib/libz.so.4.1
> Reading symbols from /usr/local/lib/libqdbm.so.14.14...done.
> Loaded symbols for /usr/local/lib/libqdbm.so.14.14
> Reading symbols from /usr/local/lib/libintl.so.6.0...done.
> Loaded symbols for /usr/local/lib/libintl.so.6.0
> Reading symbols from /usr/local/lib/libiconv.so.6.0...done.
> Loaded symbols for /usr/local/lib/libiconv.so.6.0
> Reading symbols from /usr/lib/libc.so.69.0...done.
> Loaded symbols for /usr/lib/libc.so.69.0
> Reading symbols from /usr/libexec/ld.so...done.
> Loaded symbols for /usr/libexec/ld.so
> #0  strcmp (s1=0x1f2e55b5a60 "9", s2=0x1f2e70199f0  out of bounds>) at /usr/src/lib/libc/string/strcmp.c:47
> 47  /usr/src/lib/libc/string/strcmp.c: No such file or directory.
> in /usr/src/lib/libc/string/strcmp.c
> (gdb) bt
> #0  strcmp (s1=0x1f2e55b5a60 "9", s2=0x1f2e70199f0  out of bounds>) at /usr/src/lib/libc/string/strcmp.c:47
> #1  0x01f0da6423d5 in index_make_entry () from /usr/local/bin/mutt
> #2  0x01f0da6509f9 in mutt_parse_hook () from /usr/local/bin/mutt
> #3  0x01f0da62d473 in index_color () from /usr/local/bin/mutt
> #4  0x01f0da648f00 in mutt_parse_hook () from /usr/local/bin/mutt
> #5  0x01f0da616ab1 in ?? () from /usr/local/bin/mutt
> #6  0x0004 in ?? ()
> #7  0x7f7e8af0 in ?? ()
> #8  0x7f7e8b04 in ?? ()
> #9  0x7f7e8b07 in ?? ()
> #10 0x7f7e8b0a in ?? ()
> #11 0x in ?? ()

Try to get a debug built of mutt. backtraces are a lot more useful then. 
The call to mutt_parse_hook and index_color() however suggests it's 
caused by a hook changing your color definition.

regards,
Christian
-- 
Q: How can I choose what groups to post in?  ...
Q: How about an example?

A: Ok.  Let's say you want to report that Gretzky has been traded from the
Oilers to the Kings.  Now right away you might think rec.sport.hockey
would be enough.  WRONG.  Many more people might be interested.  This is a
big trade!  Since it's a NEWS article, it belongs in the news.* hierarchy
as well.  If you are a news admin, or there is one on your machine, try
news.admin.  If not, use news.misc.

The Oilers are probably interested in geology, so try sci.physics.  He is
a big star, so post to sci.astro, and sci.space because they are also
interested in stars.  Next, his name is Polish sounding.  So post to
soc.culture.polish.  But that group doesn't exist, so cross-post to
news.groups suggesting it should be created.  With this many groups of
interest, your article will be quite bizarre, so post to talk.bizarre as
well.  (And post to comp.std.mumps, since they hardly get any articles
there, and a "comp" group will propagate your article further.)

You may also find it is more fun to post the article once in each group.
If you list all the newsgroups in the same article, some newsreaders will
only show the the article to the reader once!  Don't tolerate this.
-- Brad Templeton, _Emily Postnews Answers Your Questions on 
Netiquette_


Re: Encrypting postponed messages

2013-09-07 Thread Christian Brabandt
Hi Erik!

On Sa, 07 Sep 2013, Erik Christiansen wrote:

> 
> No, the "logic" which you have constructed there in unconvincing, due to
> being erroneous.
> 
> We use an editor to create the text for an email, so it needs to read
> and write the encrypted postponed file - mutt is not involved, beyond
> finding the file for the editor. On the other hand, we use mutt to read
> received emails - no editor is involved normally. So your postulate is
> false, due to there being no connection between the two processes.
> 
> What you have seem to have missed is that the editor is not encrypting
> the email for transmission. Mutt still does that. To this end, it is
> necessary for the user to save the file unencrypted to the tmp file for
> transmission, since encryption for transmission is mutt's job. (A finger
> fumble here would send a doubly encrypted email, just as would happen if
> the (encrypted) postponed file were attached by mutt without the
> involvement of an editor.)
> 
> It might be convenient to add a pair of mappings to .vimrc, to more
> fluently deal with postponing and posting, respectively.

You are being serious here? mutt spawns the editor with some template 
file that is lying around in some tmp/ folder. After you have finished 
writing the file and quit the editor, mutt reads that temporary file 
(probably also unlinks it already) and asks you what to do with it (e.g. 
postpone, send, etc.) At that dialog, you can also chose whether to 
encrypt the mail or not (sign/encrypt+sign,etc). And if you decide to 
encrypt the mail, it is mutt's responsibility to do so (which it should 
possibly also do, when the mail will be postponed). I don't see, how 
your editor comes to mind here, especially, since your editor doesn't 
even know where to save postponed mails.

> > Mutt's job is to handle emails,

Exactly

> No. Just because mutt encrypts for transmission does not obligate it to
> encrypt other files which might or might not later be transmitted.
> This is where you are conflating two separate tasks.

Yes it does, since mutt manages a mail store. Just because the mail ends 
up saved locally, doesn't mean it always will and only mutt knows, 
whether the mail will be send or postponed or moved to trash or similar.

> > I speak from a user's perspective, but doing as you suggest strikes me
> > as a very bad design decision. But again, I speak as a user, so I
> > might be wrong...
> 
> Lack of understanding is resulting in a flawed perspective, I submit.

It seems to me, you lack some understanding here ;)

regards,
Christian
-- 
A novice asked the master: "I perceive that one computer company is
much larger than all others.  It towers above its competition like a giant
among dwarfs.  Any one of its divisions could comprise an entire business.
Why is this so?"
The master replied, "Why do you ask such foolish questions?  That
company is large because it is so large.  If it only made hardware, nobody
would buy it.  If it only maintained systems, people would treat it like a
servant.  But because it combines all of these things, people think it one
of the gods!  By not seeking to strive, it conquers without effort."
-- Geoffrey James, "The Tao of Programming"


Re: Encrypting postponed messages

2013-09-08 Thread Christian Brabandt
Hi Erik!

On So, 08 Sep 2013, Erik Christiansen wrote:

> On 07.09.13 14:40, Christian Brabandt wrote:
> > > No. Just because mutt encrypts for transmission does not obligate it to
> > > encrypt other files which might or might not later be transmitted.
> > > This is where you are conflating two separate tasks.
> > 
> > Yes it does, since mutt manages a mail store. Just because the mail ends 
> > up saved locally, doesn't mean it always will and only mutt knows, 
> > whether the mail will be send or postponed or moved to trash or similar.
> 
> As described above, and in other posts on this thread, I'm only
> suggesting that vim provide encryption of drafts, leaving mutt to do all
> that it can, including making it entirely unnecessary for the editor to
> know the location of the tmp file, no matter where it is. (I hope that
> red herring is dead now.) Mutt's post/postpone dialog remains, but when
> using an editor for non-integrated draft encryption, we need to _also_
> communicate that decision before leaving the editor, because mutt can't
> do the job afterwards.
> 
> OK, mutt is demonstrably not obligated to edit drafts, and it cannot
> currently encrypt them, but at least one editor can. Giving mutt the
> ability would be easier to drive, so must be a better long term solution.
> If mutt is now deemed to be obligated to do it, then it will doubtless
> happen soon.

Vim certainly could and Emacs probably can encrypt. But what about Nano, 
pico, mcedit, gedit, kate? Therefore, I think, it is still mutt's 
responsibility to encrypt the file.

regards,
Christian
-- 
Life is a yo-yo, and mankind ties knots in the string.


Re: Encrypting postponed messages

2013-09-09 Thread Christian Brabandt

On Mo, 09 Sep 2013, David Champion wrote:

> I confess I haven't dug my way through the entire debate on this, but so
> far I've seen argument along lines of: is it a necessary feature? if it
> is necessary, is it necessary to be supported in mutt per se, or can it
> be done externally?
> 
> I haven't seen any discussion of what use models it would harm to
> support this in mutt.  Does anyone have an argument against?
> 
> Lacking that, I would say that if someone submits a good patch it should
> be considered.  To me it's a good enhancement request.

I know almost nothing about the mutt code base, but I figured, it would 
be better to start working with the code, then continue this discussion. 

So here is a basic patch, that seems to work for me. I hope this will be 
more valuable than to continue with  this endless discussion.

regards,
Christian
-- 
The bureaucracy is expanding to meet the needs of an expanding bureaucracy.
--- send.c	2010-09-13 19:19:55.0 +0200
+++ send.c.new	2013-09-09 22:25:49.177397477 +0200
@@ -1543,6 +1543,23 @@
   if (msg->content->next)
 	msg->content = mutt_make_multipart (msg->content);
 
+  if (WithCrypto)
+  {
+	if (msg->security)  
+	{
+	  if ((crypt_get_keys (msg, &pgpkeylist) == -1) ||
+	  mutt_protect (msg, pgpkeylist) == -1)
+	   {
+	msg->content = mutt_remove_multipart (msg->content);
+	
+	FREE (&pgpkeylist);
+	
+	decode_descriptions (msg->content);
+	goto main_loop;
+	  }
+	}
+  }
+
   /*
* make sure the message is written to the right part of a maildir 
* postponed folder.


Re: message "could not copy" upon opening message

2013-10-05 Thread Christian Brabandt

On Sa, 05 Okt 2013, Rejo Zenger wrote:

> I have  as a message in my mailbox.  
> When I attempt to open the message (by hitting enter after selecting), 
> I'll get the error "Could not open message" in return and I am left in 
> the mailbox overview. 
> 
> When running with -d5 I get:
> 
>   [...]
>   pgp.c:520: mutt_mktemp returns "/tmp/mutt-ix-501-8083-2".
>   Checking mailcap file: /Users/rejo/.mailcap
>   mailcap entry: text/html;   elinks -dump %s ; 
>   copiousoutput
>   field: copiousoutput
>   handler.c:1589: mutt_mktemp returns "/tmp/mutt-ix-501-8083-3".
>   Checking mailcap file: /Users/rejo/.mailcap
>   mailcap entry: text/html;   elinks -dump %s ; 
>   copiousoutput
>   field: copiousoutput
>   pgp.c:520: mutt_mktemp returns "/tmp/mutt-ix-501-8083-4".
>   commands.c:111: mutt_mktemp returns "/tmp/mutt-ix-501-8083-5".
>   WEED is Set
>   Reorder: x = 0; hdr_count = 1
>   Reorder: x = 0; hdr_count = 1
>   Reorder: x = 0; hdr_count = 1
>   Reorder: x = 0; hdr_count = 1
>   Reorder: x = 0; hdr_count = 1
>   Reorder: x = 0; hdr_count = 1
>   handler.c:1589: mutt_mktemp returns "/tmp/mutt-ix-501-8083-6".
>   Could not copy message
>   mutt_index_menu[613]: Got op 145
> 
> Any clues as to why?


This is just a guess, but do you have enough space left on the device 
where /tmp is mounted?


regards,
Christian
-- 
Do more than anyone expects, and pretty soon everyone will expect more.


Re: fetching mails to a local folder

2013-12-19 Thread Christian Brabandt
On Thu, December 19, 2013 09:07, Cameron Simpson wrote:
> On 18Dec2013 20:46, Chris Down  wrote:
>> On 2013-12-18 13:38:27 +0100, Matthias Apitz wrote:
>> > Is there some config example about how to fetch with fetchmail or
>> mutt,
>> > some mails (2000) from my IMAP server to a local mbox, but without
>> using
>> > a local MTA, as fetchmail normaly does? Or is this even possible with
>> > mutt itself (ofc with marking 2000 mails and after this storing them
>> to
>> > a local folder);
>>
>> If I understood you correctly, take a look at offlineimap[0],
>> mailsync[1], or isync[2] (disclaimer: I have not used any except for
>> offlineimap, and that was a long time ago).
>>
>> 0: http://offlineimap.org/
>> 1: http://mailsync.sourceforge.net/
>> 2: http://isync.sourceforge.net/
>
> Or, you could just use mutt as he asked.
>
> Invoke mutt pointed at the IMAP server and push the required keystrokes
> to tag every message and then save tagged messages to a local folder.
>
> Easy peasey.
>
> To help you on your way, here is my mutt invocation from my "mboxify"
> script which packs up a Maildir folder into an mbox folder (I use
> it for archiving active folders):
>
>   mutt -n -F /dev/null -f "$mailbox" -e "set sort=mailbox-order; set
> confirmappend=no; set delete=yes; push
> '.$mailboxtmp'"
>
> For your purposes you would set $mailbox to the IMAP server and
> $mailboxtmp to the local folder (full file pathname to a local
> folder, to be unambiguous).
>
> Adapt to suit. Feel free to ask questions.

I use a slight variation, for converting mailboxes using a custom
.muttrc file. I have documented in German in an old blog entry here:

http://blog.256bit.org/archives/345-Mutt-als-Mailbox-Konvertierer.html

Best,
Christian



Re: "Filter messages like this" feature?

2014-02-12 Thread Christian Brabandt
Hi Peter!

On Mi, 12 Feb 2014, Peter Davis wrote:

> I'm thinking of implementing a feature which allows a given keystroke
> to pipe a message to a perl script which, after a couple of prompts,
> adds a rule to my procmailrc or blacklist file to remove all future
> occurrences of such messages. The script would probably just ask me
> what part of the message to filter on (sender, subject keywords, etc.)
> and then add the rule(s).
> 
> Has anyone already done this?
> 
> I use mutt on my local MH store, but also on an IMAP server. Any ideas
> how to do this for IMAP? 

Years ago I've written a simple shell script, that uses the score 
functionality of mutt to ignore or filter unwanted messages from 
different mailinglist. I added a macro, that will pipe the current 
message to that shell script and generated a score statement that could 
be read back by mutt. It can easily be improved by filtering for 
subjects or whatever you like.

I don't use it anymore, but I still have it laying around. Here is the 
relevant config:


,[ ~/.mutt/macros.conf ]-
| # This macros calls an external shell script that will generate a
| # scoring value for the author of a message which in turn can be fed to
| # mutt 
| # Depending on the Options given to the script, mutt will set mails
| # from that author read, or delete them or reset it
| 
| macro index,pager s "set wait_key=no\
| ~/bin/mutt_score.sh a \
| source ~/.mutt/score\
| set wait_key=yes" "Score author of message 
interactively"
| 
| macro index,pager i "set wait_key=no\
| ~/bin/mutt_score.sh i \
| source ~/.mutt/score\
| set wait_key=yes" "Ignore future messages of author"
| 
| macro index,pager d "set wait_key=no\
| ~/bin/mutt_score.sh d \
| source ~/.mutt/score\
| set wait_key=yes" "Delete future messages of author"
| 
| macro index,pager r "set wait_key=no\
| ~/bin/mutt_score.sh r \
| source ~/.mutt/score\
| set wait_key=yes" "Reset scoring for author"
`


,[ ~/bin/mutt_score.sh ]-
| #!/bin/bash --
| 
| # in which file to store the score_config
| CFG="/home/chrisbra/.mutt/score_gen"
| 
| # contains the message in a variable
| STDIN="`cat`"
| 
| #FROM=`echo ${STDIN}|formail -zx "From" |~/mimedecode |sed -e 's/,.*$//' 
|tail -1`
| #FROM=`echo $STDIN`|formail -zx "To:" 
| #while read line; do 
| #echo $line|formail -zx"To:" |~/mimedecode|sed -e 's/,.*$//'
| #done
| 
| # The sed statement will cut out only the relevant part from
| # the e-mail address between (e.g. for "Foo"  it
| # will only print foo\.bar@foobar\.xyz) and will also translate
| # allowed characters like "." or "+" by escaping them
| FROM=`echo "${STDIN}"|formail -tzx "From:" | sed 
's/.*//;s/\./&/g;s/+/&/g'`
| 
| # Record the date
| DATE=`date +%d.%m.%Y`
| 
| function ignore(){
| MODE="score '~f \""$FROM"\"'\t=1\t # mark msg as read (score set on ${DATE})"
| echo -e "$MODE" >>"$CFG"
| }
| function delete(){
| MODE="score '~f \""$FROM"\"'\t=0\t # mark msg as deleted (score set on 
${DATE})"
| echo -e "$MODE" >>"$CFG"
| }
| 
| function interactive(){
| clear
| echo "What would you like to do with the author of the provided message?"
| echo "i)gnore messages from author"
| echo "d)elete messages from author"
| echo "u)ndo scoring messages from author"
| echo "q)quit"
| read input 

Re: delete only undeleted messages?

2014-02-26 Thread Christian Brabandt
On Mi, 26 Feb 2014, Peter P. wrote:

> * Patrick Shanahan  [2014-02-26 17:23]:
> > * Peter P.  [02-26-14 10:48]:
> > > Hi!
> > > 
> > > I have noticed that I can delete ("save to trash folder") the same
> > > message over and over again using, 
> > > 
> > > folder-hook . 'macro index d "=Trash \r"
> > > folder-hook . 'macro pager d "=Trash \r"
> > > 
> > > even after it has been marked as deleted. I end up with mutiple
> > > accidental copies in the trash this way. Is there a way to
> > > incoorporate the status/flag of a message as conditional for the above
> > > key binding to only allow saving to trash if the message is not marked
> > > as 'deleted'?
> > 
> > You need "sync-mailbox" after the save_to_tash.  As long as you remain in
> > the same mailbox, destructive actions aside from editing are not applied
> > until you close, move to another, or sync the mailbox.
> 
> Thank you for the reply Patrick, I would prefer to not sync/expunge   
> the mailbox after every "copy to trash" key shortcut.
> Perhaps there is a way to make key commands aware of a message's flag 
> instead.

I see three possibilities.

- Instead of deleting the actual messages you tag them and on a key 
  press, you move all tagged, not-deleted messages to your Archive/Trash 
  folder. Something like this (untested):
  
   macro index,pager d 
!~D~T=Trash~A
 'Delete messages'

- Add an folder hook, to delete duplicate messages (something like 
  this):
   folder-hook =Trash 'push 
~A~=~A'

- Use the trash folder patch, that is floating around and even provided 
  in some distributions like Debians mutt-patched, IIRC
   

Best,
Christian
-- 
If it weren't for the last minute, nothing would ever get done.


Re: Correct syntax of send hook

2014-05-08 Thread Christian Brabandt
Hi Guy!

On Do, 08 Mai 2014, Guy Gold wrote:

> Greetings List. 
> 
> I'm trying to add this command:
> 
> vim -c ':r !cat /tmp/file' to be used in a send hook :
> 
> send-hook ~t...@domain.com set editor= "vim ':r !cat /tmp/bla'"
> 
> The contents of /tmp/file should then be 'cat > ' into the new
> email. 
> While the above works fine from the main declaration in
> my muttrc (set editor=)_, I can't seem to hit it with the right
> syntax in the send hook. Your help is appreciated. 

I am surprised, this works for your normal editor command. From my 
understanding, Vim should try to open 2 files, namely ':r !cat /tmp/bla' 
and the /tmp/mutt-... (which is your actual mail template.

To make this work, you should at least add the -c command to vim, to 
make sure, you want the argument be interpreted as a command to execute 
on startup.

regards,
Christian
-- 
I'm a soldier, not a diplomat.  I can only tell the truth.
-- Kirk, "Errand of Mercy", stardate 3198.9


Re: Thread colors

2014-09-07 Thread Christian Brabandt
Hi Michael!

On So, 07 Sep 2014, Michael Treibton wrote:

> I'm trying to see if it's possible to color threads in a certain way.
> At the moment I have this in my .muttrc:
> 
> color index green default "~v"
> 
> Which very nicely makes the *top*-level email in a given thread green.
> 
> however, is it possible to get mutt to also assign a color to the
> other emails in that thread somehow?  Might it also be possible to
> give the top-level thread a different color to the other emails in
> that thread?

Since ~v only works for collapsed threads, I would go with something 
different, e.g. check for the existence of In-Reply-To or References 
header:

:color index green default "!(~h In-Reply-To:|~h References)"  # first mail of 
a thread
:color index blue default "(~h In-Reply-To:|~h References)"# Mails within a 
thread

Note, however, that this might slow down loading a mailbox considerably 
(especially, if you use IMAP, because mutt then has to fetch more data 
from the IMAP server. This doesn't seem to matter for the References and 
In-Reply-To headers, according to the documentation, but is something 
one wants to keep in mind, before making a decision on what header to 
color)

> I'm trying to make things easier on the eye in terms of threading, and
> am trying to use colors to do it.
> 
> i wonder if it's possible to also assign random/different colors to
> each thread in mutt?  that'd be cool.

I don't think this is possible, currently.

regards,
Christian
-- 
The Second Law of Thermodynamics:
If you think things are in a mess now, just wait!
-- Jim Warner


Re: Vim config for mutt [Was: SOLVED, mutt/vim line wrap configuration]

2014-11-21 Thread Christian Brabandt
Hi Erik!

On Fr, 21 Nov 2014, Erik Christiansen wrote:

> On 20.11.14 14:09, Will Fiveash wrote:
> > If you are using vim you may want to add vim settings specific to
> > editing mail from within mutt to a file like
> > ~/.vim/ftplugin/mail/mail-settings.vim.  vim will assign by default
> > the filetype "mail" to mutt editor files and look for plugins in
> > ~/.vim/ftplugin/mail.  If you do this then you can just set editor=vim
> > in your .muttrc.  For more see ":help ftplugins" in a running vim
> > session.
> 
> That is a good idea. If it seems simpler to just add a line in .vimrc,
> on the other hand, then an autocommand can also do such jobs, as in this
> one which automates the "[Was: ... ]" editing of a subject line update,
> as above:
> 
> au BufNewFile,BufRead   ~/Desktop/mutt-*   noremap  
> ^[gg/Re:^Mce[Was^[A]^[0Wi

I wouldn't use autocommands. Vim does already perfectly recognize mutt 
mails when you have set :filetype plugin on. So simply place all of your 
mutt config into a directory ~/.vim/ftplugin/mail/ 

That is how I do it. For some configuration files look here:
http://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html

> Again, "^[" is "Control-V Escape", and "^M" is Control-V Enter".
> And mutt defaults to composing in /tmp, not ~/Desktop, unless .muttrc
> has something like this, to avoid losing the composition on a wipe of
> /tmp on reboot:

For the sake of readability you should use the normal key notation (:h 
key-notation)

Best,
Christian
-- 
Langsam's Laws:
(1) Everything depends.
(2) Nothing is always.
(3) Everything is sometimes.


Re: character set issues

2015-01-07 Thread Christian Brabandt

Am 2015-01-07 14:34, schrieb J. A. Landamore:
I have mutt 1.5.21 installed on Ubuntu from the packages and it is 
mostly
fine. It doesn't, however, connect to one of my mail providers because 
it

is linked against TLS and not SSL.

When I compile from source and link against SSL that problem is 
corrected

but now I get an issue when displaying the index pages.

Threads are displayed as

M-b~T~\M-b~T~@>
M-b~T~\=>

rather than {whitespace}> or {whitespace}=>

Given they display correctly in the packaged mutt and as far as I can 
tell

the configure options are the same it must be something in my build
environment.  Can anyone provide me with a pointer please?


It's a while, since I compiled mutt myself, but IIRC,
mutt probably linked against libncurses5-dev, but you need the wide 
support.

Installing the libncursesw5-dev package should fix that. The configure
script than builds against the correct ncurses library.


Best,
Christian


Re: Encrypting postponed messages

2015-01-08 Thread Christian Brabandt

Am 2015-01-07 23:57, schrieb Kevin J. McCarthy:

Óscar Pereira wrote:

The subject seems pretty self-explanatory. Use case, you're writing
an email, which is already marked as to be sent encrypted, but you
have to postpone it. In the meantime offlineimap runs and syncs you
mailboxes, and thus your mail which is to be sent encrypted ends up
in (say) Gmail's remote folder -- UNencrypted.

Googling yielded only a question with no answer [1]. The only
work-around I have to this is to disabled sync'ing the drafts folder
altogether. Is there another way?


Sorry to resurrect an old (and somewhat heated) thread, but I'd like
some feedback on the interface for a patch I'd like to push (attached,
or see ticket #3665).  The patch was based off the one submitted by
Christian Brabandt, so thank you Christian!


Your welcome. I was interested in that functionality and thought
I contribute.


The patch adds two options: postpone_encrypt (boolean) and
postpone_encrypt_as (string).

If postpone_encrypt is set, and the message has the encryption
flag set, mutt will encrypt the message using the key specified in
postpone_encrypt_as.  Currently, the interface is as simple as that.


Personally, I think that is enough and I wouldn't make it more
complicated.


I'm wondering if that is sufficient for people interested in the patch,
or whether a quadoption for postpone_encrypt would be more useful.  For
a quadoption, I would keep the behaviour the same: the quadoption would
only be consulted if the message encryption flag was set.

Would it be useful to be able to encrypt, even if the message
encryption
flag is not set?  If so, I could use some opinions, because defining
the
interface for that starts to get complicated.


I think, if you are going the quadoption way, it should be consulted
every time and not only when the message encryption flag is set.

Best,
Christian


Re: mutt and archivemail

2015-02-19 Thread Christian Brabandt
Hi Philippe!

On Do, 19 Feb 2015, Philippe Delavalade wrote:

> Hi.
> 
> I use archivemail which produces, for instance, inbox_archive.gz.
> 
> When issuing the command
> 
> mutt -f inbox_archive.gz
> 
> I have an error message because it is not a mailbox.
> 
> Previously, before my migration from debian to slackware, this worked
> fine ; I can't find what to configure so that it works. Maybe it's not a
> mutt problem but...

Debians mutt includes several patches. For this feature you need the 
compressed-folder patch 

https://sources.debian.net/src/mutt/1.5.23-3/debian/patches/features/compressed-folders.patch/
http://www.spinnaker.de/mutt/compressed/

regards,
Christian
-- 
Life is like an onion: you peel off layer after layer and then you find
there is nothing in it.
-- James Huneker


Re: Illegal address syntax

2015-03-10 Thread Christian Brabandt
Hi Silvio!

On Di, 10 Mär 2015, Silvio Siefke wrote:

> Hello,
> 
> i try to run mutt with my own mailserver, running postfix with dovecot. 
> The imap work without problems, but smtp want not work. With sylpheed 
> it works fine. 
> 
> The log:
> Mar 10 19:02:06 postfix/smtpd[740]: warning: Illegal address syntax 
> from unknown[46.114.180.53] in MAIL command: 
> 
> muttrc
> # smtp
> set realname='Silvio Siefke'
> set smtp_url=smtp://webmas...@silviosiefke.com@mail.silviosiefke.com:587/
> set smtp_pass="mypassword" #change to imnaging
> set send_charset="utf-8"
> set signature="/home/siefke/.signature"
> set editor="nano"
> 
> In Google i found so that it should work, try with 
> webmaster:silviosiefke.com@...
> but all end with syntax errors or authenticate errors which normal when search
> in wrong file. 
> 
> Mar 10 18:58:17 dovecot: auth: Error: passwd-file(webmaster,46.114.180.53): 
> stat(/var/vmail/auth.d//passwd) failed: No such file or directory
> 
> Has someone idea?

Check your 'use_from' and 'from' settings. It might also be a wrong 
defined send-hook that uses my_hdr From: incorrectly.

regards,
Christian
-- 
You are the only person to ever get this message.


Re: Some desired features, do they exist?

2015-05-12 Thread Christian Brabandt
Hi Ian!

On So, 10 Mai 2015, Ian Zimmerman wrote:

> 2. Mailman managed lists (and maybe others) insert the annoying [Foo-List]
> tags in the Subject header.  Other MUAs allow one to massage the Subject
> header (for display only) so as to hide the tag, and (again) save screen
> space.  Is this possible with mutt?  Should it be?

For the index view, you can achieve this with a custom index_format like 
this:

set index_format="mutt_index.sh '%s' |"

where mutt_index.sh looks like this:

#v+
~$ cat mutt_index.sh
#!/bin/sh

default='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?)'
subject="$(echo "$1" | sed -e 's/\[[^]]*\] *//')"

printf "%s%s%%\n" "$default $subject"
~$ 
#v-

Note, the trailing '%' sign, this makes sure, mutt will resolve the 
returned '%' expandos from the returned string.

For the display view, a display_filter setting should achieve this. I 
think, t-prot http://www.escape.de/~tolot/mutt/ does this among others.

Or you could simply use another sed script as $display_filter command 
and filter those tags from the subject line.


regards,
Christian
-- 
Lensmen eat Jedi for breakfast.


Re: Sent attached doc from Libreoffice

2015-05-28 Thread Christian Brabandt

Am 2015-05-27 20:23, schrieb Matthias Apitz:
El día Wednesday, May 27, 2015 a las 07:57:29PM +0200, Matthias Apitz 
escribió:


El día Wednesday, May 27, 2015 a las 12:35:18PM -0400, Patrick 
Shanahan escribió:


> > I just used group-reply with the MUA 'dekko' on Ubuntu phone. May be
> > your header have been set wrong not directing this to the list only.
>
> NOT my headers ???  "group-reply" replys to all posters, not the list
> only.  You need "list-reply"

I see now in your header:

   From: Patrick Shanahan 
   To: mutt-users@mutt.org
   Subject: Re: Sent attached doc from Libreoffice
   Message-ID: <20150527163518.gp4...@wahoo.no-ip.org>
   Mail-Followup-To: mutt-users@mutt.org

 ^

I played around with your message (saved to a temp. mbox file) and if I
delete the Mail-Followup-To: line, a group-reply would go to the list
and to you;

who inserted this header and with which purpose? and, as I said, the
other mail was sent from an Ubuntu phone with the MUA Dekko; I can not
check anymre if your mail have had this line too or if Dekko was just
ignoring it.


This is done by mutt, if you have subscribed to the list, IIRC. There
are also a couple of configuration variables, that control this 
behaviour

(honor_followup_to, followup_to)

This should be explained in the manual:
http://www.mutt.org/doc/devel/manual.html#lists

Best,
Christian


Re: In index_format, what does %? mean?

2015-06-18 Thread Christian Brabandt

Am 2015-06-18 12:23, schrieb Alan Mackenzie:

Hello, mutt.

I'm using mutt 1.5.23.

The default value of the configuration variable index_format is

"%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s".

My personal value is similar.  The construct "(%?l?%4l&%4c?)" puzzles
me.  The parentheses are literal characters, but what do all the ?s
mean?  In practice, this displays the number of lines in the email, 
what

one would expect from a simple %l.  I also have the feeling that the &
is not a literal character either.  What does it mean?

I've looked in the manual, at the section documenting index_format, but
the ?s aren't explained there.  I've also checked the printf(3) man
page, but there isn't a single ? in it.

Elucidation would be much appreciated.  Thanks!


This is described briefly in the manual below status_format:


You can also switch between two strings using the following construct:

%??&?

If the value of sequence_char is non-zero, if_string will be expanded, 
otherwise else_string will be expanded.



Best,
Christian


Re: amount of displayed characters of sender name in index view

2015-07-29 Thread Christian Brabandt
Hi Peter!

On Mi, 29 Jul 2015, Peter P. wrote:

> Hi list,
> 
> is there a way to tell mutt to show me more of the sender name in index
> view? Currently it seems to be 15 characters regardless of the
> (x)terminal dimensions.

See the $index_format setting in the manual.

regards,
Christian
-- 
Try `stty 0' -- it works much better.


Re: Fwd: broken strings compiled-in into mutt

2015-08-05 Thread Christian Brabandt

Matthias Apitz schrieb am Mittwoch, den 05. August 2015:

> I digged into this and the reason is in the source tree of mutt itself.
> 
> The option (...) strings get punched into a file conststrings.c and if you 
> build mutt
> with 'make' it gives an error due to a gmake'ish construct in the Makefile /
> Makefile.in:
> 
> # make conststrings.c 
> cc -I/usr/local/include -o txt2c 
> cc: error: no input files
> *** Error code 1 (ignored)
> (  cc -I/usr/local/include -v ||  cc -I/usr/local/include --version ||
> cc -I/usr/local/include -V ||  echo "unknown compiler";  ) 2>&1 |
> ./txt2c.sh cc_version >conststrings_c
> echo "-pipe   -DLIBICONV_PLUG -g -fno-strict-aliasing" | ./txt2c.sh
> cc_cflags >>conststrings_c
> grep ac_cs_config= config.status |  cut -d= -f2- |  sed -e 's/^"//' -e
> 's/"$//' | ./txt2c.sh configure_options >>conststrings_c
> mv -f conststrings_c conststrings.c
> 
> i.e. because it can not build txt2c from txt2c.c it falles back to use
> some shell script txt2c.sh; this, in turn, has another error: it
> contains a sed pipeline and among others it does (here as an example
> with some string):
> 
> $ echo "FreeBSD is the better system" | sed -e 's/\t/\\t/'g -e 's/\r/\\r/g'
> F\reeBSD is \the be\t\te\r sys\tem
> 
> The workaround is to make mutt with gmake (the default on Linux);
> 
> The bugs should be fixed im mutt, ofc.

Yeah, the sed script is not portable. Better to replace it by perl 
(patch attached)

regards,
Christian
diff --git a/txt2c.sh b/txt2c.sh
--- a/txt2c.sh
+++ b/txt2c.sh
@@ -10,15 +10,14 @@ txt2c_fallback () {
 	# or odd-looking sequences.  The result is a sequence of quote-bounded
 	# C strings, which the compiler concatenates into a single C string.
 	tr -c '\011\012\015\040[!-~]' '?' |
-	sed \
-	-e 's/\\//g' \
-	-e 's/"/\\"/g' \
-	-e 's/??/\?\?/g' \
-	-e 's/\t/\\t/'g \
-	-e 's/\r/\\r/g' \
-	-e 's/^/	"/g' \
-	-e 's/$/\\n"/g'
-	echo ";"
+	perl -p \
+	-e 's/\\//g;' \
+	-e 's/\t/\\t/g;' \
+	-e 's/\r/\\r/g;' \
+	-e 's/"/\\"/g;' \
+	-e 's/^/	\"/g;' \
+	-e 's/$/\\n\"/;'
+	echo "; /* generated by txt2c.sh */"
 }
 
 ./txt2c test /dev/null 2>&1 &&


Re: format=flowed

2015-09-18 Thread Christian Brabandt

On Fr, 18 Sep 2015, Erik Christiansen wrote:

> So, in .vimrc, something vaguely like:
> 
> au BufNewFile,BufRead   ~/Desktop/mutt-*   call Set_for_mutt()
[...]

You don't need that autocommand. Simply create a file 
~/.vim/ftplugin/mail.vim and put all mutt related stuff there and
add an entry :filetype plugin  to your .vimrc

Keeps your .vimrc cleaner.

regards,
Christian
-- 


Re: format=flowed

2015-09-18 Thread Christian Brabandt
Hi Erik!

On Fr, 18 Sep 2015, Erik Christiansen wrote:

> On 18.09.15 09:47, Christian Brabandt wrote:
> > 
> > On Fr, 18 Sep 2015, Erik Christiansen wrote:
> > 
> > > So, in .vimrc, something vaguely like:
> > > 
> > > au BufNewFile,BufRead   ~/Desktop/mutt-*   call Set_for_mutt()
> > [...]
> > 
> > You don't need that autocommand. Simply create a file 
> > ~/.vim/ftplugin/mail.vim and put all mutt related stuff there and
> > add an entry :filetype plugin  to your .vimrc
> 
> Thanks Christian, for the alternative implementation, but I don't need
> ~/.vim/ftplugin/mail.vim when I can equally easily do it in .vimrc.

I guess taste matters. I used to think the same, until my vimrc grew too 
long and complex. Then I started to use folding but even then it started 
to get confusing eventually. So I am now using the proposed Vim way.

If I need to configure my mail configuration, I have everything in my 
folder ~/.vim/ftplugin/mail/
Python? ~/.vim/ftplugin/python.vim
C?~/.vim/ftplugin/c.vim

(Okay additionally there is the after/ folder, which complicates things 
a bit again)

> > Keeps your .vimrc cleaner.
> 
> Keeping everything vim-related in one config file is _wy_ cleaner.
> Cluttering the filesystem with a swarm of files seems untidy, and is a
> good way to leave config behind when moving to a new installation/OS
> upgrade, I figure.

Is there much of a difference of backing up ~/.vim/ instead of ~/.vimrc?
It is basically self contained and it contains every thing for setting 
up the new environment. plugins, configuration, undo-files, session 
files, custom scripts, spelling files, syntax files,

Plus for larger configuration files, this will impact startup time. 

I used to have my .vimrc on a Windows share. Adding some plugins made my 
vim startup grow to up to several 10 of seconds. It got better, after I 
moved my configuration to a local hard disk and even better, once I 
removed unneeded configuration files, that have been read, although I 
did not need them (like those menu files, that got loaded, although I 
explicitly set :set go= Using :set go=M helped).

> I have folding enabled in .vimrc, and the mutt stuff has its own section:
> 
> " Alt-O & Alt-I between files, just as ^O & ^I retrace move history:

Those things tend to break in the terminal.

> While ftplugin doubtless has some use cases, somewhere, I suspect that
> it's a bit like those tabs things in vim. I still find them a step
> backwards from just using buffers and the :bu commands. (Admittedly
> mapped, so  does :bu)

I use tabs, if I need them, and buffers if I need buffers. I don't see 
how they are "backwards". 

regards,
Christian
-- 
* BenC wonders why he has upgraded to 3.3.5-1 before teh X maintainer


Re: warning about missing attachment

2016-01-11 Thread Christian Brabandt
Hallo Matthias!

Matthias Apitz schrieb am Montag, den 11. Januar 2016:

> El día Monday, January 11, 2016 a las 08:01:34PM +1100, Erik Christiansen 
> escribió:
> 
> > ... 
> > No worries - a little hint can often save quite a bit of time and head
> > scratching.
> > 
> > And to Christan, a thankyou for the least intrusive and pretty much most
> > useful Vim plugin I've come across.
> 
> I have had now one issue where after adding, while still in vim, the
> attachment, it gave the new pseudo header line with its name, but after
> returning finaly to mutt, all header lines about To, ... have been
> empty; I could not reproduce this :-(

In mutt? What mutt version is this? Also make sure, you have set 
edit_headers in your muttrc or else it won't work.

regards,
Christian
-- 
We are each only one drop in a great ocean -- but some of the drops sparkle!


Re: warning about missing attachment

2016-01-11 Thread Christian Brabandt
Hallo Matthias!

Matthias Apitz schrieb am Sonntag, den 10. Januar 2016:

> El día Sunday, January 10, 2016 a las 10:21:24PM +1100, Erik Christiansen 
> escribió:
> 
> > On 09.01.16 23:18, Xu Wang wrote:
> > > What I find helpful is that immediately when I reference an attachment
> > > I stop my email, save it, add the attachment, then go back to edit
> > > email.
> > 
> > The CheckAttach plugin (for Vim) has an ":AttachFile" command which
> > allows adding attachments during composing, if desired. But I just
> > plough on, and simply respond to the prompt at the end of composing.
> > 
> > ...
> 
> I have it installed, but it did not worked; I looked into why and see:
> 
> $ find .vim
> .vim
> .vim/spell
> .vim/spell/de.utf-8.spl
> .vim/spell/es.utf-8.spl
> .vim/spell/es.utf-8.sug
> .vim/.netrwhist
> .vim/ftplugin
> .vim/ftplugin/mail
> .vim/ftplugin/mail/CheckAttach.vim
> .vim/doc
> .vim/doc/CheckAttach.txt
> .vim/doc/tags
> .vim/.VimballRecord
> 
> With truss(1) I got to know that vim was looking for a different place:
> 
> .vim/plugin
> 
> and I copied .vim/ftplugin/mail/CheckAttach.vim to 
> .vim/plugin/CheckAttach.vim 
> and with this it workes as expected. 

This is most certainly the wrong solution. The correct solution is to 
stick a
filetype plugin on
into your  ~/.vimrc (which is a good idea anyhow).

> 
> I will test it a while to get familar with it and see if I will like it;

If you happen to notice any bug, please notice me directly or file an 
issue here:
https://github.com/chrisbra/CheckAttach

I have been using it for 7 or 8 years and it has worked with no problems 
for me.

regards,
Christian
-- 
Confirmed bachelor:
A man who goes through life without a hitch.


Re: warning about missing attachment

2016-01-11 Thread Christian Brabandt
Hallo Matthias!

Matthias Apitz schrieb am Montag, den 11. Januar 2016:

> El día Monday, January 11, 2016 a las 12:38:46PM +0100, Christian Brabandt 
> escribió:
> 
> > > I have had now one issue where after adding, while still in vim, the
> > > attachment, it gave the new pseudo header line with its name, but after
> > > returning finaly to mutt, all header lines about To, ... have been
> > > empty; I could not reproduce this :-(
> > 
> > In mutt? What mutt version is this? Also make sure, you have set 
> 
> $ mutt -v
> Mutt 1.5.24 (2015-08-30)

Note, there was just recently an error in mutt fixed, that made mutt 
segfault, once you delete the attachments from within mutt re-edit the 
message and added another attachments.

However, I have never seen the error you report.


regards,
Christian
-- 
I selected E5 ... but I didn't hear "Sam the Sham and the Pharoahs"!


Re: How do you survive without notmuch?

2016-04-07 Thread Christian Brabandt
On Mi, 06 Apr 2016, Ben Boeckel wrote:

> On Thu, Apr 07, 2016 at 09:38:43 +1000, Cameron Simpson wrote:
> > For historic reasons, "$@" evaluates to a single "" if there were no
> > arguments at all, introducing a spurious new empty argument.
> > Possibly the thinking was that something like "$@" should never
> > vanish; after all "$x" will produce an single empty string if $x is
> > empty. The ${1+} simply avoids using "$@" at all unless there are
> > arguments, producing correct behaviour in the no-arguments case.
> 
> What shell is that? I've *never* encountered such a bug (well, I'd
> classify it as such at this point) and I do quite a bit of shell
> scripting.

According to Sven Maschecks website 
http://www.in-ulm.de/~mascheck/various/bourne_args/

,
| These shells behave the old way and need ${1+"$@"}:
| 
| Certainly: /bin/sh on 7th edition (aka Version 7). And thus also /bin/sh on 
original BSDs, until these shipped the Almquist shell (after 4.3BSD-Reno)
| HP-UX 8, 9 /bin/sh, HP-UX 10.x, 11.x /usr/old/bin/sh (as /bin/sh has become a 
ksh)
| OSF1/V4 and V5 aka Tru64 /bin/sh
| Ultrix /bin/sh and /bin/sh5
| Sinix 5.20 /bin/sh in both the "ucb" and the "sie" universe 
`

so basically, not relevant anymore.

regards,
Christian
-- 
The Martian landed his saucer in Manhattan, and immediately upon
emerging was approached by a panhandler.  "Mister," said the man, "can I
have a quarter?"
The Martian asked, "What's a quarter?"
The panhandler thought a minute, brightened, then said, "You're
right!  Can I have a dollar?"


Re: portable shell scripts

2016-04-08 Thread Christian Brabandt
On Do, 07 Apr 2016, David Champion wrote:

> > but printf for parameterised output:
> > 
> >  printf '%s\n' "$arbitrary_value"
> 
> I've started leaning on printf for newline-less printing lately -- it's
> just easier.  But you must be careful to use 'printf %s "$foo"' instead
> of just 'printf $foo', since otherwise a % in input can thwart.
> 
> > and I have my own script "necho" for "echo with no newline" for the
> > appropriat platform (or I make a shell function necho() calling printf for
> > the same purpose, depending on context). Then one can go:
> 
> Let's see if I can get this right from memory:
>   case "`echo -n`" in)
>   -n) necho () { echo "$@""\c"; };;
>   *)  necho () { echo -n "$@"; };;
>   esac

I mentioned Sven Maschecks Website before and he has some information 
about echo/printf as well
http://www.in-ulm.de/~mascheck/various/echo+printf/

> 
> Speaking of which, it's taken me until the last year to use $(command)
> consistently instead of `command`, and I'm not sure anymore why I was
> a stickler.  I assume some older shell didn't support $() but I can't
> recall which.

http://www.in-ulm.de/~mascheck/various/cmd-subst/

And the other pages are worth a look as well, if one is interested in 
those things.

regards,
Christian


Re: Convert ascii UTF8 code (in mutt "to:" header) to real UTF8

2016-06-03 Thread Christian Brabandt
Hi Erik!

On Fr, 03 Jun 2016, Erik Christiansen wrote:

> On 03.06.16 08:45, Matthias Apitz wrote:
> > $ echo 'Ker=C4=B1ko' | mmencode -u -q
> > Kerıko
> > $ echo 'Ker=C4=B1ko' | mmencode -u -q | od -tx1
> > 0004b  65  72  c4  b1  6b  6f  0a
> > 010
> 
> Matthias, mmencode looks very useful, but I'm not able to find it on my
> debian install, and apt-search doesn't do any good either. We used to
> have mimencode, but that was obsoleted years ago. I tried munpack, but
> that doesn't seem to make any attempt to handle mime fragments.
> Any clue on where mmencode might be snaffled would be very handy.

An alternative might be qprint (package qprint)

regards,
Christian
-- 
Moore's Constant:
Everybody sets out to do something, and everybody
does something, but no one does what he sets out to do.


Re: Install hiccup [Was: mutt 1.8.0 released]

2017-02-27 Thread Christian Brabandt
Hi Erik!

On Mo, 27 Feb 2017, Erik Christiansen wrote:

> # apt-get install libncursesw5
> Reading package lists... Done
> Building dependency tree   
> Reading state information... Done
> libncursesw5 is already the newest version.

You need the -dev variants for compiling.

regards,
Christian
-- 
I suppose one could claim that an undocumented feature has no
semantics.  :-(
-- Larry Wall in <199710290036.qaa01...@wall.org>


Re: cache/session related problem for (neo)mutt

2017-05-11 Thread Christian Brabandt

On Do, 11 Mai 2017, Baron Fujimoto wrote:

> $ mutt -version
> NeoMutt 20170428 (1.8.2)

Before asking here, you should at least check, if this also happens with 
vanilla mutt and not some fork.

regards,
Christian
-- 
Goals... Plans... they're fantasies, they're part of a dream world...
-- Wally Shawn


Re: Mutt - Neomutt and Debian Stretch

2017-07-01 Thread Christian Brabandt

On Fr, 30 Jun 2017, Antonio Radici wrote:

> mutt source code as you release it? It was never like this even before 1.6.*,
> when we had extra patches on the top of mutt, what should I do with
> patches/features which are (and were) expected on the top of mutt?

That's what the mutt-patched package was for, IIRC. But there was always 
the plain normal mutt package, if I remember correctly.

Unfortunately, the mutt-patched package now seems gone, otherwise, you 
could make a virtual package mutt-patched that depends on the neomutt 
package and which conflicts on the mutt package. However in the long 
run, it would be better, if the neomutt package provided its own binary 
and not call it mutt.


regards,
Christian


Re: How might deleted messages be put in some setup for trash and fully deleted later?

2017-07-19 Thread Christian Brabandt

On Mi, 19 Jul 2017, Don Saklad wrote:

> How might deleted messages be put in some setup for trash then if no
> exceptions fully deleted later?

:set trash=

Have a look at the manual. Note this feature has been available as a 
patch in older versions, but recent mutt versions support this feature 
natively.

regards,
Christian
-- 
CCI Power 6/40: one board, a megabyte of cache, and an attitude...


Re: Speed

2017-10-25 Thread Christian Brabandt

On Di, 24 Okt 2017, David Woodfall wrote:

> I've been using mutt a fair while now. Lately I've been using it with
> imap and find that it can take a while to read headers.
> 
> Are there any tricks to speeding up imap?
> 
> I do have a header cache, but it still takes some time opening a
> folder with a 1000+ or so messages.
> 
> Any tips?

Are you using any unusual headers for e.g. coloring? That may make mutt 
need to fetch the complete message instead of fetching it from the 
cache. See the `:set imap_headers` for adding additional headers to the 
cache.

Also you might want to check this article:
http://www.codeblueprint.co.uk/2016/12/19/a-kernel-devs-approach-to-improving.html

regards,
Christian
-- 
"How did you spend the weekend?" asked the pretty brunette secretary
of her blonde companion.
"Fishing through the ice," she replied.
"Fishing through the ice?   Whatever for?"
"Olives."


Re: line editor keybindings

2018-03-13 Thread Christian Brabandt

On Di, 13 Mär 2018, Florian Lohoff wrote:

> On Tue, Mar 13, 2018 at 11:13:08AM +0100, Marco Dickert wrote:
> > On 2018-03-13 20:50:20, Erik Christiansen wrote:
> > > On 13.03.18 10:09, andreas.muel...@biologie.uni-osnabrueck.de wrote:
> > > >   can I switch the editor key bindings to the vi style ?
> > > There is better than that - you can use vim as the mutt editor, with
> > > this line in ~/.muttrc:
> > > 
> > > set editor=vim
> > 
> > You also may want to use a mutt-dedicated vim configuration, like I do:
> > 
> > 
> > set editor="/usr/bin/vim -c ~/.mutt/vimrc"
> > 
> 
> As an alternative:
> 
> au BufRead,BufNewFile /home/flo/tmp/mutt-* set noai tw=72 ft=mail spell
> 
> Obviously you need to change you path for your setup.

Even better:

Make sure to have a `:filetype plugin on` in your .vimrc
and then drop all your mutt related settings below 
~/.vim/ftplugin/mail.vim
(create non-existent directories).

Then you only need `:set editor=vim` because Vim already recognizes mutt 
mails as filetype=mail.

See also here:
https://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html


regards,
Christian
-- 
MS-DOS must die!


Re: Bottom posting v top posting

2018-05-13 Thread Christian Brabandt

On So, 13 Mai 2018, Stefan Hagen wrote:

> HTML is not allowed on this list, so here is the HTML part for this mail:
> https://shell.srv.hagen.coffee/~sdk/textmail.html

Do you generate this somehow?

regards,
Christian
-- 
One girl can be pretty -- but a dozen are only a chorus.
-- F. Scott Fitzgerald, "The Last Tycoon"


Re: Stop myself from sending an email with a particular string

2018-09-15 Thread Christian Brabandt


On Sa, 15 Sep 2018, Erik Christiansen wrote:

> On 15.09.18 05:30, Francesco Ariis wrote:
> > Hello Xu,
> > 
> > On Fri, Sep 14, 2018 at 11:18:09PM -0400, Xu Wang wrote:
> > > Long story short:
> > > How can I have mutt refuse to send an email if the contents contain a
> > > certain string, such as the example "Erica"?
> > 
> > There is a script that implements a similar functionality
> > 
> > https://gitlab.com/muttmua/mutt/wikis/ConfigTricks/CheckAttach
> 
> If you compose emails in Vim, then simpler yet, Christian Brabandt's
> long established¹ CheckAttach plugin checks for default keywords, and
> the user can configure new ones in the g:attach_check_keywords variable.
> OK, it will then prompt for attachments on an exit attempt, but _also_
> highlight the triggering keywords - in this case "Erica". The attachment
> process, spurious for this use-case, is aborted by hitting , so
> the plugin adaptation is a quick and simple way to achieve the desired
> watchdog function.

Yes that would be one possibility. But note, that starting from mutt 1.8 
I believe, mutt now supports this natively using the abort_noattach 
quadoption and abort_noattach_regexp option.

regards,
Christian
-- 
Canonical, adj.:
The usual or standard state or manner of something.  A true story:
One Bob Sjoberg, new at the MIT AI Lab, expressed some annoyance at the use
of jargon.  Over his loud objections, we made a point of using jargon as
much as possible in his presence, and eventually it began to sink in.
Finally, in one conversation, he used the word "canonical" in jargon-like
fashion without thinking.
Steele: "Aha!  We've finally got you talking jargon too!"
Stallman: "What did he say?"
Steele: "He just used `canonical' in the canonical way."


Re: Compiling a newer version than the latest .deb package

2019-06-04 Thread Christian Brabandt


On Di, 04 Jun 2019, Frank Watt wrote:

> 
> 
> On 4/06/19 1:24 AM, Dan Ritter wrote:
> > Frank Watt wrote:
> > > 
> > > |You seem to be on x86_64 (or amd64 as debian calls it), so unless
> > > |you are building as 32-bit you don't need any of these.
> > > |
> > > |The -dev versions include headers, so you need those to compile, the
> > > |more-basic versions are only the libraries (for packages provided by
> > > |debian). And 'ncurses5' is the old version for ASCII or ISO-8859-N
> > > |versions - these days, 'ncurses5w' is probably what you need
> > 
> > 
> > 95% of your problems here will go away with:
> > 
> > sudo apt build-dep mutt
> > 
> > which will fetch and install all the libraries and tools
> > necessary to build Debian's current version of mutt.
> 
> # sudo apt build-dep mutt
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> E: Unable to find a source package for mutt
> Tui mutt-1.12.0 # which mutt
> /usr/bin/mutt
> Tui mutt-1.12.0 # dpkg -S /usr/bin/mutt
> dpkg-query: no path found matching pattern /usr/bin/mutt

You need deb-src urls in your /etc/apt/sources.list. 

> What am I to infer from that?  Could that be because I'm not a Debian purist
> since I use Linux Mint?

Yes, very likely.

> Were I to install nullmailer, it would remove sendmail, but is that any use
> with a 9 year old mutt?  I find everything I need in it.  Would it work to
> reinstall the old mutt deb after replacing sendmail with nullmailer?  I get
> the impression that the deb configures the installation to use the mta
> present at the time.

Yes, because it listens on your port 25, which can of course be only one 
single pakage. Therefore the different MTAs conflict each other. If you 
are satisifed with sendmail and it does everything you need, I wouldn't 
change it.

regards,
Christian
-- 
Those who don't understand Linux are doomed to reinvent it, poorly.
-- unidentified source


Re: bind index ...

2020-10-12 Thread Christian Brabandt


On Mo, 12 Okt 2020, Philippe Meunier wrote:

> Hello,
> 
> I'm trying to create some bindings in my .muttrc file for mutt's sidebar
> (this is while running mutt in an xterm window on OpenBSD):
> 
> bind index  sidebar-prev
> bind index  sidebar-next
> 
> and this works fine.  Then I tried this one:
> 
> bind index  sidebar-open
> 
> and it does not work at all: mutt seems to consider pressing the
> Shift-Enter combination on the keyboard to be the same as just pressing
> Enter.  Indeed executing the what-key function shows that the Shift-Enter
> key combination is just recognized as Return by mutt.

Shift + Return is not easily distinguishable for application on a 
terminal. 

> I also tried emacs's view-lossage function in the same xterm and emacs
> recognizes the Shift-Enter key combination as: ESC [ 2 7 ; 2 ; 1 3 ~
> So out of desperation I tried this in my .muttrc:

This is using xterms modifyOtherKeys extension. If this is enabled (and 
supported by your terminal), xterm will send a response like
CSI 27; ; 

CSI being ESC [

However, I believe this only works properly, if your terminal 
application (so mutt) understands and supports this scheme. As far as I 
know, mutt doesn't, but apparently your Emacs does (and Vim also 
supports this scheme for a few years).

So I think, this is currently not usable from within mutt.

regards,
Christian
-- 
To give happiness is to deserve happiness.


Re: textwidth/linewrap

2021-01-07 Thread Christian Brabandt


On Do, 07 Jan 2021, Matthias Apitz wrote:

> I do use in ~/.muttrc
> 
> set editor="vim \'+set textwidth=72\' \'+syntax match WarningMsg 
> /\\%>70v.*/\' -i NONE"

If Vim is setup with filetype detection logic, it automatically knows 
you are editing a mail filetype, because it recognizes the path. For 
this you need a `:filetype plugin on` in your .vimrc. 

Then place your filetype specific settings in a file called
~/.vim/after/ftplugin/mail.vim

(create non-existing directories; depending on your needs, one may leave 
out the after directory). If you have several files you need to read in, 
you can alternatively place them all in a directory
~/.vim/after/ftplugin/mail/

Also, you usually want to set buffer local settings, so use `:setl` 
instead of `:set` or `:setg`.

I have described my setup here:
https://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html


regards,
Christian
-- 
Whenever anyone says, "theoretically," they really mean, "not really."
-- Dave Parnas


Re: Japanese characters?

2021-01-22 Thread Christian Brabandt


On Do, 21 Jan 2021, meine wrote:

> hi,
> 
> by accident I discovered that I can compose Japanese kana (hiragana,
> katakana) in mutt. I wonder if this is a feature, or somewhere lurking
> in my mutt and FreeBSD setup (although I only use default software and
> settings). I have NL language settings for UTF-8 on a user level in my
> system, and use Vim as the editor for my emails. BTW, this described
> here doesn't work in Vim, but only in mutt.
> 
> It works like this:
> 
> typing a letter, then backspace and then another letter -- just making a
> typo and correcting it.
> 
> m  e --> め (hiragana `me`)
> 
> M  e -- メ (katakana `me`)
> 
> it just works with all characters, only the plain `a` in both writings I
> cannot find.
> 
> this way of composing also gives acces to Cyrillic `ja` я, ju `ю` and
> `cs` щ, and also to e.g. Arabic numbers ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ and ۹ by
> combining a number and `a` as described above.
> 
> this way of composing is different from typing characters that are
> behind the  or right-alt key, which I use for typing several
> European languages (å ä é ø æ ü, etc).
> 
> somehow it is funny to be able to write my name in Japanese, but it can
> also be a PITA when making too much typo's. so my question is:
> 
> * is this a feature of mutt?
> 
> * can it be switched on/off somehow?

This sound like you have `:set digraph` in your vim editor (might be in 
a filetype plugin or autocommand, so that is only applies to mails you 
edit from mutt).

regards,
Christian
-- 
There will be big changes for you but you will be happy.


Re: Visualising contents of a Maildir

2022-08-18 Thread Christian Brabandt


On Mi, 17 Aug 2022, martin f krafft via Mutt-users wrote:

> Folks,
> 
> This isn't really a Mutt question, but you're the kind of people that most
> likely would have good answers on the following:
> 
> For reasons you don't want to know, I have to visualise a Maildir with a
> couple of thousand messages, i.e. essentially provide a mutt-style index
> with correspondents, dates, subjects, and threading, ideally in form of an
> HTML table.
> 
> Apart from the threading, Python's email module can do most of the work, and
> combined with e.g. Jinja templating, I should be able to get results
> quickly, but since I don't like reinventing wheels, I was wondering if maybe
> you had a better idea?
> 
> Is there a way to "screenshot" the Mutt index beyond the scroll window?
> 
> Or can you think of command-line tools that visualise threads? Notmuch,
> which I use, can very quickly list all the threads, including the count of
> messages, but I actually need to list to be *really big* and not condensed,
> for reasons you don't want to know.
> 
> I can make notmuch output json with threading, and then process that with
> Python to create a list, but maybe there's a better tool?

I wonder if you can make use of public-inbox, which is e.g. used to 
create the git mailinglist archive. It's not pretty, but generates a 
threaded mail archive from a Maildir, IIRC. Not sure how easy enough it 
is to add date and from header

https://github.com/nojb/public-inbox

regards,
Christian
-- 
 "PLEASE RESPECT INTELLECTUAL RIGHTS!"
 "Please demonstrate intellect." ;)


Problem with IMAP Server and Header Cache

2023-01-25 Thread Christian Brabandt
Hey,
I am using mutt usually in a long running screen session to read mail 
from a local IMAP server (Dovecoat in this case). 

For some reason, whenever mutt disconnects and I want it to reload a 
mailbox with 100k messages in it, it usually hangs for very long until 
it finally disconnects. It's possible to re-connect and then it seems to 
load the mailbox just fine.

I have lived with that problem for some time already, but today I 
thought, it might make sense to actually create a muttdebug file, so 
here I am :)

This is an extract of the muttdebug file:

[2023-01-25 11:44:17] 4< * STATUS Drafts (RECENT 0 UIDNEXT 2 UIDVALIDITY 
1464715206 UNSEEN 0)
[2023-01-25 11:44:17] 4< a0075 OK Status completed (0.001 + 0.000 secs).
[2023-01-25 11:44:19] mutt_complete: completing =git
[2023-01-25 11:44:19] 4> a0076 LIST "" "git%"^M
[2023-01-25 11:44:19] 4< * LIST (\HasNoChildren \UnMarked) "." git
[2023-01-25 11:44:19] 4< * LIST (\HasNoChildren \UnMarked) "." github
[2023-01-25 11:44:19] 4< a0076 OK List completed (0.001 + 0.000 secs).
[2023-01-25 11:44:20] mutt_complete: completing =gith
[2023-01-25 11:44:20] 4> a0077 LIST "" "gith%"^M
[2023-01-25 11:44:20] 4< * LIST (\HasNoChildren \UnMarked) "." github
[2023-01-25 11:44:20] 4< a0077 OK List completed (0.001 + 0.000 secs).
[2023-01-25 11:44:20] Mailbox is unchanged.
[2023-01-25 11:44:21] Reading configuration file 
'/home/chrisbra/.mutt/profile.256bit.de'.
[2023-01-25 11:44:22] Reading imap://localhost/github...
[2023-01-25 11:44:22] Selecting github...
[2023-01-25 11:44:22] 4> a0078 CLOSE^M
a0079 STATUS "Entwurf" (MESSAGES)^M
a0080 SELECT "github" (CONDSTORE)^M
[2023-01-25 11:44:22] 4< a0078 OK Close completed (0.001 + 0.000 secs).
[2023-01-25 11:44:22] 4< * STATUS Entwurf (MESSAGES 0)
[2023-01-25 11:44:22] 4< a0079 OK Status completed (0.001 + 0.000 secs).
[2023-01-25 11:44:22] 4< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft 
$Forwarded)
[2023-01-25 11:44:22] 4< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted 
\Seen \Draft $Forwarded \*)] Flags permitted.
[2023-01-25 11:44:22] 4< * 113560 EXISTS
[2023-01-25 11:44:22] Handling EXISTS
[2023-01-25 11:44:22] cmd_handle_untagged: New mail in github - 113560 messages 
total.
[2023-01-25 11:44:22] 4< * 0 RECENT
[2023-01-25 11:44:22] 4< * OK [UNSEEN 4] First unseen.
[2023-01-25 11:44:22] 4< * OK [UIDVALIDITY 1384369187] UIDs valid
[2023-01-25 11:44:22] 4< * OK [UIDNEXT 351036] Predicted next UID
[2023-01-25 11:44:22] 4< * OK [HIGHESTMODSEQ 166330] Highest
[2023-01-25 11:44:22] 4< a0080 OK [READ-WRITE] Select completed (0.001 + 0.000 
secs).
[2023-01-25 11:44:22] Reading uid seqset from header cache
[2023-01-25 14:24:42] Fetching flag updates... 0/113560 (0%)
[2023-01-25 14:24:42] 4> a0081 UID FETCH 1:351000 (FLAGS) (CHANGEDSINCE 166043 
VANISHED)^M
[2023-01-25 14:24:42] 4< * BYE Disconnected for inactivity.
[2023-01-25 14:24:42] Handling BYE
[2023-01-25 14:24:42] Disconnected for inactivity.
[2023-01-25 14:24:44] Fetching message headers... 0/113560 (0%)
[2023-01-25 14:24:44] Error opening mailbox
[2023-01-25 14:24:45] In mutt_reflow_windows
[2023-01-25 19:47:18] In mutt_reflow_windows

As you can see, mutt seems to be busy reading the header-cache file until the 
server finally disconnects.

Any idea on how to fix this issue or work-around it?

Mutt version below, should come straight from Ubuntu 20.04.

Thanks,
Chris

#v+
chrisbra@256bit:~$ mutt -v
Mutt 1.13.2 (2019-12-18)
Copyright (C) 1996-2016 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 5.4.0-137-generic (x86_64)
ncurses: ncurses 6.2.20200212 (compiled with 6.2)
libidn: 1.33 (compiled with 1.33)
hcache backend: tokyocabinet 1.4.48

Compiler:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs 
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-9 
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new 
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin 
--enable-default-pie --with-system-zlib --with-target-system-zlib=auto 
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib 
--with-tune=generic 
--enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa
 

Re: Problem with IMAP Server and Header Cache

2023-01-25 Thread Christian Brabandt


On Mi, 25 Jan 2023, Kevin J. McCarthy wrote:

> On Wed, Jan 25, 2023 at 07:54:49PM +0100, Christian Brabandt wrote:
> > For some reason, whenever mutt disconnects and I want it to reload a
> > mailbox with 100k messages in it, it usually hangs for very long until
> > it finally disconnects.
> 
> Do you mean this only happens after a disconnect within mutt, and only when
> you try to reopen the same mailbox without closing mutt?  Or does
> this happen in other circumstances too.

No. I mean it happens whenever mutt quits (or has been forcefully
shutdown).

Sometimes I also notice a normal quit takes very long (I assume it
somehow writes/updates the header cache and this may also take a while?)

I can "fix" it by manually deleting the header cache, but then mutt
starts loading all those messages again and it again takes a bit until
the mailbox is open.

> > It's possible to re-connect and then it seems to load the mailbox just
> > fine.
> 
> It would be interesting to see the debug log for that same section when it
> "works".  (Up until the "Fetching flag updates..." part).
> 
> My first guess is that the seqset is corrupted somehow, or perhaps the
> header cache has a problem, but that wouldn't explain why it sometimes
> works.

Let me see what I can do for you :) 

[...]
[2023-01-25 19:55:22] Reorder: x = 0; hdr_count = 1
[2023-01-25 19:55:22] Reorder: x = 0; hdr_count = 1
[2023-01-25 19:55:22] Reorder: x = 0; hdr_count = 1
[2023-01-25 19:55:22] Reorder: x = 0; hdr_count = 1
[2023-01-25 19:55:22] New mail in =github, =vim, =opensuse, =zsh-users, =git, 
=oss-security, =Trash, =AKV, =spam
[2023-01-25 19:55:23] Copying 8 messages to Trash...
[2023-01-25 19:55:23] 4> DONE^M
a0195 UID COPY 59266:59267,59269:59274 "Trash"^M
[2023-01-25 19:55:23] 4< a0194 OK Idle completed (9.408 + 9.408 + 9.408 secs).
[2023-01-25 19:55:23] 4< a0195 OK [COPYUID 1384369013 59266:59267,59269:59274 
204042:204049] Copy completed (0.235 + 0.000 + 0.234 secs).
[2023-01-25 19:55:23] 4> a0196 IDLE^M
[2023-01-25 19:55:23] 4< + idling
[2023-01-25 19:55:23] Marking 9 messages deleted...
[2023-01-25 19:55:23] 5671 kept, 9 deleted.
[2023-01-25 19:55:24] Reading configuration file 
'/home/chrisbra/.mutt/profile.256bit.de'.
[2023-01-25 19:55:24] Reading imap://localhost/github...
[2023-01-25 19:55:24] Selecting github...
[2023-01-25 19:55:24] 4> DONE^M
a0197 UID STORE 59266:59274 +FLAGS.SILENT (\Deleted)^M
a0198 CLOSE^M
a0199 STATUS "Entwurf" (MESSAGES)^M
a0200 SELECT "github" (CONDSTORE)^M
[2023-01-25 19:55:24] 4< a0196 OK Idle completed (1.130 + 1.129 + 1.129 secs).
[2023-01-25 19:55:24] 4< * 5672 FETCH (UID 59266 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5673 FETCH (UID 59267 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5674 FETCH (UID 59268 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5675 FETCH (UID 59269 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5676 FETCH (UID 59270 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5677 FETCH (UID 59271 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5678 FETCH (UID 59272 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5679 FETCH (UID 59273 MODSEQ (28292))
[2023-01-25 19:55:24] 4< * 5680 FETCH (UID 59274 MODSEQ (28292))
[2023-01-25 19:55:24] 4< a0197 OK Store completed (0.001 + 0.000 secs).
[2023-01-25 19:55:25] 4< a0198 OK Close completed (0.064 + 0.000 + 0.063 secs).
[2023-01-25 19:55:25] 4< * STATUS Entwurf (MESSAGES 0)
[2023-01-25 19:55:25] 4< a0199 OK Status completed (0.001 + 0.000 secs).
[2023-01-25 19:55:25] 4< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft 
$Forwarded)
[2023-01-25 19:55:25] 4< * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted 
\Seen \Draft $Forwarded \*)] Flags permitted.
[2023-01-25 19:55:25] 4< * 113684 EXISTS
[2023-01-25 19:55:25] Handling EXISTS
[2023-01-25 19:55:25] cmd_handle_untagged: New mail in github - 113684 messages 
total.
[2023-01-25 19:55:25] 4< * 0 RECENT
[2023-01-25 19:55:25] 4< * OK [UNSEEN 4] First unseen.
[2023-01-25 19:55:25] 4< * OK [UIDVALIDITY 1384369187] UIDs valid
[2023-01-25 19:55:25] 4< * OK [UIDNEXT 351160] Predicted next UID
[2023-01-25 19:55:25] 4< * OK [HIGHESTMODSEQ 166533] Highest
[2023-01-25 19:55:25] 4< a0200 OK [READ-WRITE] Select completed (0.002 + 0.000 
+ 0.001 secs).
[2023-01-25 19:55:25] imap_cmd_finish: Fetching new mail
[2023-01-25 19:55:25] Fetching message headers... 0
[2023-01-25 19:55:25] Reading uid seqset from header cache
[2023-01-25 19:55:42] Fetching flag updates... 0/113684 (0%)
[2023-01-25 19:55:42] 4> a0201 UID FETCH 1:351159 (FLAGS) (CHANGEDSINCE 166043 
VANISHED)^M
[2023-01-25 19:55:43] 4< * VANISHED (EARLIER) 
1:220747,220749:227153,227155:227211,227213:227885,227887:227910,227914,227916:227917,227921:236315,236938:236941,238724,238726:238727,238731,238734,238748,238751,238915,239394:239397

Re: Problem with IMAP Server and Header Cache

2023-01-26 Thread Christian Brabandt

Am 2023-01-26 00:33, schrieb Kevin J. McCarthy:


Hmmm... I see in the log that even in the "working" case it's taking a
good 15 seconds to load in the messages from the seqset/header cache.
It's a big mailbox, though, so maybe that's to be expected.

I noticed you are using 1.13.2.  Are you in a position to try building
a newer version of mutt?  There have been several important fixes to
QRESYNC since then (including a bug in the seqset iterator).  It
doesn't *look* like that's the issue here, but it would still be a
good idea to try 2.2.9 if possible.

While you are at it, you might also try building with a different
header cache backend.  Perhaps tokyocabinet is having issues.  I would
suggest kyotocabinet or perhaps lmdb and see how they work.

On ubuntu, just run
  $ sudo apt build-dep mutt
  $ sudo apt install libkyotocabinet-dev liblmdb-dev
  $ ./configure --enable-compressed --enable-debug --enable-fcntl \
   --enable-hcache --enable-gpgme --enable-imap --enable-smtp \
   --enable-pop --enable-sidebar --with-curses --with-gnutls \
   --with-gss --with-idn --with-sasl \
   --with-kyotocabinet  (or --with-lmdb)
  $ make
  $ sudo make install


I tried building building latest master with --with-kyotocabinet

It took me a bit until I found `./prepare` but then I could run 
configure

(and for some reason, it didn't like my installed `libidn2-dev` library,
so I build without `--with-idn`, but I suppose for the test it doesn't 
really

matter.)

#v+
Mutt 2.2.9+62 (90236f5a) (2022-12-20)
Copyright (C) 1996-2022 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 5.4.0-137-generic (x86_64)
ncurses: ncurses 6.2.20200212 (compiled with 6.2)
hcache backend: kyotocabinet 1.2.76

Compiler:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' 
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs 
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 
--prefix=/usr --with-gcc-major-version-only --program-suffix=-10 
--program-prefix=x86_64-linux-gnu- --enable-shared 
--enable-linker-build-id --libexecdir=/usr/lib 
--without-included-gettext --enable-threads=posix --libdir=/usr/lib 
--enable-nls --enable-bootstrap --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-gnu-unique-object 
--disable-vtable-verify --enable-plugin --enable-default-pie 
--with-system-zlib --enable-libphobos-checking=release 
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch 
--disable-werror --with-arch-32=i686 --with-abi=m64 
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic 
--enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa 
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu 
--with-build-config=bootstrap-lto-lean --enable-link-mutex

Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Configure options: '--enable-compressed' '--enable-debug' 
'--enable-fcntl' '--enable-hcache' '--enable-gpgme' '--enable-imap' 
'--enable-smtp' '--enable-pop' '--enable-sidebar' '--with-curses' 
'--with-gnutls' '--with-gss' '--with-sasl' 
'--prefix=/home/chrisbra/local' '--with-kyotocabinet'


Compilation CFLAGS: -Wall -pedantic -Wno-long-long -g -O2

#v-

I wiped out the header-cache, to make sure there are no 
incompatibilities, re-connected locally
build up the header-cache again (which takes a while to download all 
messages) browsed quickly
and quit mutt and did a fresh reconnection, so that the new header-cache 
will be used again.


But I am afraid, I am seeing the same problem (I haven't waited yet 3 
hours until mutt gets disconnected

from the IMAP server, but the symptoms look exactly the same.

Mutt just shows me "Selecting github..." and does "something" :/

In the debug file I see:

#v+
[2023-01-26 16:52:40] Mutt/2.2.9+62 (90236f5a) (2022-12-20) debugging at 
level 2

[2023-01-26 16:52:40] In mutt_reflow_windows
[2023-01-26 16:52:40] In mutt_reflow_windows
[2023-01-26 16:52:40] In mutt_reflow_windows
[...]
# Just so it's clear its the new mutt 2.2 :)
[...]
[2023-01-26 16:52:45] New mail in =vim, =zsh-users, =Trash, =spam
[2023-01-26 16:52:47] Mailbox is unchanged.
[2023-01-26 16:52:47] 4> DONE^M
a0042 CLOSE^M
[2023-01-26 16:52:47] 4< a0041 OK Idle completed (2.993 + 2.993 + 2.992 
secs).

[2023-01-26 16:52:47] 4< a0042 OK Close completed (0.001 + 0.000 secs).
[20

Re: Problem with IMAP Server and Header Cache

2023-01-27 Thread Christian Brabandt

Am 2023-01-26 20:08, schrieb Kevin J. McCarthy:

the header cache backend, this smells like a Mutt bug.

Would you mind opening a ticket so we can debug it without causing too
much traffic on mutt-users?


Yes agree, so let's move it to 
https://gitlab.com/muttmua/mutt/-/issues/436


Thanks,
Chris


Re: mutt && oauth2 config

2024-06-20 Thread Christian Brabandt


On Mi, 19 Jun 2024, Will Yardley wrote:

> (I have started to see some Gmail environments also prevent the
> creation of app passwords).

If I recall correctly google is transitioning away from using app 
passwords later this year. A quick google turned up this doc: 
https://support.google.com/a/answer/14114704?hl=en

regards,
Christian
-- 
He who is in love with himself has at least this advantage -- he won't
encounter many rivals.
-- Georg Lichtenberg, "Aphorisms"


Re: Filetype not set in vim after brew upgrade

2024-09-09 Thread Christian Brabandt


On Mo, 09 Sep 2024, Jan Eden via Mutt-users wrote:

> On 2024-09-09 00:41, Akshay Hegde via Mutt-users wrote:
> 
> > On 2024-09-09 08:42 +0200, Jan Eden via Mutt-users wrote:
> > > Hi,
> > > 
> > > this is a little off-topic, but maybe other mutt users are affected,
> > > too: Since upgrading to vim 9.1.700 this morning via homebrew, the
> > > filetype is not set automatically anymore when calling vim from mutt.
> > 
> > I just updated to 9.1.0722 this morning on my mac but the filetype 
> > detection seems
> > to be working fine for me.
> > 
> > Checking $VIMRUNTIME/filetype.vim [1] reveals that the filetype should get
> > set when the name of the buffer matches one of the patterns specified.
> > 
> > For me, mutt launches vim with a file name beginning with "mutt-*" which
> > matches the pattern "mutt{ng,}-*-\w\+" in [1]. So check the filename
> > mutt is creating for you.
> 
> The filename created for this reply looks like this –
> 
> "/var/folders/ps/4v3k3hwj1jd9bdyq8sc4kptrgn/T/mutt-snafu-501-5821-14318527686633908551"
>  34L, 1243B  
> 
> – and it matches the pattern
> 
> " Mail (for Elm, trn, mutt, muttng, rn, slrn, neomutt)
> au BufNewFile,BufRead 
> snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml
>  setf mail
> 
> in /opt/homebrew/Cellar/vim/9.1.0700/share/vim/vim91/filetype.vim.
> Still, the filetype is not set (since this morning).
> 
> > Running the command ':verbose set filetype?' after mutt launches vim
> > should give you an output similar to mine, and more specifically should
> > show up as being under the $VIMRUNTIME directory unless you've
> > overridden it:
> > 
> >   filetype=mail
> > Last set from 
> > /.local/pkg/vim/9.1.0722/share/vim/vim91/filetype.vim line 1384

Make sure you have `:filetype plugin on` or similar in your 
configuration file.


regards,
Christian
-- 
 Culus: wanna suspend me for it? :)
 Overfiend:  Go maliciously crack a few severs and we'll talk
 Culus: damn, it has to be malicious?
 Overfiend:  Sadly, yes


Re: Filetype not set in vim after brew upgrade

2024-09-09 Thread Christian Brabandt


On Mo, 09 Sep 2024, Jan Eden via Mutt-users wrote:

> I have (since I use vim), that is why I am so confused by the changed
> behavior.

From within Vim, check:

:filetype
to check that filetype detection it is really on

:scriptnames

To see what configuration files are sourced. Also make sure you are not 
using a tiny vim (check the :version output). And finally, check :echo 
v:progpath to see which Vim is used.

> The brew install receipt for vim from this morning does not shed a light
> on the issue:

I have no idea, what that is going to tell me.

regards,
Christian
-- 
It is easier for a camel to pass through the eye of a needle if it is
lightly greased.
-- Kehlog Albran, "The Profit"


Re: disable exit

2007-06-06 Thread Christian Brabandt
Hi Eric!

On Wed, 06 Jun 2007, Eric Smith wrote:

> How do I disable exit in mutt?  So no matter what macros or
> keypresses, mutt does not exit.

I think
set quit=no
does what you want.

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
128. You can access the Net -- via your portable and cellular phone.


Re: Avoid Duplicates in $record if Send Fails

2007-06-15 Thread Christian Brabandt
Hi Svend!

On Fri, 15 Jun 2007, Svend Sorensen wrote:

> If the sending of a mail fails, and the compose screen is redisplayed,
> the message is saved to the $record location.  This happens each time
> the send fails.  This leads to duplicate mails in the $record mailbox.
> 
> Is there a way to save the message to $record ONLY if the send goes through.
> 

Not that I know of. You could of course create a folder-hook, that
deletes duplicate messages.
Something like this:
,
| folder-hook =sent 'push ~='
`

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
136. You decide to stay in a low-paying job teaching just for the
 free Internet access.


Re: random ideas - storing mutt settings on imap server

2007-06-19 Thread Christian Brabandt
Hi Hein!

On Tue, 19 Jun 2007, Hein Zelle wrote:

> this has probably been mentioned before, but I'll toss it up anyway.
> What's the general opinion about storing mutt settings in a
> centralized place, e.g. on an imap server?  I find that, using mutt from
> 3 different places accessing the same imap server, it gets tedious to
> synchronize settings and aliases and save-hooks.

There even exist Protocols that would specify such things. I
believe these are ACAP and IMSP. But aside from Mulberry which
seems to support such extensions, I don't think that mutt supports it
currently. I would definitly like such support.

My current workaround is storing the configuration data on an
subversion host.

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
145. You e-mail your boss, informing him you'll be late.


Re: random ideas - storing mutt settings on imap server

2007-07-11 Thread Christian Brabandt
Hi Michelle!

On Mon, 09 Jul 2007, Michelle Konzack wrote:

> Do you have more infos about ACAP and IMSP? RFC's or such?

No, a quick google search revealed RFC2244 and RFC2245 for ACAP and an
internet draft for IMSP: http://asg.web.cmu.edu/cyrus/rfc/imsp.html

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
166. You have been on your computer soo long that you didn't realize
 you had grandchildren.


Re: Dynamic macro

2007-07-23 Thread Christian Brabandt
Hi Ben!

On Mon, 23 Jul 2007, Ben Gladwell wrote:

> dumps them all into the same mbox, which is the way I like it. I want to
> create a macro that creates a limit based on the host of the sender of
> the current email in the index - in my case its the name of the server
> that emailed me. This way, I could quickly see all the emails from each
> server.
> 
> So, if the current email iss from [EMAIL PROTECTED] i'd like a
> limit like:
> ~L server

I created once a quick and dirty mapping, that would limit the view to
all the mails from the author of the mail which was selected.  Since I
tend to remember mails by the name of the author which sent it.

,[ $ grep -m1 -B3 .mutt/macros.conf ]-
| macro index A "unset wait_key\
| ~/bin/mutt_address.sh ~/temp/mutt_source.txt\
| set wait_keysource ~/temp/mutt_source.txt" 
"limit message view by selected author"
`

And mutt_address.sh looks like this:

#!/bin/sh

FORM=`which formail`
ARGS="`cat`"

# The sed statement will cut out only the relevant part from
# the e-mail address between <> (e.g. for "Foo" <[EMAIL PROTECTED]> it 
# will only print [EMAIL PROTECTED]) and will also translate
# allowed characters like "." or "+" by escaping them
OUTPUT=`echo "${ARGS}"|"${FORM}" -tzx "From:" | sed 
's/.*//;s/\./&/g;s/+/&/g'`  
if [ -n "$1" ]; then
TEMP="$1"
exec >"${TEMP}" || { echo "Could not output to $1, exiting..." &&  exit 1; }

cat <~f \"${OUTPUT}\""'
EOF
else
echo "You must supply a filename in which to store the result!" && exit 2
fi

This is probably pretty ugly, especially the escaping was hard to
figure out. But so far, I have not had any problems. 


regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
175. You send yourself e-mail before you go to bed to remind you
 what to do when you wake up.


Re: Difference between 'push' and 'exec', is there any?

2007-08-08 Thread Christian Brabandt
Hi Chris!

On Wed, 08 Aug 2007, Chris G wrote:
> On Wed, Aug 08, 2007 at 06:38:33PM +0100, Chris G wrote:
> > Would a sourced file containing a series of 'push' commands execute
> > them in the order expected (i.e. sort of backwards).  For example if I
> > source the following:-
> > 
> > push ":set mbox_type=mbox"
> > push save-message
> > push ":set mbox_type=maildir"
> > 
> > Will it switch to maildir, save a message and then switch back to
> > mbox?
> > 
> No it won't, pity!  It takes the ":set mbox_type=mbox" as the name of
> the file to save to.  (Of course the above needs ^M in the set
> commands but still).

Well, you are almost there. It should work this way:

push "set mbox_type=mbox\
~/saved_messageset mbox_type=maildir"

Just source the file and you'll find the selected message in your ~. 
Instead of  a simple  should work, if you'd like to
accept the name proposed by mutt.

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
197. Your desk collapses under the weight of your computer peripherals.


Re: Mutt Quick Reference v.1.03 (addition from Markus Miedaner)

2007-10-24 Thread Christian Brabandt
Hi Joseph!

On Tue, 23 Oct 2007, Joseph wrote:

> Mutt Quick Reference v.1.03 - updated.
> http://www.sys-concept.com/Mutt_connections.html
> 

nice.

Would it be possible to add commandline parameters? If I have time, I
can contribute.


regards,
Christian
-- 
With sufficient thrust, pigs fly just fine.
   -- RFC 1925


Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

Do you mind formating your message with a width < 80 chars?

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:
> I want to write a script that _asks_ the user, if he wants to send a
> return receipt (note how that differs from your assumption that a
> macro would be suffice. For me it wouldn't because w/o the question
> _I_ would forget to send the return receipt). Something like this
> can automatically be triggered only by message hooks. But as the
> solution is extern (= a script), how do i call it from within the
> message hook? I added a hook like this:
> 
> message-hook "~h Return-Receipt-To:"
> "|/home/schoenfeld/.mutt/return_receipt"
> 
> And even though the specified file is a valid executable script mutt
> says (when I open this mail in the pager):
> 
> |/home/schoenfeld/.mutt/return_receipt: Unknown command

Depending on what your want try either  or 


regards,
Christian
-- 
f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng


Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:

> On Wed, Oct 24, 2007 at 04:56:13PM +0200, Christian Brabandt wrote:
> > Do you mind formating your message with a width < 80 chars?
> 
> no, thats no problem.
> 
> > Depending on what your want try either  or 
> 
> Hm. That and what Dave Evans wrote works, at least partially. Now the
> script is launched, but it does not work as expected.  It starts the
> script which outputs:
> 
> User has asked for a return receipt. Send one? ([yes]/no): 
> 
> and waits for an input ("read yn"), but mutt adds its "Press any key to
> continue...". So it seems that mutt already answers the question (what
> it shouldn't do). Also if I do press return to that question, it
> restarts the script and the game starts from the beginning. Endless,
> until i somehow force it to quit (not that easy).
> 
> The (for now very basic script):
> #!/bin/sh
> 
> TEMP="`mktemp`"
> trap "rm -f $TEMP" INT ABRT EXIT
> tee > $TEMP
> 
> QUESTION="User has asked for a return receipt. Send one? ([yes]/no): "
> echo -n $QUESTION
> read yn
> 
> (I know that this is far from beeing complete, but to test how things
> would work it is enough)

If you have used  I think your stdin has changed to the
messages you piped. And read expects your answer from that filehandle.
So you might try explicitly setting your tty with read yn 

Re: Howto run a command in message hooks

2007-10-24 Thread Christian Brabandt
Hi Patrick!

On Wed, 24 Oct 2007, Patrick Schoenfeld wrote:

> On Wed, Oct 24, 2007 at 05:30:45PM +0200, Christian Brabandt wrote:
> > If you have used  I think your stdin has changed to the
> > messages you piped. And read expects your answer from that filehandle.
> > So you might try explicitly setting your tty with read yn  
> Okay, that might be an explanation why it does immedetiately print those
> mutt press any key message (btw. is it possible to suppress this message
> when calling the script?), 

set wait_key=no

> but why does it recall and recall the script endlessly?

I don't know.

regards,
Christian
-- 
Everything can be filed under "miscellaneous".


Re: sending all postponed emails at once

2007-10-29 Thread Christian Brabandt
Hi Joseph!

On Fri, 26 Oct 2007, Joseph wrote:

> so I was thinking if there is a way of sending postponed emails all at 
> once. 
> I know mutt has a way to postpone emails but they are not sent out until I 
> re-call them one by one, am I correct?
> I want to send all postponed email once the connection with Internet is 
> established by dial-up and/or wifi
> 

By using msmtp as your mta you can use these 3 scripts for queue
management.
msmtp-enqueue.sh
msmtp-listqueue.sh
msmtp-runqueue.sh

msmt-enqueue.sh will enqueue your messages (when used as sendmail
command) and msmtp-runqueue.sh will actually send your messages when
you are connected. 

But notice that from within mutt you are "sending" your messages.

regards,
Christian
-- 
SIGFUN -- signature too funny (core dumped)


Re: select profile depending on mailbox folder

2007-11-12 Thread Christian Brabandt
Hi ITSec_Mike!

On Tue, 13 Nov 2007, ITSec_Mike wrote:

> Actually I would like to get selected the profile automatically
> depending in which mailbox folder I am in.  Does anybody has an idea
> how this can be achieved?

Something like this should work:
,
| ~$ tail folder-hook.conf
| folder-hook . "source ~/.mutt/profile.default"
| folder-hook mutt "source ~/.mutt/profile.lists"
`


regards,
Christian
-- 
It is illegal to take more than three sips of beer at a time while standing.
[real standing law in Texas, United States of America]


Re: How to edit ^E attachment type permananet?

2007-11-27 Thread Christian Brabandt
Hi Michelle!

On Thu, 22 Nov 2007, Michelle Konzack wrote:
> I get Application Notes and Design Guides per E-Mail, but unfortunatly
> the emiters Perl-Script send it every time as 
> 
> Question:  HOW to edit it permanently?

Well Kyle already mentioned mime_lookup. Besides that you could also
use edit-message, bound to e and "correct" the mail.

regards,
Christian
-- 
"Oh, no!  NOT the Spanish Inquisition!"
"NOBODY expects the Spanish Inquisition!!!"
-- Monty Python sketch --
"Oh, no!  NOT another option!"
-- Discussion in vim-dev mailing list --


Re: Odd 'new mail' effect on new system

2007-12-06 Thread Christian Brabandt
Hi Chris!

On Thu, 06 Dec 2007, Chris G wrote:

> It all works pretty much the same (no change of home directory so my
> muttrc is the same one) except that every time I send a mail message
> mutt tells me there's new mail in my sentmail folder - true enough but
> not very helpful!  It didn't do that on the BSD system.
> 
> What do I need to do to fix this - or what can I do to diagnose what's
> going on?

Have you specified your sentmail folder as mailbox in your .muttrc?


regards,
Christian
-- 
Excerpt from a conversation with a friend, early in my unix odyssey:
"So now I've got all these floppy-sized archive pieces, and I haven't
been able to figure out what program I'm supposed to use to concat--
er, never mind."


Re: use_envelope_from / envelope_from_address

2008-01-13 Thread Christian Brabandt
Hi spekul!

On Sat, 12 Jan 2008, spekul wrote:

> after having read through http://wiki.mutt.org/?MuttGuide/Send, i  
> tried setting use_envelope_from and envelope_from_address accordingly  
> to different sender profiles. i am using mutt 1.4.2.3i, built from  
> freebsd ports.
> 
> are these variables that only work in mutt development sources aka  
> 1.5? with those variables set, on startup i get:


Yes, this has been added in mutt 1.5.11:

,[ zgrep -A3 1.5.11 /usr/share/doc/mutt/NEWS.gz ]-
| 1.5.11 (2005-09-15):
| 
|   ! $envelope_from_address has been added, $envelope_from has been renamed
| to $use_envelope_from
`

regards,
Christian
-- 
Science is built up of facts, as a house is with stones.  But a collection
of facts is no more a science than a heap of stones is a house.
-- Jules Henri Poincar'e


Re: forwarding attachments

2008-01-15 Thread Christian Brabandt
Hi Ray!

On Tue, 15 Jan 2008, Ray Stell wrote:

> is there a .muttrc setting that will cause attachments to 
> be forwarded?  thx.

Look for the mime_forward setting.

regards,
Christian
-- 
Congratulations!  You are the one-millionth user to log into our system.
If there's anything special we can do for you, anything at all, don't
hesitate to ask!


Re: Moving a non-trivial mail setup to mutt

2008-01-23 Thread Christian Brabandt
Hi Dan!

On Wed, 23 Jan 2008, Dan H wrote:

> browser started getting blurriy, I managed to connect to my IMAP
> server like this:
> 
> set spoolfile=imap://email.server.org/INBOX
> 
> Great. Now I can see my inbox. And nothing else. How can I see my
> other folders on that server? 'c ?' doesn't show anything.

You need to define your mailboxes. I have
mailboxes = =mutt ...
You can even dynamically generate it:
mailboxes `~/bin/list_imap.pl`
where your bin/list_imap.pl looks like this:

,[ cat ~/bin/list_imap.pl ]-
| #!/usr/bin/perl 
| 
| use Net::IMAP::Simple; 
| 
| my $password="password"; 
| my $user="username"; 
| my $host="hostname"; 
| my $seperator="."; 
| 
| my $imap = Net::IMAP::Simple->new($host) || 
| die $Net::IMAP::Simple::errstr."\n"; 
| unless($imap->login($user, $password)){ 
| die "Login failed: " . $imap->errstr() . "\n"; 
| } 
| my @mb; 
| push @mb,sort($imap->mailboxes); 
| 
| foreach (@mb){ 
| s/^/=/; 
| s|/|$seperator|g; 
| print "$_ "; 
| }; 
| print "\n"; 
| 
| $imap->quit; 
`
(This was a quick hack, to dynamically generate the list)

> 
> Speaking of folders. Mutt looks into the same folder hierarchy as my
> current sylpheed-claws setup. But it only shows me top-level
> folders. When I enter a folder it doesn't show me any subfolders.
> Does mutt not support nested folders? Then I can't use it.

Yes, you can browse your imap-Server with c and at the prompt enter ?
> 
> I've also managed to set up fetchmail, which fetches mail from
> several POP3 accounts into one repository where I can access it if
> and only if I comment out the above line. To sort out those mails I
> guess I'll have to feed them through procmail, but where will they
> end up then, and how will mutt check for new mails and tell me about
> it? Is there some kind of overview of folders that can receive mail?

You tell mutt where you expect your mail to reside. How your mail actually
gets there is the task of procmail/maildrop/.. 
So you'll probably need to tell your MTA or fetchmail that all local mails
need to be delivered via procmail/maildrop...

> How can I have "multiple identites"? Sometimes I'm sending mail
> under my private address, sometimes as an employee of my company. How
> can this be managed by mutt? When I reply to mail, can mutt
> automatically use the address under which I received that mail as the
> sender identity?

I am using profiles which get loaded using folder-hooks:

,
| folder-hook . "source ~/.mutt/profile.256bit.de"
| folder-hook mutt.* "source ~/.mutt/profile.256bit.org"
| folder-hook vim "source ~/.mutt/profile.lists"
`
You might also look into muttprofile
(see http://www.acoustics.hut.fi/~mara/mutt/muttprofile.html)
Although I have muttprofile set up, I am not using it ;)

> Next thing. The address book. There seems to be an external program
> called "abook" that adds some rudimentary address book functionality.
> But I work on largish projects that frequently require me to set up
> ad-hoc lists of eight or more people which I can send mail to by
> typing a single "nick name". I also need to be able to quickly add
> addresses to those lists by some selection method (like Pine's "List
> mode").

Basic adress functionality is provided by the aliases. But you can
also use e.g. abook.

> I hope someone can clue me in. I have a repository for software that
> I will never get my head around. Emacs has been in there after
> invoking it once and not being able to quit it except by killing it
> from another console. Vi after one week during which I forced
> myself to use nothing but vi. Mutt seems so be ready to join. Maybe
> I'm just not the geek I'd like to be.
> 
> In short, my requirements are:
> 
> - Multiple accounts (both local and remote)
> - Multiple identites

Both can be done via hooks or muttprofile

> - Folders with subfolders

no problem

> - Powerful address management

probably external address book, like abook or lbdb 

> Does mutt cutt it?

sure. You probably want to look at the Wiki http://wiki.mutt.org 
and you might want to look at http://www.muttrcbuilder.org for
generating your .muttrc, although I do not know alive this project
currently is.

regards,
Christian
-- 
:wq


Re: OT: column 72 in mutt with xterm && vim

2008-03-12 Thread Christian Brabandt
Hi Matthias!

On Wed, 12 Mar 2008, Matthias Apitz wrote:

> I'm using mutt and writing e-mails with a 'vim' in a xterm window;
> the line length of this xterm window is pulled to more than 80
> columns so other output fits better (for example of 'ls'); of course
> I don't want to type behind column 72 when writing e-mail because
> I'm old and understand how mail should be written (only ASCII and
> only up to column 72; the 80 column punch cards have been my friends
> and my first input media to computers in the 70's :-))
> 
> Well, is there some way to draw a magic vertical line in the xterm or
> 'vim' in column 72?

Not easily I am afraid.

You can let vim wrap automatically, whenever you reach a certain
column. This can be set using :set textwidth. My vim comes with a
filetype plugin mail.vim which sets the textwidth automatically to 70,
whenever vim recognizes a mail (and it already recognizes all of mutt's
mails out of the box).

In case you want to reformat your mail, you can use the gq command. So
gqap will reformat you current paragraph, while gqG will reformat
from the current line till the end of the mail and gggqG will reformat
the whole buffer.

Additionally you can have vim highlight all columns where the line
exceeds a certain width. This can be done by using e.g.

:syntax match WarningMsg /\%>70v.*/

This will match all lines that have a width greater 70 columns.
Depending on your needs, you may want to substitute the 'v' with a 'c'
The String WarningMsg tells vim how to highlight the match. All
available groups can be displayed by :hi (So instead of WarningMsg you
could also use Error)

The guys at [EMAIL PROTECTED] may know if there are even more
possibilities to achieve what you want. Compared to them, I only know
very little about vim ;)

For references see the following help sections:
:h 'textwidth'
:h 'wrapmargin'
:h syntax
:h :hi

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE


  1   2   >