text/calendar vs application/ics

2020-01-07 Thread Conrad Hughes
When I mhshow a message with a text/calendar attachment, it's inlined
using mhical; if the attachment type is changed to application/ics, it's
suppressed instead.  I'm using the latest mhn.defaults from the git
repo, which contains

  mhshow-show-text/calendar: mhical -infile %F
  mhshow-show-application/ics: mhical -infile %F

.. any idea where I should be looking for something else that might
differentiate the two?

Conrad



Re: Extracting Links from HTML Message

2020-01-07 Thread Ralph Corderoy
Hi Martin,

> $ show
...
> https://www.radioid.net/verify/token=SHTUI469E1GVO35SDTGK180BAHKLOP9FPF
> R9GWQD

>   Here are the last couple of headers plus raw text:
> Content-Type: text/html; charset="ascii"
> Mime-Version: 1.0

Was there a ‘Content-Transfer-Encoding’ field too?

> https://www.radioid.net=
> /verify/SHTUI469E1GVO35SDTGK180BAHKLOP9FPFR9GWQD" alt=3D"Verification Image=
> ">
...
> https://www.radioid.net/verify/t=
> oken=3DSHTUI469E1GVO35SDTGK180BAHKLOP9FPFR9GWQD

Removing the quoted-printable encoding gives these two different URLS,
the first for the image to display, the second to open in lieu

https://www.radioid.net/verify/SHTUI469E1GVO35SDTGK180BAHKLOP9FPFR9GWQD

https://www.radioid.net/verify/token=SHTUI469E1GVO35SDTGK180BAHKLOP9FPFR9GWQD

The token is the same in both: SHTUI469E1GVO35SDTGK180BAHKLOP9FPFR9GWQD.

The message you got about the token already being used seems to be a
default for any unrecognised token,
e.g. https://www.radioid.net/verify/nmh-workers

Are you sure you didn't open the incomplete URL as Andy suggested?

-- 
Cheers, Ralph.



mhical rejecting "last day in the month"

2020-01-07 Thread Conrad Hughes
mhical rejects things like -1SU (last Sunday in the month), despite its
presence (at a cursory glance) in the ical standard:

  sbr/datetime.c:295:
if (*cp == '+') { ++cp; } /* +n specific day; don't support '-' */
else if (*cp == '-') { goto fail; }

.. so RRULEs like "FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU," fail.

Is this just a "not yet implemented", so possibly worth my trying to add?

Conrad



Re: text/calendar vs application/ics

2020-01-07 Thread Conrad Hughes
Ralph> May we have the output of `mhlist -verbose' for those two emails?

It's one email, just editing back and forth between the two (I was
trying to reduce to the core problem):

   msg part  type/subtype  size description
  3507   multipart/mixed24K
   boundary="=_Part_4723_1712151815.1576230379945"
   1 multipart/alternative  21K
   boundary="=_Part_4724_2115414819.1576230379946"
   1.1   text/html  16K
   charset="UTF-8"
   1.2   text/plain5132
   charset="UTF-8"
   2 application/ics   1499
   name="meetup.ics"
   method="PUBLISH"
   charset="UTF-8"

vs (above is broken, below displays as desired):

   msg part  type/subtype  size description
     multipart/mixed24K
   boundary="=_Part_4723_1712151815.1576230379945"
   1 multipart/alternative  21K
   boundary="=_Part_4724_2115414819.1576230379946"
   1.1   text/html  16K
   charset="UTF-8"
   1.2   text/plain5132
   charset="UTF-8"
   2 text/calendar 1450
   name="meetup.ics"
   method="PUBLISH"
   charset="UTF-8"

.. differences between the two on `strace mhshow` include

  - The extracted temp file has a .ics suffix for text/calendar, but not
for application/ics — but I can change this with mhn.defaults, and
it makes no difference.

  - The text/calendar tempfile has \n line endings, while the
application/ics one has \r\n line endings — even though this is the
exact same base64-encoded content for both: the only difference is
the Content-Type.

As to whether application/ics is a valid type Ken: meetup.com at least
generates them copiously, so valid or not, they're real unfortunately.

The part *is* an attachment, but when it's a text/calendar attachment it
would appear that mhshow defaults to displaying it.

I attach an example email below.

C.
Message-ID: 
<1140016141.1576230379946.JavaMail.root@ip-10-192-12-144.ec2.internal>
From: Meetup 
Sender: i...@meetup.com
To: biz_nmh_work...@xrad.org
Subject: See you at: blah
MIME-Version: 1.0
Date: Fri, 13 Dec 2019 00:00:00 + (UTC)
Content-Type: multipart/mixed; 
boundary="=_Part_4723_1712151815.1576230379945"

--=_Part_4723_1712151815.1576230379945
Content-Type: multipart/alternative; 
boundary="=_Part_4724_2115414819.1576230379946"

--=_Part_4724_2115414819.1576230379946
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Blah.

--=_Part_4724_2115414819.1576230379946
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit


  
Meetup
  
  
Blah.
  


--=_Part_4724_2115414819.1576230379946--

--=_Part_4723_1712151815.1576230379945
Content-Type: application/ics; name=meetup.ics; method=PUBLISH; 
charset=UTF-8
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=meetup.ics

QkVHSU46VkNBTEVOREFSClZFUlNJT046Mi4wClBST0RJRDotLy9NZWV0dXAvL01lZXR1cCBFdmVu
dHMgdjEuMC8vRU4KQ0FMU0NBTEU6R1JFR09SSUFOCk1FVEhPRDpQVUJMSVNICkJFR0lOOlZUSU1F
Wk9ORQpUWklEOkV1cm9wZS9Mb25kb24KVFpVUkw6aHR0cDovL3R6dXJsLm9yZy96b25laW5mby1v
dXRsb29rL0V1cm9wZS9Mb25kb24KQkVHSU46REFZTElHSFQKVFpPRkZTRVRGUk9NOiswMDAwClRa
T0ZGU0VUVE86KzAxMDAKVFpOQU1FOkJTVApEVFNUQVJUOjE5NzAwMzI5VDAxMDAwMApSUlVMRTpG
UkVRPVlFQVJMWTtCWU1PTlRIPTM7QllEQVk9LTFTVQpFTkQ6REFZTElHSFQKQkVHSU46U1RBTkRB
UkQKVFpPRkZTRVRGUk9NOiswMTAwClRaT0ZGU0VUVE86KzAwMDAKVFpOQU1FOkdNVApEVFNUQVJU
OjE5NzAxMDI1VDAyMDAwMApSUlVMRTpGUkVRPVlFQVJMWTtCWU1PTlRIPTEwO0JZREFZPS0xU1UK
RU5EOlNUQU5EQVJECkVORDpWVElNRVpPTkUKQkVHSU46VkVWRU5UCkRUU1RBTVA6MjAxOTEyMTNU
MDk0NjE5WgpEVFNUQVJUO1RaSUQ9RXVyb3BlL0xvbmRvbjoyMDIwMDEwNVQxOTAwMDAKRFRFTkQ7
VFpJRD1FdXJvcGUvTG9uZG9uOjIwMjAwMTA1VDIxMDAwMApTVEFUVVM6Q09ORklSTUVEClNVTU1B
Ulk6QmxhaApERVNDUklQVElPTjpCbGFoCk9SR0FOSVpFUjtDTj1NZWV0dXAgUmVtaW5kZXI6TUFJ
TFRPOmluZm9AbWVldHVwLmNvbQpDTEFTUzpQVUJMSUMKQ1JFQVRFRDoyMDE5MTIxMFQwMDAwMDBa
CkxPQ0FUSU9OOkJsYWgKVVJMOmh0dHBzOi8vd3d3Lm1lZXR1cC5jb20vClNFUVVFTkNFOjIKTEFT
VC1NT0RJRklFRDoyMDE5MTIxMFQwMDAwMDBaClVJRDpldmVudF9ibGFoQG1lZXR1cC5jb20KRU5E
OlZFVkVOVApFTkQ6VkNBTEVOREFSCg==

--=_Part_4723_1712151815.1576230379945--



Re: text/calendar vs application/ics

2020-01-07 Thread Ken Hornstein
>When I mhshow a message with a text/calendar attachment, it's inlined
>using mhical; if the attachment type is changed to application/ics, it's
>suppressed instead.

Wait, is application/ics a valid type?  Even the calendar invites I get
from the Microsoft world seem to be text/calendar.

But, I am wondering if the issue is not the MIME type, but the disposition.
MIME parts with a disposition of "attachment" are not displayed by
mhshow by default.

--Ken



Re: text/calendar vs application/ics

2020-01-07 Thread Ralph Corderoy
Hi Conrad,

> When I mhshow a message with a text/calendar attachment, it's inlined
> using mhical; if the attachment type is changed to application/ics,
> it's suppressed instead.

May we have the output of `mhlist -verbose' for those two emails?

-- 
Cheers, Ralph.



Re: text/calendar vs application/ics

2020-01-07 Thread Ken Hornstein
>The part *is* an attachment, but when it's a text/calendar attachment it
>would appear that mhshow defaults to displaying it.

The answer's in the mhshow(1) man page:

   By  default,  mhshow will display only the text parts of a message that
   are not marked as attachments.  This behavior can  be  changed  by  the
   -notextonly  and  -noinlineonly

Although technically I believe we shouldn't display those calendar
attachments even when they're text/calendar according to that man page,
but ... different problem.

The thinking for those defaults was that show/mhshow are for displaying
"text" content designed to be displayed on a terminal.  Stuff under
"application" is generally supposed to be input to another application.
Hence the reason that text/calendar is under the "text" media type.
You can look at mhshow(1) for more details on how to change that.

--Ken



NMH IMAP GPG

2020-01-07 Thread john doe
Hi,

As far as I understand it, NMH can not be used directly with IMAP,so I
would like to use FDM for this.
If it is possible, I would appriciate any pointers on how to do this?

An other need for my MUA is the ability to use email encryption/signing
with GPG.
For now, I'm not sure how/if I can use GPG with NMH?

Any feedback on the above is welcome.

--
John Doe



Re: NMH IMAP GPG

2020-01-07 Thread Leonardo Taccari
john doe writes:
> Hi,
>

Hello John,

> As far as I understand it, NMH can not be used directly with IMAP,so I
> would like to use FDM for this.
> If it is possible, I would appriciate any pointers on how to do this?
>

I basically have the following in fdm.conf:

 | # Pipe to nmh's rcvstore using %[ml] as MH folder
 | action "rcvstore" pipe "/usr/pkg/libexec/nmh/rcvstore +%[ml]"
 | 
 | # Populate headers tags needed by rules
 | match "^cc:(.*)" in headers action tag "cc" value "%1" continue
 | match "^from:(.*)" in headers action tag "from" value "%1" continue
 | match "^list-id:(.*)" in headers action tag "list-id" value "%1" continue
 | match "^to:(.*)" in headers action tag "to" value "%1" continue
 |
 | [...]
 |
 | # Public MLs
 | #
 | # All of them have the following form:
 | #
 | #  match string "%[list-id]" to "XXXML" or string "%[to]" to "XXXML" or 
string "%[cc]" to "XXXML" actions { tag "ml" value "XXXTAGML" action "rcvstore" 
}
 | #
 | # where XXXML can be the ML address or List-Id: field
 | # and XXXTAGML is the MH # folder that will be used
 |

So, for examples these are the two rules to match nmh-announce and nmh-workers
mailing lists and respective store the in the nmh-announce and
nmh-workers folders:

 | match string "%[list-id]" to "nmh-announce[@.]nongnu.org" or string "%[to]" 
to "nmh-announce[@.]nongnu.org" or string "%[cc]" to 
"nmh-announce[@.]nongnu.org" actions { tag "ml" value "nmh-announce" action 
"rcvstore" }
 | match string "%[list-id]" to "nmh-workers[@.]nongnu.org" or string "%[to]" 
to "nmh-workers[@.]nongnu.org" or string "%[cc]" to "nmh-workers[@.]nongnu.org" 
actions { tag "ml" value "nmh-workers" action "rcvstore" }

...and if the email doesn't match any rule I store them in an INBOX MH
folder:

 | # ...no luck, go to the INBOX!
 | match all actions { tag "ml" value "INBOX" action "rcvstore" }

> An other need for my MUA is the ability to use email encryption/signing
> with GPG.
> For now, I'm not sure how/if I can use GPG with NMH?
>
> Any feedback on the above is welcome.
>

You can use Neil Rickert's mhpgp that could be found here:

 http://faculty.cs.niu.edu/~rickert/mh/

I just set `rsakey' as an environment variable and then after finished
to compose an email via comp(1) or repl(1), in what(1) prompt you can
just type `e mhsign -m' to sign the email.



Re: text/calendar vs application/ics

2020-01-07 Thread Conrad Hughes
Ken> The answer's in the mhshow(1) man page:

Thanks Ken; so the man page says that switches like "-type" and "-part"
can "limit and reorder" what mhshow will show, but I guess what I'm
after then is *expanding*, not limiting or reordering.  Adding the
following to my .mh_profile gets me closer to this:

  mhshow: -type text -type application/ics

.. in that it shows application/ics and message text, but I no longer
hear about other attachments — where previously an attached .jpg would
cause a "suppressed" message at the end of show's output, now there's no
mention of it.  So if that's not the right way, then is there an easy
way to get application/ics inlined like text/*?

Alternatively, is there any way of telling nmh that application/ics is
really text/calendar?

Conrad



Re: text/calendar vs application/ics

2020-01-07 Thread Michael Richardson

Conrad Hughes  wrote:
> When I mhshow a message with a text/calendar attachment, it's inlined
> using mhical; if the attachment type is changed to application/ics, it's
> suppressed instead.  I'm using the latest mhn.defaults from the git
> repo, which contains

Are they in a multipart/alternative ?  Or something else?

> mhshow-show-text/calendar: mhical -infile %F
> mhshow-show-application/ics: mhical -infile %F

> .. any idea where I should be looking for something else that might
> differentiate the two?





signature.asc
Description: PGP signature


Re: text/calendar vs application/ics

2020-01-07 Thread Ken Hornstein
>.. in that it shows application/ics and message text, but I no longer
>hear about other attachments — where previously an attached .jpg would
>cause a "suppressed" message at the end of show's output, now there's no
>mention of it.  So if that's not the right way, then is there an easy
>way to get application/ics inlined like text/*?

We should have a richer way of specifying what content types are to
be displayed ... but we don't.  That code is kind of mess.

I guess ... from looking at the code, what we do EXACTLY is:

- Always display a text part, regardless of the disposition
- If we either have textonly set (the default) or inlineonly set (the default)
  and it is an attachment, output a marker.  Otherwise, try to display it
  (and complaint if it cannot).

So there's really no way (that I can tell right now) of doing what you
want, which is "display this particular application/ics message" but
display all others normally.

>Alternatively, is there any way of telling nmh that application/ics is
>really text/calendar?

Other than 'sed -e s#application/ics#text/calendar#', no.  I was hoping
mhfixmsg could do that, but it seems like right now it cannot (unless I
misunderstood the man page, which is always possible).

You COULD complain to meetup.com; sending out application/ics is total crap.

--Ken



Re: text/calendar vs application/ics

2020-01-07 Thread Paul Fox
ken wrote:
 > >Alternatively, is there any way of telling nmh that application/ics is
 > >really text/calendar?
 > 
 > Other than 'sed -e s#application/ics#text/calendar#', no.  I was hoping
 > mhfixmsg could do that, but it seems like right now it cannot (unless I
 > misunderstood the man page, which is always possible).

Would simply adding more entries to mhn.defaults not work?

paul
=--
paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 34.5 degrees)




Re: text/calendar vs application/ics

2020-01-07 Thread Ken Hornstein
>Would simply adding more entries to mhn.defaults not work?

Those entries already exist ... so no.

The problem is the default for mhshow is "don't try to display stuff,
unless it's text".  You can tell it to try to display everything, and it
will do that, but it won't display the part markers (which is something
Conrad wanted).  We didn't envision a case where someone wanted to treat
an application type as text.

--Ken



Re: text/calendar vs application/ics

2020-01-07 Thread Paul Fox
Ah, got it.  thanks.

ken wrote:
 > >Would simply adding more entries to mhn.defaults not work?
 > 
 > Those entries already exist ... so no.
 > 
 > The problem is the default for mhshow is "don't try to display stuff,
 > unless it's text".  You can tell it to try to display everything, and it
 > will do that, but it won't display the part markers (which is something
 > Conrad wanted).  We didn't envision a case where someone wanted to treat
 > an application type as text.
 > 
 > --Ken
 > 


=--
paul fox, p...@foxharp.boston.ma.us (arlington, ma, where it's 32.7 degrees)




Re: text/calendar vs application/ics

2020-01-07 Thread David Levine
Ken writes:

> Other than 'sed -e s#application/ics#text/calendar#', no.  I was hoping
> mhfixmsg could do that, but it seems like right now it cannot

That's right.  See below for an example of where I think doing that would be 
less than helpful.

> You COULD complain to meetup.com; sending out application/ics is total crap.

Google sends it out, along with an (almost) identical text/calendar:

 msg part  type/subtype  size description
   0   multipart/mixed14K
 1 multipart/alternative  12K
 1.1   text/calendar 1263
 1.2   text/html 8233
 1.3   text/plain1173
 2 application/ics   1295
 disposition "attachment"

The only difference between the text/calendar and application/ics content is 
the line endings, the same as Conrad found (\r\n in the application/ics).

David



Re: mhical rejecting "last day in the month"

2020-01-07 Thread David Levine
Conrad writes:

> mhical rejects things like -1SU (last Sunday in the month), despite its
> presence (at a cursory glance) in the ical standard:

That's right.  From the man page:

mhical supports only a very limited subset of RRULE formats.
Specifically, only a frequency of YEARLY and an interval of 1 are
supported.

> Is this just a "not yet implemented", so possibly worth my trying to add?

Sure, that would be great!  The code that parses that YEARLY format
is currently in rrule_clock() in sbr/datetime.c.  Though maybe it
would be better off in the ical parser.

David



Re: text/calendar vs application/ics

2020-01-07 Thread David Levine
Ken writes:

> The thinking for those defaults was that show/mhshow are for displaying
> "text" content designed to be displayed on a terminal.  Stuff under
> "application" is generally supposed to be input to another application.

Just to note that I'm still searching for the "right" (for me) way to get
mhshow to show as much as it can, even with helper applications.  Maybe
I'll try adding -notextonly -noinlineonly to my profile and see if that
causes any pain.

David