Re: How to generate html mime message?

2021-02-14 Thread Grant Edwards
On 2021-02-14, Sam Kuper  wrote:
> On Fri, Feb 12, 2021 at 10:19:07PM -, Grant Edwards wrote:
>
>> After a couple years of that, they turned of the SMTP server, so you
>> can only use Outlook or the OWA web API.  No more using mutt for
>> work...
>
> Off-topic, but DavMail might let you resume using Mutt at work.

For a brief while after they shut down SMTP, I was using a DAV client
to submit emails. Then they shut that off somehow.

> Or switch jobs, since that employer doesn't seem to be a good one.

There are other reasons to stay, and the liklihood of finding work
locally that's not exclusively Exchange/Outlook is pretty slim.

--
Grant






Re: How to generate html mime message?

2021-02-13 Thread Sam Kuper
On Fri, Feb 12, 2021 at 10:19:07PM -, Grant Edwards wrote:
> After a couple years of that, they turned of the SMTP server, so you
> can only use Outlook or the OWA web API.  No more using mutt for
> work...

Off-topic, but DavMail might let you resume using Mutt at work.  Or
switch jobs, since that employer doesn't seem to be a good one.

-- 
A: When it messes up the order in which people normally read text.
Q: When is top-posting a bad thing?

()  ASCII ribbon campaign. Please avoid HTML emails & proprietary
/\  file formats. (Why? See e.g. https://v.gd/jrmGbS ). Thank you.


Re: How to generate html mime message?

2021-02-12 Thread Amit Ramon

Grant Edwards  [2021-02-12 22:19 -]:


On 2021-02-12, Paul Gilmartin via Mutt-users  wrote:

On 2021-02-12, at 03:15:00, Amit Ramon wrote:

Peng Yu [2021-02-07 16:34 -0600]:


I just want to generate the HTML mine message. The instruction
requires the set up of mutt, which I want to avoid. Is
`bin/plain2html` for generating HTML mime message from a plain text?



But I wonder, "Why?"  Is there an email client so broken that it can't
simply handle text/plain content?


Yes. In my experience the version of Outlook used in my office doesn't
not work well at all with text/plain. It doesn't use a fixed font and
it does something weird and unpredictabable with line endings.


What has pushed me to develop plainMail2HTML is the bad handling of
right-to-left languages in mail clients. For example, Gmail (web)
client need to be told (via settings) what language to use for its
UI. If it's, for example, English, then plain text in a RTL language will
be left aligned. If I set the language to Hebrew, then English plain text
will be right aligned. As most of my friends and colleagues of mine,
are using Gmail, sending them plain text would be inconvenient for
them.

--- Amit


Re: How to generate html mime message?

2021-02-12 Thread Grant Edwards
On 2021-02-12, Paul Gilmartin via Mutt-users  wrote:
> On 2021-02-12, at 03:15:00, Amit Ramon wrote:
>> Peng Yu [2021-02-07 16:34 -0600]:
>> 
>>> I just want to generate the HTML mine message. The instruction
>>> requires the set up of mutt, which I want to avoid. Is
>>> `bin/plain2html` for generating HTML mime message from a plain text?
>>  
> But I wonder, "Why?"  Is there an email client so broken that it can't
> simply handle text/plain content?

Yes. In my experience the version of Outlook used in my office doesn't
not work well at all with text/plain. It doesn't use a fixed font and
it does something weird and unpredictabable with line endings.

I finally gave up and started using muttdown to send
multipart/alternative email in plaintext and html.

After a couple years of that, they turned of the SMTP server, so you
can only use Outlook or the OWA web API.  No more using mutt for
work...

--
Grant






Re: How to generate html mime message?

2021-02-12 Thread Paul Gilmartin via Mutt-users
On 2021-02-12, at 03:15:00, Amit Ramon wrote:
> 
> Peng Yu [2021-02-07 16:34 -0600]:
> 
>> I just want to generate the HTML mine message. The instruction
>> requires the set up of mutt, which I want to avoid. Is
>> `bin/plain2html` for generating HTML mime message from a plain text?
>  
But I wonder, "Why?"  Is there an email client so broken that it can't
simply handle text/plain content?

> Yes, this is the tool. You can either pipe a message to it
> 
>  $ cat message.eml | plain2html

(Following the thread back, it appears the OP wanted to attach
a file already formatted as HTML.)

-- gil



Re: How to generate html mime message?

2021-02-12 Thread Amit Ramon

Hey Peng,

Peng Yu  [2021-02-07 16:34 -0600]:


I just want to generate the HTML mine message. The instruction
requires the set up of mutt, which I want to avoid. Is
`bin/plain2html` for generating HTML mime message from a plain text?


Yes, this is the tool. You can either pipe a message to it

  $ cat message.eml | plain2html

or call it as

  $ plain2html -m message.eml


Can you make the plain2html module installable so that the following
command will work? Thanks.

$ bin/plain2html
Traceback (most recent call last):
 File "bin/plain2html", line 36, in 
   from plain2html import settings
ModuleNotFoundError: No module named 'plain2html'


Unfortunately I might not have time for that right now, but you can
easily solve this problem by setting your PYTHONPATH to include the
parent directory of the 'bin' and 'plain2html' directories.

Also please note that you need to have Python docutils installed. Last
thing, currently the only parser used for processing text is for
reStructuredText (but adding others, for example for markdown, should
be pretty simple).

Best,

Amit




Re: How to generate html mime message?

2021-02-07 Thread Peng Yu
I just want to generate the HTML mine message. The instruction
requires the set up of mutt, which I want to avoid. Is
`bin/plain2html` for generating HTML mime message from a plain text?
Can you make the plain2html module installable so that the following
command will work? Thanks.

$ bin/plain2html
Traceback (most recent call last):
  File "bin/plain2html", line 36, in 
from plain2html import settings
ModuleNotFoundError: No module named 'plain2html'


On 2/7/21, Amit Ramon  wrote:
> Hello Peng,
>
> While this might not be the answer for how to use pandoc, it is an answer
> to the question in the subject, so I hope it's right.
>
> I'm the author of https://github.com/amitramon/plainMail2HTML - this
> is a simple tool that allows for generating HTML mime part from any
> email sent from Mutt. Perhaps you'll find it useful.
>
> Cheers,
>
> Amit
>
> Peng Yu  [2021-02-07 09:26 -0600]:
>
>>Hi,
>>
>>https://unix.stackexchange.com/questions/108485/send-email-written-in-markdown-using-mutt
>>
>>I see the following muttrc command is used to compose an HTML message
>>on the above URL. I just want to inspect the mime message in the
>>command line without using the GUI.
>>
>>macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html;
>>charset=utf-8\n"
>>set wait_key=no
>>
>>Could anybody let me know how to create the mime message using mutt
>>given an html file already generated by pandoc from markdown?
>>
>>I understand "html; charset=utf-8" is to set the following Content-Type.
>>
>>Content-Type: text/html; charset=UTF-8
>>
>>But what does "y^T^U" do?
>>
>>--
>>Regards,
>>Peng
>
> --
>


-- 
Regards,
Peng


Re: How to generate html mime message?

2021-02-07 Thread Amit Ramon

Hello Peng,

While this might not be the answer for how to use pandoc, it is an answer
to the question in the subject, so I hope it's right.

I'm the author of https://github.com/amitramon/plainMail2HTML - this
is a simple tool that allows for generating HTML mime part from any
email sent from Mutt. Perhaps you'll find it useful.

Cheers,

Amit

Peng Yu  [2021-02-07 09:26 -0600]:


Hi,

https://unix.stackexchange.com/questions/108485/send-email-written-in-markdown-using-mutt

I see the following muttrc command is used to compose an HTML message
on the above URL. I just want to inspect the mime message in the
command line without using the GUI.

macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html;
charset=utf-8\n"
set wait_key=no

Could anybody let me know how to create the mime message using mutt
given an html file already generated by pandoc from markdown?

I understand "html; charset=utf-8" is to set the following Content-Type.

Content-Type: text/html; charset=UTF-8

But what does "y^T^U" do?

--
Regards,
Peng


--


Re: How to generate html mime message?

2021-02-07 Thread Jakub Jindra

Hi Peng,

the y^T^U means:

The first "command" of the macro is `F` which is default binding for  
. This is how You process message through pandoc and it 
asks a question about overwriting the original message in tempfile 
that's why there's a `y` to confirm the question. When you execute it on 
your own you'll see:


WARNING!  You are about to overwrite /path/to/tmpmailefile continue?  
([no]/yes):

`^T` is default key binding for 

`^U` is readline default binding to kill line (basically remove original 
content of Content-type)


It is be easier to read and more portable when You replace key bindings 
for the functions:

```
macro compose \e5 \
"pandoc -s -f markdown -t html\
text/html; charset=utf-8"

```

Best,
Jakub

On 2021-02-07 09:26, Peng Yu wrote:

Hi,

https://unix.stackexchange.com/questions/108485/send-email-written-in-markdown-using-mutt

I see the following muttrc command is used to compose an HTML message
on the above URL. I just want to inspect the mime message in the
command line without using the GUI.

macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html;
charset=utf-8\n"
set wait_key=no

Could anybody let me know how to create the mime message using mutt
given an html file already generated by pandoc from markdown?

I understand "html; charset=utf-8" is to set the following Content-Type.

Content-Type: text/html; charset=UTF-8

But what does "y^T^U" do?

--
Regards,
Peng


--
Jakub Jindra


signature.asc
Description: PGP signature