b151ef55 |
/*
* Copyright (C) 2002 Nigel Horne <njh@bandsman.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
fbef387b |
*
* $Log: message.h,v $ |
0856891e |
* Revision 1.22 2004/11/22 15:18:51 nigelhorne
* Performance work
* |
5f72fd3b |
* Revision 1.21 2004/10/16 17:24:15 nigelhorne
* Handle colons in quotes in headers
* |
e24738dc |
* Revision 1.20 2004/10/14 17:45:55 nigelhorne
* Try to reclaim some memory if it becomes low when decoding
* |
00f95393 |
* Revision 1.19 2004/09/17 13:47:19 nigelhorne
* Handle yEnc attachments
* |
2bcec72b |
* Revision 1.18 2004/09/17 09:48:53 nigelhorne
* Handle attempts to hide mime type
* |
0e3b08fc |
* Revision 1.17 2004/09/15 18:08:23 nigelhorne
* Handle multiple encoding types
* |
a446de17 |
* Revision 1.16 2004/08/23 13:15:16 nigelhorne
* messageClearMarkers
* |
e6b25cd3 |
* Revision 1.15 2004/08/22 15:08:59 nigelhorne
* messageExport
* |
1e06e1ab |
* Revision 1.14 2004/08/22 10:34:24 nigelhorne
* Use fileblob
* |
de617e3e |
* Revision 1.13 2004/08/21 11:57:57 nigelhorne
* Use line.[ch]
* |
285a69b4 |
* Revision 1.12 2004/07/20 14:35:29 nigelhorne
* Some MYDOOM.I were getting through
* |
edb35c0a |
* Revision 1.11 2004/05/06 18:01:25 nigelhorne
* Force attachments marked as RFC822 messages to be scanned
* |
3b6eace4 |
* Revision 1.10 2004/04/05 12:04:56 nigelhorne
* Scan attachments with no filename
* |
4c927f11 |
* Revision 1.9 2004/04/01 15:32:34 nigelhorne
* Graceful exit if messageAddLine fails in strdup
* |
ffd59a3e |
* Revision 1.8 2004/03/29 09:22:03 nigelhorne
* Tidy up code and reduce shuffling of data
* |
627465e7 |
* Revision 1.7 2004/03/21 17:19:49 nigelhorne
* Handle bounce messages with no headers
* |
f5a4d7e8 |
* Revision 1.6 2004/03/21 09:41:27 nigelhorne
* Faster scanning for non MIME messages
* |
5a01973c |
* Revision 1.5 2004/01/28 10:15:24 nigelhorne
* Added support to scan some bounce messages
* |
fbef387b |
* Revision 1.4 2004/01/14 18:02:55 nigelhorne
* added definition of binhexBegin
* |
b151ef55 |
*/
#ifndef _MESSAGE_H
#define _MESSAGE_H
typedef struct message {
mime_type mimeType; |
0e3b08fc |
encoding_type *encodingTypes;
int numberOfEncTypes; /* size of encodingTypes */ |
b151ef55 |
char *mimeSubtype; |
c6259ac5 |
int numberOfArguments; /* count of mimeArguments */
char **mimeArguments; |
b151ef55 |
char *mimeDispositionType; /* probably attachment */
text *body_first, *body_last; |
285a69b4 |
char base64_1, base64_2, base64_3;
int base64chars; |
f5a4d7e8 |
/*
* Markers for the start of various non MIME messages that could
* be included within this message
*/ |
5f72fd3b |
const text *bounce; /* start of a bounced message */
const text *binhex; /* start of a binhex message */
const text *uuencode; /* start of a uuencoded message */
const text *yenc; /* start of a yEnc message */
const text *encoding; /* is the non MIME message encoded? */
const text *dedupedThisFar; |
b151ef55 |
} message;
message *messageCreate(void);
void messageDestroy(message *m);
void messageReset(message *m); |
2bcec72b |
int messageSetMimeType(message *m, const char *type); |
b151ef55 |
mime_type messageGetMimeType(const message *m);
void messageSetMimeSubtype(message *m, const char *subtype);
const char *messageGetMimeSubtype(const message *m);
void messageSetDispositionType(message *m, const char *disptype);
const char *messageGetDispositionType(const message *m);
void messageAddArgument(message *m, const char *arg);
void messageAddArguments(message *m, const char *arg);
const char *messageFindArgument(const message *m, const char *variable);
void messageSetEncoding(message *m, const char *enctype);
encoding_type messageGetEncoding(const message *m); |
de617e3e |
int messageAddLine(message *m, line_t *line);
int messageAddStr(message *m, const char *data);
int messageAddStrAtTop(message *m, const char *data); |
b151ef55 |
const text *messageGetBody(const message *m);
void messageClean(message *m); |
1e06e1ab |
fileblob *messageToFileblob(message *m, const char *dir); |
e6b25cd3 |
blob *messageToBlob(message *m); |
285a69b4 |
text *messageToText(message *m); |
0856891e |
const text *binhexBegin(const message *m); |
cec5297a |
const text *uuencodeBegin(const message *m); |
00f95393 |
const text *yEncBegin(const message *m); |
5a01973c |
const text *bounceBegin(const message *m); |
627465e7 |
const text *encodingLine(const message *m); |
a446de17 |
void messageClearMarkers(message *m); |
b151ef55 |
#endif /*_MESSAGE_H*/ |