head 1.10; access; symbols LMTP2NNTP_1_4_1:1.10 LMTP2NNTP_1_4_0:1.10 LMTP2NNTP_1_3_0:1.10 LMTP2NNTP_1_3b2:1.10 LMTP2NNTP_1_3b1:1.10 LMTP2NNTP_1_3a3:1.10 LMTP2NNTP_1_3a2:1.10 LMTP2NNTP_1_3a1:1.10 LMTP2NNTP_1_2_0:1.10 LMTP2NNTP_1_2b4:1.10 LMTP2NNTP_1_2b3:1.10 LMTP2NNTP_1_2b2:1.10 LMTP2NNTP_1_2b1:1.9 LMTP2NNTP_1_2a8:1.9 LMTP2NNTP_1_2a7:1.8 LMTP2NNTP_1_2a6:1.7 LMTP2NNTP_1_2a5:1.7 LMTP2NNTP_1_2a4:1.3 LMTP2NNTP_1_2a3:1.3 SOURCE_RESTRUCTURING_AFTER:1.1; locks; strict; comment @ * @; 1.10 date 2003.02.10.10.13.12; author thl; state Exp; branches; next 1.9; 1.9 date 2003.02.06.13.50.08; author thl; state Exp; branches; next 1.8; 1.8 date 2003.01.30.19.42.13; author rse; state Exp; branches; next 1.7; 1.7 date 2002.05.29.21.35.52; author thl; state Exp; branches; next 1.6; 1.6 date 2002.05.27.15.09.50; author thl; state Exp; branches; next 1.5; 1.5 date 2002.05.23.09.37.15; author thl; state Exp; branches; next 1.4; 1.4 date 2002.05.23.08.35.12; author thl; state Exp; branches; next 1.3; 1.3 date 2002.02.20.15.42.26; author thl; state Exp; branches; next 1.2; 1.2 date 2001.12.31.15.15.36; author thl; state Exp; branches; next 1.1; 1.1 date 2001.12.31.11.09.53; author thl; state Exp; branches; next ; desc @@ 1.10 log @extend copyright messages based on CVS information @ text @/* ** OSSP lmtp2nntp - Mail to News Gateway ** Copyright (c) 2001-2003 Ralf S. Engelschall ** Copyright (c) 2001-2003 The OSSP Project ** Copyright (c) 2001-2003 Cable & Wireless Germany ** ** 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/tool/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 . ** ** lmtp2nntp_msg.h: mail message manipulation library (API) */ #ifndef __MSG_H__ #define __MSG_H__ #include #include "l2.h" #include "val.h" #include "lmtp2nntp_global.h" extern void logbook(l2_channel_t *, l2_level_t, const char *, ...); #include struct headerrule_st; typedef struct headerrule_st headerrule_t; struct headerrule_st { headerrule_t *next; int pri; char *regex; char *name; char *val; pcre *pcreRegex; pcre_extra *pcreExtra; }; struct headerdata_st; typedef struct headerdata_st headerdata_t; struct headerdata_st { headerdata_t *prev; headerdata_t *next; char *name; int ndata; /* =0 means data is invalid, =1 means use data.s, >1 means use data.m */ union { char *s; char **m; } data; }; 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; headerdata_t *hdFirst; 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; /* logging context, inherited as a copy from parent */ val_t *prival; /* access to private application context */ } msg_t; struct regex_ctx_st; typedef struct regex_ctx_st regex_ctx_t; struct regex_ctx_st { int nMatch; const char **acpMatch; l2_env_t *l2_env; l2_channel_t *l2; }; #define WRAPAT 120 /* join wraps header lines when exceeding this value */ #define WRAPUSING "\n " /* join inserts this value when wrapping lines */ #define DATELENMAX 32 /* strlen("Mon, 31 Jul 2002 12:34:56 +0123")+1 */ typedef enum { MSG_OK, MSG_ERR_MEM, MSG_ERR_SPLITHEADBODY, MSG_ERR_SPLITLEN, MSG_ERR_SPLITMISSINGFROM, MSG_ERR_JOINGROUPNONE, MSG_ERR_JOINGROUPEMPTY, MSG_ERR_JOINIDNONE, MSG_ERR_JOINIDEMPTY, MSG_ERR_JOINIDMULTI, MSG_ERR_ARG } msg_rc_t; msg_t *msg_create(val_t *); 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.9 log @moving definitions between header files @ text @d3 3 a5 3 ** Copyright (c) 2002-2003 Ralf S. Engelschall ** Copyright (c) 2002-2003 The OSSP Project ** Copyright (c) 2002-2003 Cable & Wireless Germany @ 1.8 log @Apply the standard OSSP copyright header, document ASCII art and fix URL to lmtp2nntp homepage. @ text @d38 28 d72 1 a72 1 struct headerdata_st *hdFirst; /*FIXME i want headerdata_t here */ a119 1 @ 1.7 log @remove lot of hardcoded header handling; user can now shoot himself in foot @ text @d2 4 a5 2 ** Copyright (c) 2001-2002 The OSSP Project ** Copyright (c) 2001-2002 Cable & Wireless Deutschland d9 1 a9 1 ** It can be found at http://www.ossp.org/pkg/lmtp2nntp/. d26 1 a26 1 ** msg.c: mail message manipulation library (API) @ 1.6 log @createmessageid now using lib_val; added support for long nodenames @ text @a74 3 MSG_ERR_SPLITIDNONE, MSG_ERR_SPLITIDEMPTY, MSG_ERR_SPLITIDMULTI, d79 1 @ 1.5 log @renamed and relocated @ text @d33 1 a33 1 d51 2 a52 1 l2_channel_t *l2; d85 1 a85 1 msg_t *msg_create(void); @ 1.4 log @relocation to new home @ text @d66 2 @ 1.3 log @flush work done this week. New structure for headers. Basic loop of desired new header rewriting feature currently supports replacing a header, adding a header and regex matching finds the correct header and calls lib_var. Try ./lmtp2nntp -i 1.conf -h ':Reply-To:New-Reply:${xyz}' -h ::To:bv -h 21::ch:cv @ text @d54 9 @ 1.2 log @bump copyright year @ text @d42 1 @ 1.1 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 @d2 2 a3 2 ** Copyright (c) 2001 The OSSP Project ** Copyright (c) 2001 Cable & Wireless Deutschland @