Re: mutt / OS X / smtp ??

2011-04-03 Thread Dennis Preiser
On Sun, Apr 03, 2011 at 09:08:08AM +0300, thierry stephan wrote:
 Mutt is working well, except to send emails !!!
 I try with :
 
 - smtp_url
 - set sendmail

mutt 1.5.21 on MacOSX 10.6.7 here with no problems. I use:

| set smtp_url=smtps://m...@example.com@smtp.example.com:465
| set smtp_pass=pass

If you set both, smtp_url and sendmail in your .muttrc, smtp_url
overrides sendmail.

| 3.263. smtp_url
| 
| Type: string
| Default: (empty)
| 
| [...]
| 
| Setting this variable overrides the value of the $sendmail variable.

Setting a not working smtp_url prevents mutt from sending mail,
regardless of a working sendmail command in your .muttrc.

Dennis


Re: mutt doesn't ask for passphrase

2011-12-03 Thread Dennis Preiser
On Sat, Dec 03, 2011 at 05:13:12PM +0100, Christoph Möbius wrote:
 I have a strange problem here that mutt doesn't ask me for the passphrase when
 I want to sign/encrypt a message.
 
 Signing/encrypting using a key that has no passphrase works fine, though.
 
 Actually mutt seems to ask in the background but the prompt immediately
 returns. Thus, I get an error when sending the message saying that I used a 
 bad
 passphrase. I use GnuPG with settings according to the mutt wiki:
 
 set pgp_sign_command=gpg --no-verbose --batch --output - --passphrase-fd 0 
 --armor --detach-sign --textmode %?a?-u %a? %f
 set pgp_encrypt_only_command=pgpewrap gpg --batch --quiet --no-verbose 
 --output - --encrypt --textmode --armor --always-trust --encrypt-to 
 0x42828A3B -- -r %r -- %f
 set pgp_encrypt_sign_command=pgpewrap gpg --passphrase-fd 0 --batch --quiet 
 --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor 
 --always-trust --encrypt-to 0x42828A3B -- -r %r -- %f

The following works for me:

set pgp_sign_command=gpg --no-verbose --batch --quiet --output - 
%?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f
set pgp_encrypt_only_command=pgpewrap gpg --batch --quiet --no-verbose 
--output - --encrypt --textmode --armor --always-trust -- -r %r -- %f
set pgp_encrypt_sign_command=pgpewrap gpg %?p?--passphrase-fd 0? --batch 
--quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor 
--always-trust -- -r %r -- %f

Dennis


Re: ACS characters in Terminal.app

2012-10-31 Thread Dennis Preiser
On Wed, Oct 31, 2012 at 08:52:08AM +, Jamie Paul Griffin wrote:
 / Dennis Preiser wrote on Tue 30.Oct'12 at 14:15:45 +0100 /
 
 On Mon, Oct 29, 2012 at 10:02:28PM -0700, Will Yardley wrote:
  The behavior can be seen here:
  http://soulrebels.com/mutt_threads.png
 
 This might be an issue with the font in Terminal.app. I use menlo 12 pt
 and the threading looks fine. Try a different font to see if the problem
 goes away. And make sure that no additional line spacing is set
 (Terminal.app - Preferences - Settings - Text - Change - Line
 Spacing).
 
 altering the line spacing shouldn't make any difference. I have changed that 
 for some of the different terminal.app profiles I have set up on my lion 
 machine and it doesn't affect the thread tree at all.

The Increase of the line spacing leads to gaps between the vertical
lines. At least at my Mac (10.8.2, Terminal.app Version 2.3 (309)):

Line spacing 1.0:

http://www.d--p.de/tmp/2012-10-31_Line_Spacing_1.0.png

Line spacing 1.3:

http://www.d--p.de/tmp/2012-10-31_Line_Spacing_1.3.png

Dennis


Re: GSuite

2019-06-25 Thread Dennis Preiser
On Tue, Jun 25, 2019 at 06:56:47AM +0100, Steve Karmeinsky wrote:
> set spoolfile = "+INBOX"
> set postponed = "+[Gmail]/Drafts"
> set trash = "=[Gmail]/Bin"

In addition, I've set "unset record". Sent mail will be shown under
'+[Gmail]/Sent Mail'.

Dennis


Re: ask-yes for sending?

2022-06-08 Thread Dennis Preiser
On Tue, Jun 07, 2022 at 08:31:50PM +0200, Marcus C. Gottwald wrote:
> 
> bwalton.22...@leepfrog.com asked (Tue 2022-Jun-07 10:26:50 -0500):
> 
>> Is there a way to configure my muttrc so that when I press "y" to send
>> the message, it will prompt for confirmation before actually sending?
> 
> In order to avoid accidentally sending a message because of fat
> fingers, I moved from using "y" to "Y":
> 
>bind compose y noop

I would use something like this to remind me why y is not working:

| macro compose y ":echo 'Use Y to send the message.'"

>bind compose Y send-message

Dennis


Re: index_format

2022-07-26 Thread Dennis Preiser
On Tue, Jul 26, 2022 at 08:30:27PM +0200, Fourhundred Thecat wrote:
>> On 2022-07-26 19:38, Dennis Preiser wrote:
>> set size_show_mb
>> index-format-hook size_flags "~z -1M" " "
>> index-format-hook size_flags "~z >1M" "%5c"
>> index_format="%{%Y-%b-%d %H:%M} %?X?(%X)&  ? %-25.25F  %.96s %> 
>> %@size_flags@"
> 
> thank you, that works beautifully. But "set size_show_mb" seems to have
> no effect. It still shows small size in KB.

Thats why I've used '-1M' and '>1M'. Only values obove 1MB will be
affected by size_show_mb. If you use, for example, '-100k' and '>100k',
values below 1MB will be shown as kB. At least that is how I understand
the documentation.

Dennis


Re: index_format

2022-07-26 Thread Dennis Preiser
On Tue, Jul 26, 2022 at 04:53:28PM +0200, Fourhundred Thecat wrote:
> I have following index_format:
> 
>  index_format="%{%Y-%b-%d %H:%M} %?X?(%X)&  ? %-25.25F  %.96s %> %5c"
> 
> I would like to make following change to the last column, where message
> size is shown:
> 
> 1) if message size is less than 0.1M, show empty column
> 2) if message size is more than 0.1M show message size, but always in
> megabytes (not kilobytes)
> 
> can somebody please advise how to do this?

You could try something like this:

set size_show_mb
index-format-hook size_flags "~z -1M" " "
index-format-hook size_flags "~z >1M" "%5c"
index_format="%{%Y-%b-%d %H:%M} %?X?(%X)&  ? %-25.25F  %.96s %> %@size_flags@"

Dennis


Re: Subject that ends with UTF-8, 85 or A0 �

2022-08-02 Thread Dennis Preiser
On Tue, Aug 02, 2022 at 04:04:07PM +0700, Đoàn Trần Công Danh wrote:
> On 2022-08-02 10:06:08+0200, Bastian  wrote:
>> On 02Aug22 15:52+0900, Kenichi Asai wrote:
>> > Would it be possible to somehow avoid this problem?  I cannot avoid
>> > creating e-mails with Japanese characters in Subject and this problem
>> > bugs me quite much.
>> 
>> I think I am not able to reproduce this behavior. I appended 0x52A0 to 
>> the subject line. Can you verify?
> 
> I can't reproduce either.

I can reproduce the issue. In vim the character 0x52a0 is still present:



After quitting vim, mutt displays the unicode replacement character
0xfffd instead of 0x52a0:



Finally, in the e-mail as such this character has completely
disappeared:



| % mutt -v
| Mutt 2.2.6 (2022-06-05)
| 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: Darwin 21.6.0 (arm64)
| ncurses: ncurses 6.3.20220625 (compiled with 6.3)
| libiconv: 1.16
| hcache backend: lmdb LMDB 0.9.70: (December 19, 2015)
| 
| Compiler:
| Apple clang version 13.1.6 (clang-1316.0.21.2.5)
| Target: arm64-apple-darwin21.5.0
| Thread model: posix
| [...]

Dennis


Re: Subject that ends with UTF-8, 85 or A0 加

2022-08-02 Thread Dennis Preiser
On Tue, Aug 02, 2022 at 12:39:06PM +0200, Bastian wrote:
> I see it in the subject now.
> There are two U+FFFD chars.
> 
>> | System: Darwin 21.6.0 (arm64)
>> | ncurses: ncurses 6.3.20220625 (compiled with 6.3)
>> | libiconv: 1.16
>> | hcache backend: lmdb LMDB 0.9.70: (December 19, 2015)
>> | 
>> | Compiler:
>> | Apple clang version 13.1.6 (clang-1316.0.21.2.5)
>> | Target: arm64-apple-darwin21.5.0
>> | Thread model: posix
>> | [...]
> 
> Maybe some local vim/encoding issues on darwin?

Maybe. Interestingly, if I change the subject via 's' before sending in
mutt and replace the two replacement characters with 0x52a0 it works.

Dennis


Re: [RFC] Remove additional spaces when quoting already-quoted lines

2022-08-07 Thread Dennis Preiser
On Fri, Aug 05, 2022 at 08:04:17PM +, Tim Chase wrote:
> On Thu, Aug 04, 2022 at 08:17:39PM +0200, Dennis Preiser wrote:
>> | def g:FixMailQuotes()
>> |# find first body line after headers
>> |var first_body_line = search('^$') + 1
>> |# compress quote marks
>> |while search('^>[> ]* >', 'w') > 0
>> |silent! s/> >/>>/e
>> |endwhile
>> |# add space after last '>' if none is present
>> |silent! :%s/^[>]*\zs>\ze[^> ]/> /e
>> |# place cursor at first line of body
>> |cursor(first_body_line, 1)
>> | enddef

> Not sure if you want it, but this reduces a bunch of that code
> to a one-liner
> 
> %s/^\(> *\)\+/\=substitute(submatch(0), ' ', '', 'g').' '
> 
> finding any quoted indentation, removing all the spaces from it,
> and tacking on one space at the end.
> 
> Additionally, I think that your first_body_line pair of lines can
> be reduced to just a raw search:
> 
> /^$/+

The idea here was that the following while loop, at least in the first
pass, starts searching after the headers and you don't have to search
for the end of the headers again after the loop. For a one-liner, i.e.
without a loop, this is of course no longer useful.

> reducing your function to:
> 
> def g:FixMailQuotes()
> %s/^\(> *\)\+/\=substitute(submatch(0), ' ', '', 'g').' '
> /^$/+
> enddef

For vim9script this has to be adapted slightly. A colon is needed before
a range and string concatenation now works with two dots instead of one.
Also, white space is required before and after the two dots.

Eventually, I now use this function:

def g:FixMailQuotes()
:%s/^\(> *\)\+/\=substitute(submatch(0), ' ', '', 'g') .. ' '
silent! :/^$/+
enddef

> Just in case you find it useful.

Yes indeed, thanks for sharing!

Dennis


Re: [RFC] Remove additional spaces when quoting already-quoted lines

2022-08-04 Thread Dennis Preiser
On Thu, Aug 04, 2022 at 08:17:39PM +0200, Dennis Preiser wrote:
> | set editor='vim-c ":call FixMailQuotes()"'
   ^

Unfortunately, a blank character was lost ...

| set editor='vim -c ":call FixMailQuotes()"'


Dennis


Re: [RFC] Remove additional spaces when quoting already-quoted lines

2022-08-04 Thread Dennis Preiser
On Mon, Aug 01, 2022 at 10:40:22AM +1000, raf via Mutt-users wrote:
> But if you want this behaviour (despite any ambiguity),
> mutt doesn't need to change. You can set the editor
> parameter to a script that modifies the quoted reply
> to your liking before invoking the real editor.
> Something like this perhaps:
> 
> #!/bin/sh
> 
> # Change "> > > blah" quotes to ">>> blah" before editing
> 
> perl -i -e '
> sub requote { my $s = $_[0]; $s =~ s/ >/>/g; $s; }
> while (<>) { s/^([> ]+)/requote($1)/e; print; }
> ' "$@"
> 
> ${VISUAL:-${EDITOR:-vi}} "$@"
> 
> Note that this script will cope with a mixture like "> >>> > >> blah"
> and make it consistent like ">>> blah". And it won't add a final
> space if there isn't one in the input.
> 
> I'm sure there's a better way to do it, but this'll do.

I use vim and have the following vim9script function in my vimrc:
 
| #---
| # fix mail quotes for mutt, e.g. '> >foo' -> '>> foo'
| # muttrc: set editor='vim -c ":call FixMailQuotes()"'
| # cursor placement only useful if edit_headers is set in mutt
| #---
| def g:FixMailQuotes()
|   # find first body line after headers
|   var first_body_line = search('^$') + 1
|   # compress quote marks
|   while search('^>[> ]* >', 'w') > 0
|   silent! s/> >/>>/e
|   endwhile
|   # add space after last '>' if none is present
|   silent! :%s/^[>]*\zs>\ze[^> ]/> /e
|   # place cursor at first line of body
|   cursor(first_body_line, 1)
| enddef

Not better, but gets along without perl (of course only if you use
vim). Quotes are merged and it is ensured that there is a space after
the last quote character.

'> >> >foo' becomes ' foo')

The cursor is set in the first body line after the headers. Yes, this
only makes sense if edit_headers is set in mutt.

In muttrc one has to set editor like this:

| set editor='vim-c ":call FixMailQuotes()"'

Maybe this inspires someone.

Dennis


Re: Subject that ends with UTF-8, 85 or A0 �

2022-08-02 Thread Dennis Preiser
On Tue, Aug 02, 2022 at 11:17:14PM +0700, Đoàn Trần Công Danh wrote:
> On 2022-08-02 13:07:42+0200, Dennis Preiser  wrote:
>> On Tue, Aug 02, 2022 at 12:39:06PM +0200, Bastian wrote:
>> > Maybe some local vim/encoding issues on darwin?
>> 
>> Maybe. Interestingly, if I change the subject via 's' before sending in
>> mutt and replace the two replacement characters with 0x52a0 it works.
> 
> I noticed that your email was send with Content-type's charset is
> us-ascii and Kenichi's email is iso-2022-jp.
> 
> Is it part of the problem? I.e. Editors think the text files is
> an us-ascii or iso-2022-jp encoded file, and convert non-interpretable
> characters to utf-8 replacement?

I don't think so. If the editor thinks the file is us-ascii, then it
must not insert a UTF-8 replacement character.

Furthermore, this only happens if the character in question is at the
end of the subject. If it is at the beginning or somewhere in the middle
of the subject everything is fine. In other words, if the subject
consists of two 0x52a0 (Subject: 加加), the first one remains intact and
the second one is replaced by the UTF-8 replacement character.

Dennis


Re: Subject that ends with UTF-8, 85 or A0 e.g.:

2022-08-02 Thread Dennis Preiser
On Tue, Aug 02, 2022 at 08:55:53PM -0700, Kevin J. McCarthy wrote:
> -  while (ISSPACE (*buf))
> +  while (is_email_wsp (*buf))

I was also able to reproduce the issue (on macOS) and can also confirm
that with this patch, the issue no longer occurs.

Dennis


Re: Macro variable with current folder name?

2023-03-11 Thread Dennis Preiser
On Sat, Mar 11, 2023 at 01:05:13PM -0500, José María Mateos wrote:
> On Sat, Mar 11, 2023 at 06:15:14PM +0100, Dennis Preiser wrote:
>> 
>> folder-hook . 'set my_record=$record; \
>> set record=^; \
>> macro index,pager G "echo $record"; \
>> set record=$my_record'
> 
> Thanks for your suggestion. I tried this:
> 
> folder-hook . 'set my_record=$record; \
> set record=^; \
> macro index,pager G "!offlineimap -o -l /tmp/offlineimap.log -f $record\n" \
> "Retrieve new IMAP messages for current folder"; \
> set record=$my_record'
> 
> However, I got an error that leads me to think that the parameter $record is
> not being received on the other side. Perhaps I should surround the variable
> name with something so that the shell recognizes it?

When I use the following macro inside the folder-hook (I don't have
offlineimap)

macro index,pager G "!/bin/echo $record\n"; \

and then press G in my inbox I got

| =INBOX.INBOX
| Press any key to continue...

Just to be sure: You don't have another macro "macro index,pager G ..."
behind the folder-hook?

Dennis


Re: Macro variable with current folder name?

2023-03-11 Thread Dennis Preiser
On Sat, Mar 11, 2023 at 09:19:22AM -0500, José María Mateos wrote:
> I have this macro:
> 
> macro index,pager G "!offlineimap -o -l /tmp/offlineimap.log\n" "Retrieve new 
> IMAP messages"
> 
> It works well, but I typically use only for =INBOX, so checking all the
> folders (the default behaviour) is a waste. I've been trying to find if
> there's any way to pass only the current folder name in the macro. Something
> like
> 
> macro index,pager G "!offlineimap -o -l /tmp/offlineimap.log -f 
> $FOLDER_NAME\n"
> 
> I haven't been able to find anything like that. I've found some old
> solutions online[1] but they look slightly cumbersome; I'd like to set up
> just one macro, not several (I could have one for the INBOX and another one
> for all folders, though, but still, it's two macros). Also, they're old
> responses, and mutt has changed since then.

There is a "current mailbox" shortcut '^'. However, this expands only
for mailbox variables. You could use $record temporarily for the macro
and then set it back to the old value (here with echo to see what ends
up in the variable):

folder-hook . 'set my_record=$record; \
   set record=^; \
   macro index,pager G "echo $record"; \
   set record=$my_record'

Dennis


Re: Macro variable with current folder name?

2023-03-11 Thread Dennis Preiser
On Sat, Mar 11, 2023 at 07:30:13PM +0100, Dennis Preiser wrote:
> Just to be sure: You don't have another macro "macro index,pager G ..."
> behind the folder-hook?

This question is nonsense, the folder hook would overwrite it.

Dennis


Re: [OT] Terminal redraw issues / isync launchctl job in macOS 13.5

2023-08-07 Thread Dennis Preiser
On Mon, Aug 07, 2023 at 03:47:53PM +0200, Jan Eden via Mutt-users wrote:
> I recently upgraded to macOS 13.5, and for the first time, there are
> redraw issues in the Terminal with mutt (2.2.10, installed via
> Homebrew). Also, the launchctl job for isync/mbsync (1.4.4, also
> installed via Homebrew) fails since the upgrade.
> 
> Has anyone else experienced similar issues with macOS 13.5?

With homebrew, mutt is linked against the ncurses supplied with macOS.
This version is relatively old.

| % /usr/bin/ncurses5.4-config --version --abi-version
| 5.7.20081102
| 5.4

I don't use homebrew but I use mutt with a self-installed ncursesw and
have no issues.

| % mutt -v | grep 'Mutt 2\|ncurses'
| Mutt 2.2.10 (2023-03-25)
| ncurses: ncurses 6.4.20230603 (compiled with 6.4)

Maybe it is sufficient to install a newer ncurses with homebrew.

Dennis


Re: Re: [OT] Terminal redraw issues / isync launchctl job in macOS 13.5

2023-08-07 Thread Dennis Preiser
On Mon, Aug 07, 2023 at 06:16:39PM +0200, Jan Eden via Mutt-users wrote:
> On 2023-08-07 16:29, Dennis Preiser wrote:
>> Maybe it is sufficient to install a newer ncurses with homebrew.
> 
> Even with ncurses 6.4 installed, homebrew delivers a mutt version linked
> against ncurses 5.7.

Not surprising. You must somehow tell homebrew that for mutt
--with-curses=PATH/TO/HOMEBREW/ROOT is necessary.

Dennis


Re: Re: Re: [OT] Terminal redraw issues / isync launchctl job in macOS 13.5

2023-08-10 Thread Dennis Preiser
On Thu, Aug 10, 2023 at 08:14:23AM +0200, Jan Eden via Mutt-users wrote:
> On 2023-08-07 19:18, Dennis Preiser wrote:
>> Not surprising. You must somehow tell homebrew that for mutt
>> --with-curses=PATH/TO/HOMEBREW/ROOT is necessary.
> 
> Tried that, and it worked (up to a point). Compiling mutt with the
> following options
> 
> ./configure --enable-hcache --with-curses=/opt/homebrew/opt/ncurses 
> --with-tokyocabinet=/opt/homebrew/opt/tokyo-cabinet
> 
> eliminates the redraw issue (using the current ncurses version), but
> when I try to add gpgme –

It would be worth a try to change the mutt formula locally.

| brew edit mutt

Then add

depends_on "ncurses"

where the depends are and add

"--with-curses=#{Formula["ncurses"].opt_prefix}"

to the configure options. Save and reinstall mutt

brew reinstall mutt

This should install mutt with the edited, locally cached formula. Since
I don't use homebrew myself I don't know if this is lost in a brew
update.

Dennis


Re: Strange problem on new system with versus (or linefeed versus carriage return)

2024-05-09 Thread Dennis Preiser
On Thu, May 09, 2024 at 04:24:56PM +0100, Chris Green wrote:
> I have the following in muttrc so that hitting 'Enter' (the CR key) on
> the keyboard sends an E-Mail after composing it:-
>
> bindcompose \n send-message # rather than 'y'
>
> This works as intended on the old system but not on the new system, it
> would seem that mutt sees the 'Enter' key as CR (0x0d) on the new
> system whereas on the old system it sees it as LF (0x0a).
> Can anyone explain why this is and, more to the point, tell me how to

>From the documentation:

| 6.2. Enter versus Return
| 
| Prior to version 2.2, Mutt used a default ncurses mode (“nl()”). This
| mode maps keyboard input of either  or  to the same
| value, which Mutt interpreted as  internally.
| 
| However, starting in version 2.2, this mode is turned off, allowing
|  and  to be mapped separately, if desired. The default
| keyboard mappings set both, but you can override this or create new
| bindings with one or the other (or both).
| 
| Note that in terminal application, such as Mutt,  is the same as
| “\n” and ^J; while  is the same as “\r” and ^M.

> fix it?


 bindcompose \r send-message # rather than 'y'

Dennis