Re: Creating HTML emails with mutt

2019-11-02 Thread Patrice Levesque

> […] virtually all of the people who use mutt either as their only
> email client or along with others, chose mutt because of its
> simplicity.

People who want a simple text mail client will use Alpine or similar.
Mutt's possibly the most “complicated” text MUA.

I don't use mutt because of its “simplicity”, I use it because of its
power and flexibility.

And I'm closely following this thread because I'm one of the “strange”
people who'd _like_ mutt to be able to handle outgoing multipart
messages; I was trying to achieve exactly that, three years ago:
https://www.mail-archive.com/mutt-users@mutt.org/msg50518.html


> It seems to be contrary to the direction and purpose of mutt to make
> it do everything anybody wants.

The current number of configuration options suggests otherwise, and mutt
would lose most of its appeal for me if it trimmed down the number of
options.


> The harm of making the app more complicated and adding a lot of code
> is real, and it directly affects the user of mutt whether he's new or
> old.

There are dozens of mutt options I turn off, yet I won't argue they need
to be removed just because they're not part of _my_ use case.  I can
appreciate everyone's needs are different and what works best for me
will likely not work best for everyone.



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: gpg: can't query passphrase in batch mode (after upgrade of Mutt)

2019-06-18 Thread Patrice Levesque

> If you see this mail PGP-signed, then your advice has helped, thank
> you!

Mail was PGP-signed and my own mutt recognized it as such.



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: Holy Grail (multipart/alternative + HTML + inline images + GPG)

2017-01-26 Thread Patrice Levesque

Michelle,


> Currently not possibel, because the script is on my server @home which
> I can not access trough the Internet and I work currently 600km far
> away.

Would've been neat, but I think you gave me enough pointers so far that
I can manage on my own for a bit.  Thanks again for your time and
extensive answers.



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: Holy Grail (multipart/alternative + HTML + inline images + GPG)

2017-01-26 Thread Patrice Levesque

>> [MIME message structure description]
> Are you sure, you have closed every part properly?

I used the swiftmailer library to construct the mail and mutt properly
recognizes the parts when it receives the mail via a bounce, so I
suspect the mail is well-formed but of course there might be subtleties.


> I do some things similary, BUT I use commandline tools,  to  create
> the multipart/alternative  and  then  I  move  the  complete  file  to
> the ~/Maildir/.Drafts/new/ folder, where mutt can find  it  if  I
> recall  a message.

I'm happy it seems to work for you, and that the problem's probably in
my chair.  Would you be kind enough to send me a direct email to
mutt.wa...@ptaff.ca using your method? That may help me figure out
what's so different between your mail structure and mine.

Just out of curiosity, when you recall the message, does the editor show
only the text/plain part? It seems I always get an improperly unwrapped
version of the multipart/alternative part.  And when you exit the
editor, are you saying all MIME parts left unchanged?


> You can use sendmail or ssmtp to send the file without using mutt.  It
> is much easier, specially from a script.

I get that, but I'd prefer dealing with GPG inside mutt, I want to avoid
recreating mutt's perfectly fine interface for it (selecting keys for
instance).


Thanks, and have a nice day,



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Holy Grail (multipart/alternative + HTML + inline images + GPG)

2017-01-25 Thread Patrice Levesque

Hi.

This subject has been discussed many times over the years, and I'm
having a go at it.

Because mutt's native support for multipart/alternative seems
insufficient for what I'm trying to achieve, I'm aiming to get this
flow:

1) Use mutt (write text/plain mail, set mail headers (recipients,
subject, others) and handle file attachments).

2) [Message pushed somewhere, via a mutt macro, that could save
locally in a mailbox, or pipe to a file, or anything: mechanism does
not really matter to me].

3) Message is massaged by a script that rebuilds the MIME sections
of the mail, adding a text/html section (transcoding text/plain via
Markdown or other tool) and adding related HTML inline images (for
signature).  MIME structure becomes:

- multipart/mixed
- multipart/alternative
- text/plain
- multipart/related
- text/html
- inline image
- attachments

4) Message returns to mutt, which handles GPG, archiving to
appropriate Fcc, sending out for transport.

Now my blocker comes from (4).  No matter if I try to `recall-message`
(Shift-R), `resend-message` (Esc-e) or mutt's `-H` option, the
multipart/alternative part gets corrupted by mutt.  I'm trying to tell
mutt “Please just send it as it is”.  `bounce-message` (b) leaves mail
structure intact but of course modifies recipients.

Any possible way to achieve that “send as is” behaviour, or do you guys
know any patch in the wild that would allow that?

Thanks,



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: standard input

2016-05-24 Thread Patrice Levesque


> If I remove the ^ from Inês in m_inmail.list, I got the correct way:
> […]
> So, I will need to remove all sign from my m_inmail.list? Are there
> some way to by pass this?

The software you're using to edit m_inmail.list (a text editor?)
probably adds a BOM at the beginning of the file; try configuring that
software not to add a BOM or just manually remove it yourself; lots of
different ways to accomplish that on:
http://stackoverflow.com/questions/204765/elegant-way-to-search-for-utf-8-files-with-bom



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: standard input

2016-05-23 Thread Patrice Levesque

> standard input 

Just a hunch, but this looks like what `grep` spits out when fed a
binary stream; many lbdb commands use `grep` internally.  You may try
directly grepping in your file to see if you get the same message, by
searching for something you know is in your addressbook, like:

grep email_address /home/user/.lbdb/m_inmail.list

If so, you may want to check that m_inmail.list file and look for
garbage characters in it; alternatively, some `grep` variants have a
flag to treat binary as text; GNU `grep` has --binary-files=text and
other variants probably have something similar; check your `grep`
manpage to see how to apply this to your situation, if needed.



-- 
· Patrice Levesque
· http://ptaff.ca/
· mutt.wa...@ptaff.ca
--



signature.asc
Description: Digital signature


Re: Format flowed equals no space in depth 1

2014-09-16 Thread Patrice Levesque

 The message is that not everyone has time to become an expert in how
 e-mail works fundamentally, and not everyone should.  In fact, just
 about no one should.  This is what specialization is all about, and
 like it or not our society has become extremely specialized.

No, I'm sorry, the specialization idea does not float.  E-mail has
become as popular as car driving.  I agree you don't need to know
mechanics nor combustion physics to operate a car.  Nonetheless you must
invest tens of hours to learn how to drive it properly, many of them
only to allow fluid interactions with other drivers, as we all share
roads; red lights, yield signs, school buses and all.

Many people will spend many more hours dealing with e-mail than at the
wheel but hey, they can get away with half-garbage e-mails so why should
they bother?

I mean, what's *so* hard about spending 10 hours once to learn to
properly use something that you'll enjoy every day for the rest of your
life?



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: go to an email from external program

2014-05-13 Thread Patrice Levesque

 I'm using mutt in a desktop environment, would like to know if there's
 a way (any) to make mutt go to a specific email from an external
 program/script, mutt could be in a different mailbox, ideally this
 should change too.

I believe you mean “Is there a way to control an already-running mutt
instance so that it goes to a specific mail message”?

One way to do it would involve running mutt in either tmux or screen,
and use them as a keyboard input proxy.  You can send keypresses to an
already running program using “tmux send-keys” or “screen -X stuff” (see
their manpage for details, or examples on ServerFault¹).

But that's the easy part.  The real tricky part is to find a safe
sequence of keypresses to go to a specific message, no matter what the
current context of mutt is (pager, index, ...).  What if you're in the
middle of composing an e-mail in mutt? should mutt discard your message
to switch to your specific e-mail? what if you're currently in an
external editor or shell?

Unless somebody comes up with something really clever, I'd strongly
suggest you consider spawning a different instance of mutt instead;
much, *much* simpler and foolproof.


1) 
http://serverfault.com/questions/178457/can-i-send-some-text-to-the-stdin-of-an-active-process-running-in-a-screen-sessi/547144#547144



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: go to an email from external program

2014-05-13 Thread Patrice Levesque

 I know how to search the message but what a good mutt macro to change
 the mailbox given the mailbox path?

You can change the current mailbox using its filesystem path directly,
if that's what you mean. (e.g. in index, press 'c' then the full path to
your mailbox).


 I think would be reasonable while is idling on index/pager (wondering
 if there's a way to check if the mutt process is in foreground)

I'd dare guess that if mutt has spawned a shell or an external editor,
`pgrep -P $(pidof mutt)` will return TRUE.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: inline html viewing coding system

2013-06-03 Thread Patrice Levesque

 is there a way to configure mutt to consider the charset for
 displaying inline html?

Not that I know of; I use a simple wrapper script for that (I use lynx,
adjust options accordingly), using isutf8 (part of moreutils):

isutf8 ${1}  /dev/null \
 lynx -assume_charset=utf-8 -display_charset=utf-8 -dump -force_html 
${1} \
|| lynx -display_charset=utf-8 -dump -force_html ${1}



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: 256 colors, autoview and control codes

2013-01-30 Thread Patrice Levesque

 [...] the switch to slang did not fix nor help the 256-color
 ANSI-display issue.

Issue filed as ticket #3631: http://dev.mutt.org/trac/ticket/3631



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Inbox not updated

2013-01-30 Thread Patrice Levesque

 My problem is that all Maildir folders are updated automatically when a
 new email is received, but my Inbox doesn't show updates. To see new
 email I have to quit mutt and re-open it.
 
 What I'm doing wrong?.

See this entry from the FAQ, might provide you a hint or two:
http://dev.mutt.org/trac/wiki/MuttFaq/Folder#Whyarenewflagsofmboxfolderswronginfolder-listview



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque

Hi.

I'm happily using gentoo's mutt-1.5.21 with a 256-color terminal,
mostly under tmux.  My mutt colorscheme uses 256 colors and they are
showed perfectly.

I'd like to display image previews using unicode block characters,
in the mutt pager, using something like img2xterm
[https://github.com/rossy2401/img2xterm#] in conjunction with a
proper mailcap entry.

Outside of mutt, img2xterm displays the image in full 256 colors.
Inside mutt, it seems the escape codes for 256 colors don't get
recognized and blinking block junk gets displayed instead.
allow_ansi is turned on in .muttrc and the ANSI escape codes for
good ol' 16 colors work fine in a similar scenario.

Is there something I can do to make mutt recognize 256 color ANSI
codes inside its pager?

Also, is there a way inside mutt to strip the ANSI codes created by
an autoview-spawned command before relaying the message to an
external editor?

Attached to this mail is a typical 256-color ANSI-code output from
img2xterm.

Thanks,



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--
▄▄▄▄▄▄
 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
▄▄▄▄▄
 
▄▄▄▄▄▄
▄ 
▄▄▄▄▄▄▄▄▄▄
 ▄▄▄ 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
▄▄▄▄▄▄▄▄▄
 ▄▄▄▄ 
▄▄▄▄▄
 
▄▄▄▄▄▄▄▄▄▄
 ▄ 
▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
▄▄▄▄▄▄
 ▄▄
▄▄▄▄▄▄▄
 ▄▄▄ 
▄▄▄  
▄▄▄▄▄▄▄▄▄
 
▄▄▄▄
 ▄ 
▄▄▄
▄▀▀▀▀▄▄▄▄▄▄▄▄
  
▄▄▄

Re: 256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque


 Is your mutt compiled with ncurses or slang? I experienced that mutt
 can handle ANSI code better if it's compiled with slang ...

ncurses; the official gentoo ebuild does not give any compilation flag
to switch between slang and ncurses (plus the gentoo patchset seems to
assume ncurses is selected).


 I'm using my own live-ebuild though so I'm not sure how that is
 handled by the official ebuild. Feel free to ask for my local ebuild
 if there's any interest ...

I'd like that very much; thanks.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: 256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque

 Is your mutt compiled with ncurses or slang? I experienced that mutt
 can handle ANSI code better if it's compiled with slang ...

Unfortunately, though your ebuild works fine in other regards, the
switch to slang did not fix nor help the 256-color ANSI-display issue.
Thanks for trying.

Should I file a ticket?



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Google smtp Server Changes My From Address.

2012-09-25 Thread Patrice Levesque

 I'm really tempted to just go back to hosting my own email, but I
 don't feel like trudging through tons of spam every day.

If I may add my own 2¢, greylisting + a bayesian-filter-enabled
spamassassin does *really* prevent most of the junk from entering your
INBOX.  At the expense of slight delays for new sender-recipient-server
combinations, and very slight CPU usage, I find spam not to be a worry
anymore on a self-hosted mail server.  Situation violently improved
since 2002 :)



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: built-in pager and utf-8

2012-07-02 Thread Patrice Levesque


 Mutt's built-in pager does not seem to understand utf-8.
 Example copied from a gnu-emacs mailing list:
 [...]
   t₁ =  65536×h₁ + l₁
   0 ≤ h₁  65536
   0 ≤ l₁  65536

Both display here just fine under mutt-1.5.21-r9 (gentoo).

Make sure all the components of the displaying chain are set to UTF-8;
in mutt, you'll need to configure 'set charset=UTF-8'; your locale
must use UTF-8 (see the LC_* environment variables), your terminal
emulator must support UTF-8, and ultimately your font as well.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: header_cache compiled and enabled, but no caching

2012-04-18 Thread Patrice Levesque


 set header_cache=/home/epatton/.mutt_cache/
 (File permissions set to 666.)

Shouldn't that be 777?



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Seeding and updating mutt's header and body caches

2012-04-13 Thread Patrice Levesque

 [...] The first time you search the bodies of emails in a large imap
 folder it'll take an extremely long time as mutt downloads the bodies
 (including attachments) of all messages in the folder. The next times
 it will be much faster. [...]

Depends on your IMAP server; some can handle search *server-side*,
which gets rid of the need to “mirror” the message bodies locally.

Unfortunately, IMAP search only works with substrings, hence won't
handle regular expressions; nonetheless, search with “=b” instead
of “~b” and mutt will automagically switch to server-side search if
possible.


As for your original question, I believe a simpler way to help with IMAP
search speed would involve offlineimap (or similar) that'd mirror your
server locally.  Mutt would still need to cache the message bodies but
at least they'd already be stored on your machine, avoiding the server
round-trips involved in a search on a “yet unsearched” folder.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: How to change To: address programatically?

2012-01-16 Thread Patrice Levesque


 I need an automatic way of doing this so I can't miss it!  :-)

Trying to be creative: if you're using an external editor, a
search/replace can be spawned at that level; vim for instance will allow
you to execute commands prior to edition using the “-c” flag.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: hook to save all msgs in folder A to folder B?

2011-12-15 Thread Patrice Levesque


 Let's say I want to save to folder Spam.spam all the messages that
 have landed in folder Spam.unsure no matter who they're from or to.
 Or most, or even some of the messages.  [...] In other words I'm
 looking for a save-hook or fcc-save-hook based on specific folders
 alone, not on message properties, unless the message-properties
 applied to all messages.

The way I solved spam message manipulation does not involve hooks but
macros and might work for you.

First, I bind a save-to-spam-folder macro; in .muttrc:

macro index S s=Spam.spam\n
macro pager S s=Spam.spam\n

(“S” is arbitrary; by default bound to `skip-quoted` which I don't use).

So “Shift-S” moves the current mail message to the Spam.spam folder.

In my Spam.unsure folder, if I find no ham, I can flush everything by
matching all messages (“Shift-T“ then “.”, enter) then « S ».



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Address Book/Contacts utilities that work (well) with mutt - what's out there?

2011-12-14 Thread Patrice Levesque


 Yes, that's the way round I am really.  I want a good/comfortable
 contacts manager for lots of reasons other than using it with mutt,
 being able to extract E-Mail addresses to mutt is just a bonus.

I can't stress enough then that you *want* to build around a LDAP
server; maybe Horde won't float your boat but any respectable
addressbook application will be able to hook into LDAP.  Even Evolution
if you ever miss it someday ;)



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Address Book/Contacts utilities that work (well) with mutt - what's out there?

2011-12-13 Thread Patrice Levesque

 So, does everyone here use abook, or nothing, or just have all their
 E-Mail addresses in mutt aliases, or what?  Any suggestions would be
 very welcome.
 If I found something that could synchronize my (any) phone as well
 then I'd be *very* happy!  :-)

My current setup does just that.

- OpenLDAP acts as the addressbook container;
- Horde's Turba acts as a web-based data entry frontend;
- Horde's Turba can also deal with phone two-way synchronization
  mechanism (via ActiveSync), if you use Horde ≥ 4 and Turba ≥ 3.

The phone sync setup can easily accomodate calendars as well if you add
Horde's Kronolith.  You may also handle mail via Horde's Imp as a
web-based plan B (I like a shell environment on my cellphone but I
understand it's not everyone's taste, especially for those without a
physical keyboard; native smartphone mail apps often suck) and you could
even deal with mail filters (think procmail or sieve) using Horde's
Ingo.  My mail is stored in IMAP, don't know about your setup, so YMMV.

Turba works well enough (though clumsily) in a text-based browser like
ELinks if you want to add contacts without leaving the comfort of your
shell.

(No, this is not a Horde selling pitch! I'm getting back to the subject
at hand, now!)

Mutt accesses OpenLDAP via a thin shell script; my OpenLDAP server is
located thousands of miles away and the Ctrl-T completion seldom takes
more than 2 seconds.

Of course, all that may seem like overhead just to get e-mail address
completion, but I like to think of it the other way around; mutt fits in
*nicely* in that ecosystem ;)



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Firefox mailto: links not working correctly

2011-11-24 Thread Patrice Levesque

 attached a simple script that is use. set it executable and call this
 from firefox, not mutt directly

I believe there's no need for pyrotechnics :)

As mutt supports mailto: URLs natively, this suffices:

#!/bin/sh
exec xterm -e mutt $@



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Multiline mailbox entries [was Mutt (or Mutt-like) for Android?]

2011-10-21 Thread Patrice Levesque


 Using vim.. I recall folks have ported vi or vim to one of the early
 ipods and I can hardly imagine anything geekier short of using vim on
 a morse terminal.

I regularly use mutt/vim via connectbot (ssh client) on an android
phone, equipped with a physical keyboard, and it's not *that* bad.  Vim
being modal, thumb-typing works ok; all you need is a way to send Escape
and maybe Ctrl once in a while.

It ain't the most ergonomic way to work, but I'm pretty sure EMACS would
be worse :)

Makes me think, is there a patch somewhere or plans to make it possible
to get multi-line mailbox index entries in mutt? With very narrow
terminals (40 columns or such) it'd be something useful and even on a
regular 80-column term I'd surely prefer having the mail subject on its
own line.


Thanks,



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Translate emails to English

2011-10-21 Thread Patrice Levesque


 Is there any easy way to translate the occasional Dutch language
 emails I get into English? Does anyone know of a service that works
 well with mutt?
 Maybe you can wget/lynx to some on-line translator-service via
 mailcap, though beware, it will reconnect each time you open it.

Or use a tool that's built for commandline translation, and avoid a
boring webpage scraping job; libtranslate does just that:
(http://www.nongnu.org/libtranslate/#)


 Unless you get it to cache translations:-) For example via a wrapper
 script like this one:

(+1, Insightful)



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Mutt mangles attachment sent from iOS

2011-10-01 Thread Patrice Levesque


 The other day I sent a UTF-8 encoded text via mail file from my iPad
 to myself.  When I opened the mail in Mutt on my desktop computer and
 saved the attached file, I noticed that the non-ASCII characters in
 the file (e.g., German ö) had all been replaced with two question
 marks. Viewing the attachment in Mutt also shows question marks for
 the German umlauts.

A similar situation happened to me with an attachment mailed from the
Apple Mail application.  The same colleague sent me dozens of files
using the same setup, and the attachments were saved correctly.

A workaround I found then was to pipe the attachment to `tee
outputfile`, (using the view-attachment menu (v), then pipe-entry (|)).


Hope that helps,



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature