xref: /freebsd/contrib/file/magic/Magdir/mail.news (revision 35c0a8c449fd2b7f75029ebed5e10852240f0865)
1#------------------------------------------------------------------------------
2# $File: mail.news,v 1.32 2024/11/10 16:59:38 christos Exp $
3# mail.news:  file(1) magic for mail and news
4#
5# Unfortunately, saved netnews also has From line added in some news software.
6#0	string		From 		mail text
70	string/t		Relay-Version: 	old news text
8!:mime	message/rfc822
90	string/t		#!\ rnews	batched news text
10!:mime	message/rfc822
110	string/t		N#!\ rnews	mailed, batched news text
12!:mime	message/rfc822
130	string/t		Forward\ to 	mail forwarding text
14!:mime	message/rfc822
150	string/t		Pipe\ to 	mail piping text
16!:mime	message/rfc822
170	string/tc		delivered-to:	SMTP mail text
18!:mime	message/rfc822
190	string/tc		return-path:	SMTP mail text
20!:mime	message/rfc822
210	string/t		Path:		news text
22!:mime	message/news
230	string/t		Xref:		news text
24!:mime	message/news
250	string/t		From:		news or mail text
26!:mime	message/rfc822
270	string/t		Date:		news or mail text
28!:mime	message/rfc822
290	string/t		Subject:	news or mail text
30!:mime	message/rfc822
310	string/t		Cc:		news or mail text
32!:mime	message/rfc822
330	string/t		To:		news or mail text
34!:mime	message/rfc822
350	string/t		Article 	saved news text
36!:mime	message/news
37# Reference:	http://quimby.gnus.org/notes/BABYL
38# Update:	Joerg Jenderek
39# Note:		used by Rmail in Emacs version 22 and before
40#		is not text because of characters like Control-L Control-_
410	string/b		BABYL\ OPTIONS:	Emacs RMAIL
42#0	string/t		BABYL		Emacs RMAIL text
43# https://reposcope.com/mimetype/message/x-gnu-rmail
44!:mime	message/x-gnu-rmail
45# ~/RMAIL
46!:ext	/
470	string/t		Received:	RFC 822 mail text
48!:mime	message/rfc822
490	string/t		MIME-Version:	MIME entity text
50#0	string/t		Content-	MIME entity text
51
52# From:		Joerg Jenderek
53# URL:		https://tools.ietf.org/rfc/rfc4155.txt
54# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/m/mbox.trid.xml
55# Note:		called "Standard Unix Mailbox" by TrID and
56#		"mailbox file" by shared MIME-info database
57#https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/data/freedesktop.org.xml.in?ref_type=heads
580	string			From\040	Mailbox text
59#!:mime	text/plain
60!:mime	application/mbox
61# like: INBOX 1.mbox
62!:ext	/mbox
63# For control reasons show first line like: "From - Tue May 30 21:55:54 2023" "From noreply@unitymedia.info  Thu Oct 13 17:23:38 2016"
64>0	string		x	\b, 1st line "%s"
65
66# TNEF files...
67# URL:		http://fileformats.archiveteam.org/wiki/Transport_Neutral_Encapsulation_Format
68#		https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format
69# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/t/tnef.trid.xml
70#		https://interoperability.blob.core.windows.net/files/MS-OXTNEF/%5bMS-OXTNEF%5d-210817.pdf
71# Update:	Joerg Jenderek
72# Note:		moved and merged from ./msdos (version 1.154) there just called "TNEF"
73#		partly verified by `tnef --list -v -f voice.tnef` and `ytnef -v  triples.tnef`
74# TNEF magic From "Joomy" <joomy@se-ed.net>
75# TNEF_SIGNATURE
760	lelong		0x223E9F78	Transport Neutral Encapsulation Format (TNEF)
77!:mime	application/vnd.ms-tnef
78# winmail.dat or win.dat by Microsoft Outlook
79!:ext	tnef/dat
80# https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxtnef/7fdb64ee-7f63-4d95-9af1-c672e7475c3a
81# LegacyKey
82#>4	uleshort	x		\b, key %#4.4x
83# attrLevelMessage; Level where attribute applies like: 1~attrLevelMessage 2~attrLevelAttachment
84>6	ubyte		!1		\b, 1st level %#2.2x
85# other ID (like 02900000h) or TnefVersion ID (idTnefVersion=06900800h)
86>7	ubelong		!0x06900800	\b, 1st id %#8.8x
87>7	ubelong		=0x06900800
88# TnefVersion length like: 4
89>>11	ulelong		!4		\b, TnefVersion length %x
90# TNEFVersionData; TnefVersion data like: 00010000h
91>>15	ulelong		!0x00010000h	\b, version %#8.8x
92# Checksum like: 1
93>>19	uleshort	!1		\b, checksum %#4.4x
94# attrLevelMessage; level of attOemCodepage like: 1
95>>21	ubyte		!1		\b, level %#2.2x
96# idOEMCodePage; OEMCodePage ID like: 07900600h
97>>22	ubelong		=0x07900600	\b, OEM codepage
98# OEMCodePage length like: 8
99>>>26	ulelong		=8
100# OEMCodePageData; PrimaryCodePage like: 1251 1252
101>>>>30	ulelong		x		%u
102# OEMCodePageData; SecondaryCodePage; unused and SHOULD contain zero
103>>>>34	ulelong		!0		and %u
104# OEMCodePageData Checksum like: E7h E8h
105>>>>38	uleshort	x		(checksum %#x)
106# attrLevelMessage of attMessageClass like: 1
107>>40	ubyte		!1		\b, level %u
108# idMessageClass; ID of attMessageClass like: 08800700h
109>>41	ubelong		=0x08800700	\b, MessageAttribute
110# attMessageClass length like: 16 24 25
111#>>>45	ulelong		x		(length %u)
112# attMessageClass data like: "IPM.Microsoft Mail.Note" "IPM.Note.Portada Newseum"
113# "IPM.Appointment" "IPM.Note.Microsoft.Voicemail.UM.CA"
114>>>45	pstring/l	x		"%s"
115
116# From: Kevin Sullivan <ksulliva@psc.edu>
1170	string		*mbx*		MBX mail folder
118
119# From: Simon Matter <simon.matter@invoca.ch>
1200	string		\241\002\213\015skiplist\ file\0\0\0	Cyrus skiplist DB
1210	string		\241\002\213\015twoskip\ file\0\0\0\0	Cyrus twoskip DB
122
123# JAM(mbp) Fidonet message area databases
124# JHR file
1250	string	JAM\0			JAM message area header file
126>12	leshort >0			(%d messages)
127
128# Squish Fidonet message area databases
129# SQD file (requires at least one message in the area)
130# XXX: Weak magic
131#256	leshort	0xAFAE4453		Squish message area data file
132#>4	leshort	>0			(%d messages)
133
134#0	string		\<!--\ MHonArc		text/html; x-type=mhonarc
135
136# Cyrus: file(1) magic for compiled Cyrus sieve scripts
137# URL: https://www.cyrusimap.org/docs/cyrus-imapd/2.4.6/internal/bytecode.php
138# URL: http://git.cyrusimap.org/cyrus-imapd/tree/sieve/bytecode.h?h=master
139# From: Philipp Hahn <hahn@univention.de>
140
141# Compiled Cyrus sieve script
1420       string CyrSBytecode     Cyrus sieve bytecode data,
143>12     belong =1       version 1, big-endian
144>12     lelong =1       version 1, little-endian
145>12     belong x        version %d, network-endian
146
147# Dovecot mail server, version 2.2 and later.
148# Dovecot mailing list: dovecot@dovecot.org
149# File format spec: https://wiki.dovecot.org/Design/Dcrypt/#File_format
150# From: Stephen Gildea
1510	string	CRYPTED\003\007		Dovecot encrypted message
152>9	byte	x			\b, dcrypt version %d
153