Usiing attachments and MIME

59 views
Skip to first unread message

Richard Morrisey

unread,
Jun 17, 2020, 8:55:38 AM6/17/20
to pat-users
I've attempted to attach a file to an outgoing message using pat and I expected it to be MIME formatted. However, it was simply appended without any other processing. Is this expected behavior?

I was hoping to see boundary delimiters, content encoding, etc. etc. Is this something that needs a contributor?


Richard Morrisey

unread,
Jun 17, 2020, 9:19:53 PM6/17/20
to pat-users
So I would like to contribute and I am learning the ropes of the repo. I've forked a copy and then created a new branch off of main. That was a mistake since I ended up adding go.mod functionality and upgrading to pactor/v2 which I later discovered has already been done. So I stared all over again and was able to compile directly from the develop branch. However, that still does not provide the desired attachment behavior. So now I see the branch by rainerg2000 is where all the work is happening. Can I help out with this work?

Chris Keller

unread,
Jun 17, 2020, 11:15:40 PM6/17/20
to Richard Morrisey, pat-users
Last I heard, Martin and Rainer are still in review. I would personally recommend starting from one of Rainer's PRs. 201 just contains upgrades to Bootstrap and JQuery, and 197 additionally contains the forms feature work.

I'm curious what behavior you're seeing w.r.t. attachments. I've used attachments in Pat before to send to both Winlink Express as well as regular email addresses and haven't encountered a problem, but I wasn't looking at the raw content. Note, Winlink has its own B2F protocol that dictates message structure. I'm not positive, but Winlink may not use MIME formatting at all.

--
You received this message because you are subscribed to the Google Groups "pat-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pat-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pat-users/940b2722-6f1c-422f-a00d-56dfd3fd9ad1o%40googlegroups.com.

Richard Morrisey

unread,
Jun 17, 2020, 11:49:04 PM6/17/20
to pat-users
When I examine the raw message from an outgoing Winlink Form ICS-213 it has the following structure:
Date: Tue, 16 Jun 2020 22:40:33 -0000
From: AE4OK@winlink.org
Reply-To: AE4OK@winlink.org
Subject: 213-ABC-Test - 2020-06-16 18:38
To: AE4OK@winlink.org
Message-ID: A61OPTADU8AU
X
-Cancel: 2020/07/07 22:40
X
-Source: AE4OK
MIME
-Version: 1.0
MIME
-Version: 1.0
Content-Type: multipart/mixed; boundary="boundaryal/QEA=="

--boundaryal/QEA==
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

GENERAL MESSAGE
(ICS 213)

1. Incident Name: ABC      =20
2. To (Name and Position): AE4OK/Tester
3. From (Name and Position): AE4OK/Tester
4. Subject: Test
5. Date: 2020-06-16
6. Time: 18:38
7. Message:

Information

8. Approved by: Me
   
Position/Title: Boss

------------------------------------
Express Sending Station: AE4OK
Senders Express Version: 1.5.28.0
Senders Template Version: ICS 213  v.41.3

--boundaryal/QEA==
Content-Disposition: attachment;
 name
="RMS_Express_Form_ICS213_Initial_Viewer.xml";
 filename
="RMS_Express_Form_ICS213_Initial_Viewer.xml"
Content-Type: attachment;
 name
="RMS_Express_Form_ICS213_Initial_Viewer.xml"
Content-Transfer-Encoding: base64

PD94bWwgdmVyc2lvbj0iMS4wIj8
+DQo8Uk1TX0V4cHJlc3NfRm9ybT4NCiAgPGZvcm1fcGFyYW1l
dGVycz4NCiAgICA8eG1sX2ZpbGVfdmVyc2lvbj4xLjA8L3htbF9maWxlX3ZlcnNpb24
+DQogICAg
PHJtc19leHByZXNzX3ZlcnNpb24+MS41LjI4LjA8L3Jtc19leHByZXNzX3ZlcnNpb24+DQogICAg
PHN1Ym1pc3Npb25fZGF0ZXRpbWU
+MjAyMDA2MTYyMjM5Mzc8L3N1Ym1pc3Npb25fZGF0ZXRpbWU+
DQogICAgPHNlbmRlcnNfY2FsbHNpZ24+QUU0T0s8L3NlbmRlcnNfY2FsbHNpZ24+DQogICAgPGdy
aWRfc3F1YXJlPkZNMTdHTzwvZ3JpZF9zcXVhcmU
+DQogICAgPGRpc3BsYXlfZm9ybT5JQ1MyMTNf
SW5pdGlhbF9WaWV3ZXIuaHRtbDwvZGlzcGxheV9mb3JtPg0KICAgIDxyZXBseV90ZW1wbGF0ZT5J
Q1MyMTNfU2VuZFJlcGx5LjA8L3JlcGx5X3RlbXBsYXRlPg0KICA8L2Zvcm1fcGFyYW1ldGVycz4N
CiAg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AyMTMgIHYuNDEuMzwv
dGVtcGxhdGV2ZXJzaW9uPg0KICA8L3ZhcmlhYmxlcz4NCjwvUk1TX0V4cHJlc3NfRm9ybT4NCg
==

--boundaryal/QEA==--

So the raw message sitting in the outbox is definitely mine encoded. Moreover, Winlink takes that xml file and associates it with the related html file to display the form. So I created a TCL/TK utility to generate the plaintext and xml components. I did not bother to base64 encode the xml part because my assumption was that if I clicked on the attachment button and attached the xml file, the filename would be used for the content disposition and perhaps it would base64 encode the xml automatically. Also, since I don't have access to the initial set of headers, I wouldn't be able to specify the boundary element. So even if I inserted those components manually, it wouldn't get parsed properly.

Anyway, when I look at the message in the PAT outbox, it's just
Mid: WKPZXDZHUCBB
Body: 371
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=ISO-8859-1
Date: 2020/06/18 00:57
File: 1533 RMS_Express_Form_ICS213_Initial_Viewer.xml
From: AE4OK
Mbo: AE4OK
Subject: Winlink Wednesday Check-In
To: KW6GB
Type: Private
X
-P2ponly: true

GENERAL MESSAGE
(ICS 213)

1. Incident Name: Winlink Wednesday
2. To (Name and Position): KW6GB / Net Control
3. From (Name and Position): AE4OK / Net Participant
4. Subject: Winlink Wednesday Check-In
5. Date: 2020-06-17
6. Time: 20:53
7. Message:

AE4OK
, Rich, Richmond, VA (HF, ARDOP, P2P)

8. Approved by: R. Morrisey
   
Position/Title: Net Participant

<?xml version="1.0"?>
<RMS_Express_Form>
   
<form_parameters>
       
<xml_file_version>1.0</xml_file_version>
        <rms_express_version>1.5.28.0</
rms_express_version>
       
<senders_callsign>AE4OK</senders_callsign>
        <grid_square>FM17GO</
grid_square>
       
<submission_datetime>20200617205349</submission_datetime>
        <display_form>ICS213_Initial_Viewer.html</
display_form>
       
<reply_template>ICS213_SendReply.0</reply_template>
    </
form_parameters>
   
<variables>
       
<msgto></msgto>
        <msgcc></
msgcc>
       
<msgsender>AE4OK</msgsender>
        <msgsubject>ICS213_Initial_Viewer.html</
msgsubject>
       
<msgbody></msgbody>
        <msgp2p>True</
msgp2p>
       
<msgisreply>False</msgisreply>
        <msgisforward>False</
msgisforward>
       
<msgisacknowledgement>False</msgisacknowledgement>
        <msgseqnum>2</
msgseqnum>
       
<showdr></showdr>
        <inc_name>Winlink Wednesday</
inc_name>
       
<to_name>KW6GB / Net Control</to_name>
        <txtstr></
txtstr>
       
<fm_name>AE4OK / Net Participant</fm_name>
        <subjectline>Winlink Wednesday Check-In</
subjectline>
       
<mdate>2020-06-17</mdate>
        <mtime>20:53</
mtime>
       
<message>AE4OK, Rich, Richmond, VA (HF, ARDOP, P2P)</message>
       
<approved_name>R. Morrisey</approved_name>
        <approved_postitle>Net Participant</
approved_postitle>
       
<submit>Submit</submit>
        <parseme></
parseme>
       
<templateversion>ICS 213  v.41.3</templateversion>
    </
variables>
</RMS_Express_Form>

The xml part is the file I attached that I generated with my utility. It's simply added as part of the body. I'll attache the full winlink example.

This is the behavior for release 0.9 and my compiled version from develop, head.
To unsubscribe from this group and stop receiving emails from it, send an email to pat-...@googlegroups.com.

LA5NTA

unread,
Jun 18, 2020, 11:14:50 AM6/18/20
to pat-users
Hi Richard,

Thanks for your interest in contributing to the project. I'm not sure I understand what you're attempting to accomplish though.

Pat implements the B2F protocol used by Winlink, including full support for message attachments as part of the Winlink Message Structure. You can read the formal specification of the message format here: https://winlink.org/B2F. The MIME standard is not part of the message structure and not supported by this protocol.

The "raw message from an outgoing Winlink Form" that you refer to looks like the format Winlink Express uses to store messages on disk. This is not the same format as the Winlink system uses in transport. Pat stores messages as raw uncompressed B2F messages, the same format that is used in transit (minus the compression).

PS: For general contributions, please use github.com/la5nta/pat's develop or master branches as the base of your work. Please keep the PRs small and follow the guidelines described here: https://github.com/la5nta/pat/blob/master/CONTRIBUTING.md.

Thank you!

-- 
73 de LA5NTA / Martin

Rainer G

unread,
Jun 18, 2020, 3:33:37 PM6/18/20
to pat-users
Hi Richard,

I can't comment of the MIME attachment issue you are raising, but it seems that you are trying to use pat to produce an ICS213 form attachment that Winlink can understand. As Chris has pointed out, I am working on a branch which adds full support for Winlink-style template-based messages. Incl. authoring, viewing, and replying to form messages.

In the next couple of weeks I hope to have it merged into LA5NTA's repo. For now, if you are interested in my addition, you can preview the latest in this branch https://github.com/rainerg2000/pat/tree/issue/135-support-ics-forms
 If you don't want to build your own, I can give you access to Win, Mac, and Raspberry Pi preview executables. I'll send a link your direct email address.

Rainer.
KI7RMJ

Richard Morrisey

unread,
Jun 18, 2020, 5:37:49 PM6/18/20
to pat-users
Rainer -
That's OK thanks. I just started building from the wrong branch, I have the environment to build for linux. I'd love to test it so I'll give it it a go shortly.
Thanks for replying.

Richard A. Morrisey

unread,
Jun 18, 2020, 5:55:30 PM6/18/20
to pat-...@googlegroups.com

I see now. B2F uses byte count framing with order, body - attachment - attachment - attachment - ...  Thanks.

--
You received this message because you are subscribed to a topic in the Google Groups "pat-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pat-users/aCow1mOzZ9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pat-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pat-users/268f51d8-671f-4ed9-ba7c-c502070d73fbo%40googlegroups.com.

Richard Morrisey

unread,
Jun 20, 2020, 12:47:20 AM6/20/20
to pat-users
Rainer,
I built and tested commit 9b7d623 - Using ICS213 template with KN4ZMA who replied and it all worked fine.
Regards,
Rich

On Thursday, June 18, 2020 at 3:33:37 PM UTC-4, Rainer G wrote:
Reply all
Reply to author
Forward
0 new messages