\documentclass{article}
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage[latin1]{inputenc}
\usepackage{epsfig}
\usepackage{null}
\title{MSGID / Message-ID Conversion for Fido-Internet Gateways }
\author{Martin Junius{\ttfamily  {\(<\)}mj@fido.de{\(>\)}} }
\date{Version 4.2 of 01 May 1997, supersedes the MSGID.DOC version 4.1.}
\abstract{This document describes the conversion between FIDO \verb+^+AMSGID/\verb+^+AREPLY and Internet RFC mail/news Message-ID/References. It is a recommendation for a common handling of message ID passing for FIDONET-Internet gateways. }


\begin{document}
\maketitle

\section{Credits }



This work is not entirely mine. It includes suggestions and improvements by 
\begin{itemize}
\item Joerg Stattaus 
mailto:Joerg\_Stattaus@ac.maus.de 
\item Albi Rebmann 
mailto:albi@life.sub.org 
\item Michael Holzt 
mailto:Michael\_Holzt@mhs.ftg.donut.ruhr.com 
\item Martin Horneffer 
mailto:Martin\_Horneffer@ac2.maus.de 
\item Johann H. Addicks 
mailto:J.H.ADDICKS@BLUEBOCS.donut.ruhr.com 
\item Jason Fesler 
mailto:jfesler@wmeonlin.sacbbx.com 
\item Odinn Sorensen 
mailto:odinn@winboss.dk  
\end{itemize}



\section{Formats }




\subsection{FTN \verb+^+AMSGID Kludge Formats }




\subsubsection{FTN generic }

\begin{verbatim}
^AMSGID: anything abcd1234 
\end{verbatim}



\subsubsection{Internet }

\begin{verbatim}
^AMSGID: {\(<\)}id@do.main{\(>\)} abcd1234 
\end{verbatim}



\subsection{RFC Message-ID Formats }




\subsubsection{FTN w/o MSGID }

\begin{verbatim}
Message-ID: {\(<\)}NOMSGID_mimeftnaddr_YYMMDD_HHMMSS_abcd1234@ftn.domain{\(>\)} 
\end{verbatim}



\subsubsection{FTN generic }

\begin{verbatim}
Message-ID: {\(<\)}MSGID_mimeanything_abcd1234@ftn.domain{\(>\)} 
\end{verbatim}



\subsubsection{Internet }

\begin{verbatim}
Message-ID: {\(<\)}id@do.main{\(>\)} 
\end{verbatim}



\section{Non-FIDONET FTNs}



A gateway {\itshape must\/} use {\ttfamily fidonet.org} for Message-IDs originating from the standard FIDONET zones 1-6.

However, for non-FIDONET zones, a gateway may use a more appropiate Internet domain. Of course, it is essential that multiple gateways for one FTN zone/domain use the {\itshape same\/} Internet domain for gated Message-IDs!!! 

Of course, there may be different Internet domains for the sender's address (From header), but for Message-IDs a unique Internet domain for each gated FTN zone/domain is {\itshape mandatory\/}. 


\section{Converting FTN \verb+^+AMSGID to RFC Message-ID }



Converting \verb+^+AREPLY works the same way, using References for news or In-Reply-To for mail. 


\subsection{FIDO messages without \verb+^+AMSGID }



Some FIDO messages do not contain a unique \verb+^+AMSGID. In this case it is necessary to generate a Message-ID which is the same for all gateways. (Otherwise dupes on the Internet side cannot be detected.)

The proposed method works as follows: for each message without a MSGID the `id' part of Message-ID is composed of the string "NOMSGID\_", the FTN sender address Z:N/F.P using MIME-style quoted printables for `:', `/' as in 3.3, the string "\_", the date of the message formatted as "YYMMDD\_HHMMSS" (year month day, hour minute second), the string "\_", and a CRC32 over the concatenation of the FIDO headers From, To, and Subject. 
\begin{itemize}
\item The FTN sender address is taken from the origin line (EchoMail) or the message header + \verb+^+AINTL/FMPT/TOPT (NetMail). A node address must include the `.0'.  
\item The date is taken from the date field in the message header.  
\item The CRC value is computed using the same polynomial and method as specified in section 6.   
\end{itemize}


The `do.main' part is the Internet domain appropiate for this FTN (fidonet.org for FIDONET zone 1-6).

Examples:
\begin{verbatim}
FIDO-Message    From:    Martin Junius @ FIDO 2:242/6.1 
                To:      Test User     @ FIDO 2:242/6 
                Subject: Nur ein Test 
                Date:    06 Dec 92  22:22:00 
--{\(>\)} 
Message-ID: {\(<\)}NOMSGID_2=3A242=2F6.1_921206_222200_08cfe072@fidonet.org{\(>\)} 
\end{verbatim}




\begin{verbatim}
FIDO-Message    From:    Martin Junius @ FIDO 2:2452/110 
                To:      Test User     @ FIDO 2:2452/111 
                Subject: Nur ein Test 
                Date:    05 Jan 95  11:23:32 
--{\(>\)} 
Message-ID: {\(<\)}NOMSGID_2=3A2452=2F110.0_950105_112332_08cfe072@fidonet.org{\(>\)} 
\end{verbatim}


08cfe072 = CRC32("Martin Junius" + "Test User" + "Nur ein Test")

PROBLEMS: message with the same date and subject, e.g. robot mails or split mails, will get the same Message-ID and therefore be trashed by the news dupe check. 


\subsection{FTN MSGID with Internet ID }

\begin{verbatim}
^AMSGID: {\(<\)}id@do.main{\(>\)} abcd1234 
--{\(>\)} 
Message-ID: {\(<\)}id@do.main{\(>\)} 
\end{verbatim}


If the origin address part of MSGID is a valid RFC Message-ID `{\(<\)}*@*{\(>\)}', then it is directly used for the RFC Message-ID. If `{\(<\)}id@do.main{\(>\)}' is quoted according to the FTS-0009 specs ("..."), these quotes must be removed and double quotes ("") reduced to a single one. 


\subsection{Generic MSGID Conversion }



This procedure may be used for all FIDO-style and unknown MSGIDs.   
\begin{verbatim}
^AMSGID: anything abcd1234 
--{\(>\)} 
Message-ID: {\(<\)}MSGID_mimeanything_abcd1234@ftn.domain{\(>\)} 
\end{verbatim}


`anything' is converted to `mimeanything' using the following rules (see also the Q encoding specified in RFC1522): 
\begin{itemize}
\item ` ' (space) is converted to `\_' (underscore)  
\item Any character not allowed in RFC822 atoms (except `.'), `/', `=' and `\_' (meaning control chars {\(<\)} 0x20, {\ttfamily (){\(<\)}{\(>\)}@,;:"[]/=\_} and chars {\(>\)}= 0x7f) are converted to a MIME-style quoted printable `=XX' where XX is the hex ASCII character code (upper case).  
\item All other characters are left as is.   
\end{itemize}


`ftn.domain' must be the appropiate Internet domain (fidonet.org for FIDONET zone 1-6). If `anything' is a string quoted with "...", these quotes and any quotes within the string are kept as `=22'.

Examples:  
\begin{verbatim}
^AMSGID: 2:2452/110.1@FIDONet abcd1234 
--{\(>\)} 
Message-ID: {\(<\)}MSGID_2=3A2452=2F110.1=40FIDONet_abcd1234@fidonet.org{\(>\)}
\end{verbatim}




\begin{verbatim}
^AMSGID: 242:1000/1.1 abcd1234 
--{\(>\)} 
Message-ID: {\(<\)}MSGID_242=3A1000=2F1.1_abcd1234@fido.de{\(>\)}
\end{verbatim}




\begin{verbatim}
^MSGID: "some "" junk" abcd1234 
--{\(>\)} 
Message-ID: {\(<\)}MSGID_=22some_=22=22_junk=22_abcd1234@fidonet.org{\(>\)}
\end{verbatim}



\section{RFC Message-ID to FTN MSGID Conversion}




\subsection{NOMSGID Message-IDs }



Any Message-ID starting with {\(<\)}NOMSGID...@...{\(>\)} is NOT converted back to an FTN \verb+^+AMSGID or \verb+^+AREPLY! 


\subsection{Normal Message-IDs }

\begin{verbatim}
Message-ID: {\(<\)}id@do.main{\(>\)} 
--{\(>\)} 
^AMSGID: {\(<\)}id@do.main{\(>\)} abcd1234 
\end{verbatim}


RFC Message-IDs are converted by putting the entire string into the origin address part of FTN MSGID and adding a hex serial number.
\begin{itemize}
\item For EchoMail, the `abcd1234' hex number is a checksum computed for the concatenation of the Message-ID string and the FTN area name (upper case letters).
abcd1234 = CRC32("{\(<\)}id@do.main{\(>\)}" + "AREA")
\item For NetMail the hex number is just the checksum computed for the Message-ID string. 
abcd1234 = CRC32("{\(<\)}id@domain{\(>\)}")
\end{itemize}


If the Message-ID contains the characters ` ' (space) or `"', the `{\(<\)}id@domain{\(>\)}' string must be quoted using "..." according to FTS-0009. Any `"' within this string must be doubled.

Putting the area name into the CRC32 value generates different MSGIDs for different areas, preventing nopes, if the FTN tosser does dupe checking on a global basis.  Examples:  
\begin{verbatim}
Message-ID: {\(<\)}1991Aug9.034239.10837@bisun.nbg.sub.org{\(>\)} 
FTN Area: DE.COMM.GATEWAYS 
--{\(>\)} 
^AMSGID: {\(<\)}1991Aug9.034239.10837@bisun.nbg.sub.org{\(>\)} 9dc743f7
\end{verbatim}




\begin{verbatim}
Message-ID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 
FTN Area: GATEWAYS.GER 
--{\(>\)} 
^AMSGID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 22f000eb
\end{verbatim}




\begin{verbatim}
Message-ID: {\(<\)}junk" id "@illegal{\(>\)} 
FTN Area: JUNK 
--{\(>\)} 
^AMSGID: "{\(<\)}junk"" id ""@illegal{\(>\)}" 22a75d09 
\end{verbatim}



\subsection{Converted FTN Message-IDs }

\begin{verbatim}
Message-ID: {\(<\)}MSGID-mimeanything_abcd1234@ftn.domain{\(>\)} 
--{\(>\)} 
^AMSGID: anything abcd1234 
\end{verbatim}


Reversing the rules of 3.3: 
\begin{itemize}
\item `\_' is converted to ` ' (space).  
\item `=XX' is converted to the character with hex code XX.   
\end{itemize}


Examples:  
\begin{verbatim}
Message-ID: {\(<\)}MSGID_2=3A2452=2F110.99_fedcba98@fidonet.org{\(>\)} 
--{\(>\)} 
^AMSGID: 2:2452/110.99 fedcba98 
\end{verbatim}



\section{Splitting Messages }



Due to the limitation of some FTN programs, it is necessary to split messages larger than 16K (to be on the safe side, 13-14K is a reasonable value for the max. size of the message \_body\_) when gating to FTN.

To prevent messages from vanishing in the bit bucket, the \verb+^+AMSGID must be different for the split parts. Due to the brain damage of most FTN dupe checkers it's also necessary to modify the subject line.  The proposed technique is to increment the `abcd1234' hex number by 1 for subsequent messages, i.e. the value computed as above for part 1, +1 for part 2, +2 for part 3, and so on. The hex number in \verb+^+AREPLY is not modified.

The subject of part 1 is unmodified, for subsequent parts the part number is prepended to the subject, string "nn: ".

To indicate the splitting, a \verb+^+ASPLIT kludge according to FSC-0047 is used before the first line of the message body part:   
\begin{verbatim}
^ASPLIT: date      time     @net/node    nnnnn pp/xx +++++++++++ 
\end{verbatim}


e.g. 
\begin{verbatim}
^ASPLIT: 30 Mar 90 11:12:34 @494/4       123   02/03 +++++++++++ 
\end{verbatim}


There is exactly one empty line after the message body part, before the "---" tear line or the first \verb+^+AVia line.  Example:   
\begin{verbatim}
Subject: This is a 3 part message 
Message-ID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 
 
FTN Area: GATEWAYS.GER 
 
--{\(>\)} 
Subj: This is a 3 part message 
^AMSGID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 22f000eb 
^ASPLIT: 30 Mar 90 11:12:34 @494/4       00000 01/03 +++++++++++ 
 
Subj: 02: This is a 3 part message 
^AMSGID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 22f000ec 
^ASPLIT: 30 Mar 90 11:12:34 @494/4       00000 02/03 +++++++++++ 
 
Subj: 03: This is a 3 part message 
^AMSGID: {\(<\)}IBNTXSD@methan.chemie.fu-berlin.de{\(>\)} 22f000ed 
^ASPLIT: 30 Mar 90 11:12:34 @494/4       00000 03/03 +++++++++++ 
\end{verbatim}



\section{Computing CRC32 values }



The CRC32 value is computed using the polynomial  
\begin{itemize}
\item X\verb+^+32+X\verb+^+26+X\verb+^+23+X\verb+^+22+X\verb+^+16+X\verb+^+12+X\verb+^+11+X\verb+^+10+X\verb+^+8+X\verb+^+7+X\verb+^+5+X\verb+^+4+X\verb+^+2+X\verb+^+1+X\verb+^+0
\end{itemize}


a start value of 0xffffffff and XORing the result with 0xffffffff (same as in ZModem and ZIP). The resulting value is printed using an 8 digit hex number with lower case letters a-f. 



\end{document}
