head 1.8;
access;
symbols
SOURCE_RESTRUCTURING_BEFORE:1.7
LMTP2NNTP_1_2a1:1.7
LMTP2NNTP_1_1_1:1.6
LMTP2NNTP_1_1_0:1.6
LMTP2NNTP_1_1b4:1.6
LMTP2NNTP_1_1b3:1.6
LMTP2NNTP_1_1b2:1.6
LMTP2NNTP_1_1b1:1.6
LMTP2NNTP_1_0_0:1.6
LMTP2NNTP_0_9_7:1.6
LMTP2NNTP_0_9_6:1.6
LMTP2NNTP_0_9_5:1.6
LMTP2NNTP_0_9_4:1.4
LMTP2NNTP_0_9_3:1.4
LMTP2NNTP_0_9_2:1.3
LMTP2NNTP_0_9_1:1.3
LMTP2NNTP_0_9_0:1.3;
locks; strict;
comment @ * @;
1.8
date 2001.12.31.11.09.53; author thl; state dead;
branches;
next 1.7;
1.7
date 2001.12.11.11.53.11; author thl; state Exp;
branches;
next 1.6;
1.6
date 2001.09.11.13.41.22; author thl; state Exp;
branches;
next 1.5;
1.5
date 2001.09.04.09.46.06; author rse; state Exp;
branches;
next 1.4;
1.4
date 2001.08.27.13.45.53; author thl; state Exp;
branches;
next 1.3;
1.3
date 2001.08.14.14.42.41; author thl; state Exp;
branches;
next 1.2;
1.2
date 2001.08.14.08.15.25; author thl; state Exp;
branches;
next 1.1;
1.1
date 2001.08.13.06.41.41; author thl; state Exp;
branches;
next ;
desc
@@
1.8
log
@Mega-Commit: Finally restructure the lmtp2nntp source tree in order to clean
it up. We especially use a consistent prefix for all inlined sources.
@
text
@/*
** Copyright (c) 2001 The OSSP Project
** Copyright (c) 2001 Cable & Wireless Deutschland
**
** This file is part of OSSP lmtp2nntp, an LMTP speaking local
** mailer which forwards mails as Usenet news articles via NNTP.
** It can be found at http://www.ossp.org/pkg/lmtp2nntp/.
**
** 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.0 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 file; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
** USA, or contact the OSSP project .
**
** msg.c: mail message manipulation library (API)
*/
#ifndef __MSG_H__
#define __MSG_H__
#include
#include "l2.h"
#include "lmtp2nntp.h"
typedef struct {
char *azEnvgroups; /* Groups according to Envelope in GROUPMODE_ENVELOPE */
size_t asEnvgroups;
char *cpMsg; /* the wholly message to be received by DATA command */
char *azHeaders; /* header part of message above */
size_t asHeaders;
char *cpFid; /* foreign (aka sendmail queue) id from parsing headers */
char *cpBody; /* body part of message above */
char *cpMsgid;
char *mail_from;
char *azRcpt;
size_t asRcpt;
char *azNewsgroups;
size_t asNewsgroups;
l2_channel_t *l2;
} msg_t;
#define WRAPAT 120 /* join wraps header lines when exceeding this value */
#define WRAPUSING "\n " /* join inserts this value when wrapping lines */
typedef enum {
MSG_OK,
MSG_ERR_MEM,
MSG_ERR_SPLITHEADBODY,
MSG_ERR_SPLITLEN,
MSG_ERR_SPLITMISSINGFROM,
MSG_ERR_SPLITIDNONE,
MSG_ERR_SPLITIDEMPTY,
MSG_ERR_SPLITIDMULTI,
MSG_ERR_JOINGROUPNONE,
MSG_ERR_JOINGROUPEMPTY,
MSG_ERR_JOINIDNONE,
MSG_ERR_JOINIDEMPTY,
MSG_ERR_ARG
} msg_rc_t;
msg_t *msg_create(void);
msg_rc_t msg_split(msg_t *);
msg_rc_t msg_join(msg_t *);
void msg_destroy(msg_t *);
char *msg_error(msg_rc_t);
#endif /* __MSG_H__ */
@
1.7
log
@switch to latest L2 version
@
text
@@
1.6
log
@msg.c is now l2 enabled; improved logging using foreign (aka sendmail queuing)
id; now calculating and logging message size;
@
text
@d48 1
a48 1
l2_stream_t *l2;
@
1.5
log
@Finally apply GNU General Public License (GPL) to OSSP lmtp2nntp.
@
text
@d31 2
d40 1
d48 1
@
1.4
log
@worked out all FIXMEs in msg.c; renamed SPLITSPLITBODY to SPLITHEADBODY - this
was a search'n'replace accident; major changes in the "fold headers"
functionality in msg_join(); modified str_parse calls to (re)use the now fixed
[^not] operator; made workarounds for missing str_parse() functionality "s//g"
and "malloc optimization" permanent; reviewed "Path: not-for-mail" issue and
kept it as is; the "testmessage.vialmtp" now contains very long headers to be
wrapped/ folded; updated 00TODO;
@
text
@d1 25
d35 2
a36 2
char *cpMsg; /* the wholly message to be received by DATA command */
char *azHeaders; /* header part of message above */
d38 1
a38 1
char *cpBody; /* body part of message above */
@
1.3
log
@connected LMTP and NNTP side, now featuring all three -g groupmodes, added post1000 articles burn-in
@
text
@d28 1
a28 1
MSG_ERR_SPLITSPLITBODY,
@
1.2
log
@cleanup msg.[ch], moved tracing to trace.[ch], added target to Makefile, added -t switch in lmtp2nntp.[c|pod], incorporated tracing into lmtp.[ch] and nntp.[ch], run.sh now using new tracing option
@
text
@d8 2
d45 1
a45 1
char *msg_error(msg_t *, msg_rc_t);
@
1.1
log
@moved message issues from lmtp2nntp.[ch] and nntp.[ch] into separate new file msg.[ch]
@
text
@d9 2
a10 1
char *cpHeaders; /* header part of message above */
a15 4
char *azHeaders;
size_t asHeaders;
char *azBody;
size_t asBody;
d19 3
@