Re: Conditional configuration

2016-01-28 Thread Gabriel Philippe
On Thu, Jan 28, 2016 at 3:35 AM, martin f krafft  wrote:
> Hi,
>
> I have two machines with mutt, one has the sidebar patch, while the
> other does not. I'd like to use the same config on both, but
> obviously the one without the patch falls over the sidebar keywords,

I use one main conffile, and another dedicated for each machine.

In ~/.mutt/muttrc:
source ~/.mutt/muttrc_`hostname`

-- 
Gabriel


Re: delayed variable expansion within macro

2016-01-29 Thread Gabriel Philippe
On Tue, Oct 27, 2015 at 5:45 PM, Raph  wrote:
> The issue is the expansion of $from which happens during the evaluation of the
> double-quoted string. This is too soon. It would have to be delayed to after 
> `source`
> has been evaluated so that $from takes the new and expected value.

Hi Raph,

I remember having wanted to delay the evaluation of variables. My
problem was something like
> set my_old_editor=$editor
> (...)
> set editor=$my_old_editor
Don't remember if I managed... Probably not.

However, you could try hooks. I'm pretty sure "$my_default_from" below
will be evaluated when the hook occurs. Maybe send-hooks in your case.
> folder-hook . 'set from="$my_default_from"'

-- 
Gabriel


Using a sendmail replacement?

2016-02-20 Thread Gabriel Philippe
Hi,

I would like to combine the immediacy of using $sendmail to send
e-mails from mutt with the flexibility of $smtp_url. I want to select
a different smarthost (ISP/webmail/whatever), depending on hooks,
without having mutt waiting for the message to be sent, and without
having configuration outside of my $HOME.

I found nullmailer, but it is designed for a system-wide use:
conffiles in /etc/, stuff in /var, etc. I'm not sure I would manage to
have it work differently.

Any idea?

-- 
Gabriel


Re: Using a sendmail replacement?

2016-02-20 Thread Gabriel Philippe
On Sat, Feb 20, 2016 at 9:40 PM, Cameron Simpson  wrote:
> Me too. I run postfix as the local mail system on this Mac and have mutt
> deliver to it.
>
> Having your local machine mail system working is very useful - you can send
> messages while offline and they will be queued and go out when you're next
> online. For example, when catching up on email on a train.

I do use exim and experience all of that. :)


> It does require config outside your homedir, but on the other hand your
> machine's mail system is then useful.
>
> Can you outline what kind of criteria you would want to use in your hooks?

That's the point. I don't want personal configuration outside of my
$HOME (such as SMTP password). Depending of the recipient or the
folder I'm in, I want to set which SMTP server, password, $from to
use. This can be done easily by using mutt's SMTP capabilities and
dynamically changing $smtp_url, but I would prefer using different
$sendmail.

What I need is an external program to get the message to deliver, with
queue management (that's tricky), and every configuration and
temporary files within my $HOME. Best of 2 worlds. :)

-- 
Gabriel


Re: Using a sendmail replacement?

2016-02-21 Thread Gabriel Philippe
On Sun, Feb 21, 2016 at 11:47 AM, Andreas Doll  wrote:
> On 2016-02-21 at 12:59, li...@2ion.de wrote:
>> I am using msmtp[1] for this. You can keep its configuration entirely in 
>> $HOME.
>
> I second that, msmtp works fine for me in the described setting. Note that it
> only works online, for offline usage see [1].
>
> [1]https://wiki.archlinux.org/index.php/MSMTP#Using_msmtp_offline

Thanks, I will test that. I need offline (and more generally I want
send-and-forget from mutt, without delay for DNS request, etc.).

-- 
Gabriel


Re: decoding UTF-8

2016-03-15 Thread Gabriel Philippe
On Mon, Mar 14, 2016 at 10:30 PM, Jon LaBadie  wrote:
> I frequently find headers (mostly Subject, but also From/To)
> that I assume are some representation form for a UTF-8 encoded
> string as they start with "=?UTF-8?" and end with "=?= ".
> For example:
>
>   To: =?UTF-8?B?Z3VuZGk=?= 
>
> Is my assumption correct?  What is the representation called?
> Is there a tool to regain the original string?
> I believe my video system can display the larger
> character set.

Quite funny, I spent some time on it yesterday...

This is rfc2047 encoding [1]. It can probably use other charsets (not
only UTF-8).

The best way I found is to pipe it through perl -MEncode -ne 'print
encode("UTF8",decode("MIME-Header",$_))'. But if Ionel's explanation
is correct, a simple regexp and base64 -d would be quicker. Don't
hesitate to give us feedback. :)

[1] https://www.ietf.org/rfc/rfc2047.txt

-- 
Gabriel


base64 encoding of full message body?

2016-03-20 Thread Gabriel Philippe
Hi,

I'm sick and tired of seing the PGP signatures of my messages to Yahoo
groups invalidated. Yahoo groups thinks it is a good idea to split
"long" lines, but that changes the message body. I tried to limit the
maximum size of the lines in my messages, and that works most of the
time. But quoted lines needs to be rewrapped (because they get longer
due to the addition of "> "), and as I write in French, non ASCII
characters are encoded in quoted-printable, which can greatly increase
the length of the lines.

It seams that (all?) messages from the Yahoo groups interface
("X-Mailer: Yahoo Groups Message Poster") are fully base 64 encoded.
"Content-Type:  text/plain;  charset=utf-8
Content-Transfer-Encoding: base64"

Is it possible to force this behaviour in mutt? I would limit it to
messages sent to Yahoo groups.

-- 
Gabriel


Re: base64 encoding of full message body?

2016-03-30 Thread Gabriel Philippe
On Sat, Mar 26, 2016 at 1:33 PM, Erik Christiansen
 wrote:
> On 20.03.16 11:48, Gabriel Philippe wrote:
>> It seams that (all?) messages from the Yahoo groups interface
>> ("X-Mailer: Yahoo Groups Message Poster") are fully base 64 encoded.
>> "Content-Type:  text/plain;  charset=utf-8
>> Content-Transfer-Encoding: base64"
>>
>> Is it possible to force this behaviour in mutt? I would limit it to
>> messages sent to Yahoo groups.
>
> Perhaps it would be possible to use a send2-hook to change $sendmail to
> interpose a base 64 encoding utility, such as "base64" or "mimencode -b".
> It would be necessary to use it via formail, to process only the body,
> though. ;-)

Nice idea, but this utility would also have to remove, recreate and
add the PGP signature, thus be quite complex. Patching mutt would
probably be more clever, I'm adding that to my next life's todo list.
:)

I'm thinking about a workaround: in the editor, rewrapping all lines
to be very short just before saving. Never mind for those who don't
understand format=flowed.

-- 
Gabriel


Re: base64 encoding of full message body?

2016-07-07 Thread Gabriel Philippe
On Sun, Mar 20, 2016 at 11:48 AM, Gabriel Philippe
 wrote:
> Hi,
>
> I'm sick and tired of seing the PGP signatures of my messages to Yahoo
> groups invalidated. Yahoo groups thinks it is a good idea to split
> "long" lines, but that changes the message body. I tried to limit the
> maximum size of the lines in my messages, and that works most of the
> time. But quoted lines needs to be rewrapped (because they get longer
> due to the addition of "> "), and as I write in French, non ASCII
> characters are encoded in quoted-printable, which can greatly increase
> the length of the lines.
>
> It seams that (all?) messages from the Yahoo groups interface
> ("X-Mailer: Yahoo Groups Message Poster") are fully base 64 encoded.
> "Content-Type:  text/plain;  charset=utf-8
> Content-Transfer-Encoding: base64"
>
> Is it possible to force this behaviour in mutt? I would limit it to
> messages sent to Yahoo groups.

I've found an ugly hack.

macro compose y "^Ubase64"

If someone founds a better way...

-- 
Gabriel


Re: need some help about organize message in mutt

2016-08-04 Thread Gabriel Philippe
On Tue, Aug 2, 2016 at 1:00 PM, Erik Christiansen
 wrote:
> Subscribing to the procmail mailing list would help while learning.

Does it still exist? procmail.org is down for several months.

>From the manual page of procmail: "There exists a mailinglist for
questions relating to any program in the procmail package:
 for subscription requests.".
Hoewever:
550 5.1.1 : Recipient address
rejected: User unknown

-- 
Gabriel


Re: need some help about organize message in mutt

2016-08-06 Thread Gabriel Philippe
On Sat, Aug 6, 2016 at 8:10 AM, Erik Christiansen
 wrote:
> Ah, yes, a DNS "dig" on procmail.org fails, and a visit to:
> http://www.procmail.org/   gives:
> "Site hosting in transit, information will be back up shortly."

According to archive.org, this has not changed since at least the
beginning of 2016.


> However, from the headers of a recent list post we have:
>
> List-Subscribe:
> ,
> 

Well, this is a German university and probably not official, but at
least I'm now there and have said "hi". Thanks Erik!

-- 
Gabriel


Re: Place forwarded messages in thread

2016-08-09 Thread Gabriel Philippe
On Fri, May 29, 2015 at 1:43 PM, Gabriel Philippe
 wrote:
> On Mon, Apr 13, 2015 at 2:15 PM, max  wrote:
>> Dear Mutters,
>>
>> When I forward an email, it is simply placed in the folder where I sent
>> the email from. I use:
>> folder-hook . 'set record=^'
>>
>> I would prefer it if the forwarded message were threaded to the original
>> message. Currently I have to tag the forwarded message, move to the original
>> message and hit '&' to make the forwarded message a 'child' of the original.
>>
>> I hope that makes sense.
>>
>> Is there a setting or macro that will take care of this for me?
>>
>> Thank you in advance,
>> Max
>
>
> I haven't seen any answer to this question. Any idea someone?
>
> I would really appreciate such a feature (which seems to be implemented in
> Thunderbird). Almost each time I forward an e-mail, I manually attach the
> forwarded version to the thread, wich is quite annoying.
>
> --
> Gabriel

Hi,

I'm still wondering why mutt behaves differently from other MUA on
this matter. Though it is possible when forwarding to manually add a
In-Reply-To header based on the forwarded Message-ID, that's more
difficult for References, and quite annoying to do manually.

RFC822 states these headers as optional, but does not indicate whether
it should relate to replies and forwards. To my understanding, both
can apply. "The contents of this field identify previous
correspondence which this message answers."

References about other MUA:
https://bugzil.la/583587
https://github.com/roundcube/roundcubemail/issues/4465
https://support.office.com/en-us/article/Change-how-the-original-message-appears-in-replies-and-forwards-1207f4ea-f7cf-4cdf-9298-5982fa2e5e2f

-- 
Gabriel


[SPAM?] Open message in new window

2016-08-10 Thread Gabriel Philippe
Hi,

The macro below works as expected:

macro index,pager \ec
'=temp.mboxx-terminal-emulator
-e "mutt -f =temp.mbox " &' 'open message in new window'

However, I have not managed to add "-e
" in mutt's command line. I first
struggled with quoting, then noticed than even replacing "mutt ..." by
a shell script does not work either. Any idea?

-- 
Gabriel


[SPAM?] Re: Open message in new window

2016-08-10 Thread Gabriel Philippe
> However, I have not managed to add "-e " in 
> mutt's command line.

I meant -e push '<...'

-- 
Gabriel


[SPAM?] send2-hook can't change Reply-To

2016-08-24 Thread Gabriel Philippe
I have been using send-hooks to add reply-to headers.

send-hook . unmy_hdr 'Reply-To:'
send-hook "~C l...@whatever.tld" my_hdr 'Reply-To: l...@whatever.tld'

This works (and maybe shouldn't, according to the manual). But I would
like using send2-hooks instead, and... no success. I have tried
removing "~C " in the hook (pattern/regexp matching).

>From the manual: "Also note that my_hdr commands which modify
recipient headers, or the message's subject, don't have any effect on
the current message when executed from a send-hook."

Any idea?

-- 
Gabriel


Re: send2-hook can't change Reply-To

2016-08-26 Thread Gabriel Philippe
On Wed, Aug 24, 2016 at 10:48 PM, Michael Elkins  wrote:
> On Wed, Aug 24, 2016 at 01:28:22PM +0200, Gabriel Philippe wrote:
>>
>> From the manual: "Also note that my_hdr commands which modify
>> recipient headers, or the message's subject, don't have any effect on
>> the current message when executed from a send-hook."
>
>
> The manual is correct on this point.  send2-hook can't be used to modify the
> message header, because Mutt is not smart enough to be able to avoid
> overwriting modifications the user may make in their editor.

I understand, thanks for your answer.

Maybe the manual is not accurate:
- it should indicate send2-hook and not send-hook,
- it should not only limit the remark to "recipient headers" and "subject".

-- 
Gabriel


list-reply without Cc?

2016-08-29 Thread Gabriel Philippe
Hello,

Is there a way to reply to a subscribed list without anybody in copy?
I often receive messages from someone not subscribed, then want to
answer to the list only (and sometimes forget to remove the people in
Cc).

-- 
Gabriel


Re: list-reply without Cc?

2016-08-30 Thread Gabriel Philippe
Thanks Ben, but I realize my question was not accurate. I am
disappointed by having recipients in Cc when I use list-reply on my
own messages (match alternates).

Ex:
- I am subscribed to a list (with mutt's subscribe command),
- I have sent a message to A (not in the list), Cc the list and B,
- I want to list-reply my own message, to add some remarks to the list only.

In this case the defaults recipients after list-reply are:
To: the list
Cc: A, B

A and B are not supposed to read my remarks, and I sometimes forget to
remove them (no need to do it when list-replying other people'
messages). I have not found an option to change this behaviour, and
can't think of a not-too-dirty macro.

I don't know if this is relevant: the list is not a real list with
appropriate headers, and most of the people use poorly-designed MUA
(no Mail-Followup-To, etc.).

-- 
Gabriel


Re: saved or deleted?

2016-08-31 Thread Gabriel Philippe
On Wed, Aug 31, 2016 at 8:42 AM, Jon LaBadie  wrote:
> Rephrasing, how can I tell if a deleted message has been copied?
>
> Currently, if I am uncertain I have to copy it just in case and
> in the future, delete the duplicate if I created one.

Not what you want, but if you have mutt with the trash feature, it can
be useful.

If you have deleted a message, it will be moved to the trash, thus if
you have inadvertently deleted it you can get it back. But if you have
moved it somewhere else, it will not go to the trash.

-- 
Gabriel


Re: can't read sent encrypted mail

2016-10-10 Thread Gabriel Philippe
On Sat, Oct 8, 2016 at 1:28 AM, Kevin J. McCarthy  wrote:
> Add 'unset crypt_use_gpgme' to your muttrc, to start using your
> pgp_encrypt_sign_command again.

Mutt in Debian (ie Neomutt) also has a pgp_encrypt_self quadoption.

"Default: no
Encrypt the message to $pgp_sign_as too. (PGP only)"

-- 
Gabriel


mark_old as a quadoption?

2016-12-20 Thread Gabriel Philippe
It seems to me I saw, many years ago, questions when I was leaving
folders: "Mark unread messages as old?".

mark_old is currently a boolean. Has it ever been a quadoption? (I
would prefer that way)

-- 
Gabriel


Re: mark_old as a quadoption?

2016-12-22 Thread Gabriel Philippe
On Tue, Dec 20, 2016 at 12:32 PM, Gabriel Philippe
 wrote:
> It seems to me I saw, many years ago, questions when I was leaving
> folders: "Mark unread messages as old?".

It was rather "move unread messages to...". I will use hooks to change
$mark_old.

-- 
Gabriel