2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
27 * $TOG: RFCMIME.hh /main/6 1997/03/28 12:10:13 mgreess $
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement bertween
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
35 * Sun's specific written approval. This documment and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 #ifndef I_HAVE_NO_IDENT
50 #include "RFCFormat.hh"
52 class RFCMIME : public RFCFormat {
54 RFCMIME(DtMail::Session *);
57 static void readBase64(char * dest, int & size, const char * text,
58 const unsigned long text_len);
60 static void readQPrint(char * dest, int & size, const char * text,
61 const unsigned long text_len);
63 static void readTextEnriched(char * dest, int & size, const char * text,
64 const unsigned long text_len);
66 void writeBase64(Buffer & buf, const char * bp,
67 const unsigned long len);
69 void writeQPrint(Buffer & buf, const char * bp,
70 const unsigned long len);
73 // unsigned char digest[16];
75 static void md5PlainText(const char * bp,
76 const unsigned long len,
77 unsigned char * digest);
87 virtual void formatBodies(DtMailEnv & error,
88 DtMail::Message & msg,
89 DtMailBoolean include_content_length,
90 char ** extra_headers,
93 virtual void formatHeaders(DtMailEnv & error,
94 DtMail::Message & msg,
95 DtMailBoolean include_unix_from,
96 const char * extra_headers,
99 virtual void rfc1522cpy(Buffer & buf, const char * value);
104 DtMail::BodyPart * bp,
106 DtMailBoolean & is_text);
107 Encoding getHdrEncodingType(
112 Encoding getEncodingType(
117 Encoding getClearEncoding(
121 void writeContentHeaders(
127 DtMailBoolean show_as_attachment,
133 const unsigned long len);
135 Buffer & buf, char * type, char * name,
136 char *contents, unsigned long len);