Upgrade CVS to 0.33.18 current

This commit is contained in:
Michiel Broek
2001-08-25 19:53:11 +00:00
parent 2ff822f657
commit e90745a139
111 changed files with 3126 additions and 3121 deletions

View File

@@ -4,29 +4,22 @@ SUBDIRS = .
EXTRA_DIST = maptabs.tgz paths.h.in README
noinst_PROGRAMS = mbfido mbmail mbseq mbaff mbindex mbdiff mbfile mbmsg
noinst_PROGRAMS = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg
mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c \
importmsg.c echoout.c tracker.c makestat.c scannews.c lhash.c \
tracker.c makestat.c scannews.c lhash.c \
pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c \
addbbs.c magic.c fsort.c toberep.c mkrfcmsg.c atoul.c ping.c \
cookie.c forward.c sendmail.c scan.c addpkt.c importnet.c \
areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c \
rnews.c newspost.c aliasdb.c postemail.c postnetmail.c backalias.c \
addbbs.c magic.c fsort.c toberep.c ftn2rfc.c atoul.c ping.c \
cookie.c forward.c sendmail.c scan.c addpkt.c storenet.c storeecho.c \
areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rfc2ftn.c \
rnews.c newspost.c aliasdb.c postemail.c postnetmail.c postecho.c backalias.c \
flock.h tosspkt.h mbfido.h hatch.h maketags.h \
importmsg.h echoout.h tracker.h makestat.h scannews.h lhash.h \
tracker.h makestat.h scannews.h lhash.h \
pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h \
addbbs.h magic.h fsort.h toberep.h mkrfcmsg.h atoul.h ping.h \
cookie.h forward.h sendmail.h scan.h addpkt.h importnet.h \
areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h \
rnews.h newspost.h aliasdb.h postemail.h postnetmail.h backalias.h
mbmail_SOURCES = message.c hash.c lhash.c atoul.c \
bread.c bwrite.c flock.c mkftnhdr.c mbmail.c tracker.c \
viadate.c importnet.c aliasdb.c \
message.h hash.h lhash.h atoul.h \
bread.h bwrite.h flock.h mkftnhdr.h mbmail.h tracker.h \
viadate.h importnet.h aliasdb.h
addbbs.h magic.h fsort.h toberep.h ftn2rfc.h atoul.h ping.h \
cookie.h forward.h sendmail.h scan.h addpkt.h storenet.h storeecho.h \
areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rfc2ftn.h \
rnews.h newspost.h aliasdb.h postemail.h postnetmail.h postecho.h backalias.h
mbseq_SOURCES = mbseq.c mbseq.h
@@ -42,7 +35,6 @@ mbfile_SOURCES = mbfile.c mbfile.h
mbmsg_SOURCES = post.c mbmsg.c post.h mbmsg.h
mbfido_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a
mbmail_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
mbseq_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
mbaff_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
mbindex_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
@@ -52,14 +44,15 @@ mbmsg_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../li
install-exec-local:
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbmail $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbseq $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbindex $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfile $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(bindir)
rm -f $(bindir)/mbmail
ln -s $(bindir)/mbfido $(bindir)/mbmail
rm -f $(bindir)/mbnews
ln -s $(bindir)/mbfido $(bindir)/mbnews
(cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; chown mbse.bbs etc/maptabs/*)
(cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; $(CHOWN) @OWNER@.@GROUP@ etc/maptabs/*)

View File

@@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
AWK = @AWK@
CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@
GROUP = @GROUP@
GZIP = @GZIP@
@@ -70,18 +71,14 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = .
EXTRA_DIST = maptabs.tgz paths.h.in README
noinst_PROGRAMS = mbfido mbmail mbseq mbaff mbindex mbdiff mbfile mbmsg
noinst_PROGRAMS = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg
mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c importmsg.c echoout.c tracker.c makestat.c scannews.c lhash.c pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c addbbs.c magic.c fsort.c toberep.c mkrfcmsg.c atoul.c ping.c cookie.c forward.c sendmail.c scan.c addpkt.c importnet.c areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rnews.c newspost.c aliasdb.c postemail.c postnetmail.c backalias.c flock.h tosspkt.h mbfido.h hatch.h maketags.h importmsg.h echoout.h tracker.h makestat.h scannews.h lhash.h pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h addbbs.h magic.h fsort.h toberep.h mkrfcmsg.h atoul.h ping.h cookie.h forward.h sendmail.h scan.h addpkt.h importnet.h areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rnews.h newspost.h aliasdb.h postemail.h postnetmail.h backalias.h
mbmail_SOURCES = message.c hash.c lhash.c atoul.c bread.c bwrite.c flock.c mkftnhdr.c mbmail.c tracker.c viadate.c importnet.c aliasdb.c message.h hash.h lhash.h atoul.h bread.h bwrite.h flock.h mkftnhdr.h mbmail.h tracker.h viadate.h importnet.h aliasdb.h
mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c tracker.c makestat.c scannews.c lhash.c pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c addbbs.c magic.c fsort.c toberep.c ftn2rfc.c atoul.c ping.c cookie.c forward.c sendmail.c scan.c addpkt.c storenet.c storeecho.c areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rfc2ftn.c rnews.c newspost.c aliasdb.c postemail.c postnetmail.c postecho.c backalias.c flock.h tosspkt.h mbfido.h hatch.h maketags.h tracker.h makestat.h scannews.h lhash.h pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h addbbs.h magic.h fsort.h toberep.h ftn2rfc.h atoul.h ping.h cookie.h forward.h sendmail.h scan.h addpkt.h storenet.h storeecho.h areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rfc2ftn.h rnews.h newspost.h aliasdb.h postemail.h postnetmail.h postecho.h backalias.h
mbseq_SOURCES = mbseq.c mbseq.h
@@ -98,7 +95,6 @@ mbfile_SOURCES = mbfile.c mbfile.h
mbmsg_SOURCES = post.c mbmsg.c post.h mbmsg.h
mbfido_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a
mbmail_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
mbseq_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
mbaff_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
mbindex_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
@@ -116,21 +112,16 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
mbfido_OBJECTS = flock.o tosspkt.o mbfido.o hatch.o maketags.o \
importmsg.o echoout.o tracker.o makestat.o scannews.o lhash.o pack.o \
ulock.o tic.o ptic.o utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o \
fsort.o toberep.o mkrfcmsg.o atoul.o ping.o cookie.o forward.o \
sendmail.o scan.o addpkt.o importnet.o areamgr.o filemgr.o notify.o \
mgrutil.o rollover.o bwrite.o rnews.o newspost.o aliasdb.o postemail.o \
postnetmail.o backalias.o
tracker.o makestat.o scannews.o lhash.o pack.o ulock.o tic.o ptic.o \
utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o fsort.o toberep.o \
ftn2rfc.o atoul.o ping.o cookie.o forward.o sendmail.o scan.o addpkt.o \
storenet.o storeecho.o areamgr.o filemgr.o notify.o mgrutil.o \
rollover.o bwrite.o rfc2ftn.o rnews.o newspost.o aliasdb.o postemail.o \
postnetmail.o postecho.o backalias.o
mbfido_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \
../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a \
../lib/libmbinet.a
mbfido_LDFLAGS =
mbmail_OBJECTS = message.o hash.o lhash.o atoul.o bread.o bwrite.o \
flock.o mkftnhdr.o mbmail.o tracker.o viadate.o importnet.o aliasdb.o
mbmail_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \
../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a
mbmail_LDFLAGS =
mbseq_OBJECTS = mbseq.o
mbseq_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \
../lib/libcommon.a ../lib/libdbase.a
@@ -167,16 +158,31 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
SOURCES = $(mbfido_SOURCES) $(mbmail_SOURCES) $(mbseq_SOURCES) $(mbaff_SOURCES) $(mbindex_SOURCES) $(mbdiff_SOURCES) $(mbfile_SOURCES) $(mbmsg_SOURCES)
OBJECTS = $(mbfido_OBJECTS) $(mbmail_OBJECTS) $(mbseq_OBJECTS) $(mbaff_OBJECTS) $(mbindex_OBJECTS) $(mbdiff_OBJECTS) $(mbfile_OBJECTS) $(mbmsg_OBJECTS)
DEP_FILES = .deps/addbbs.P .deps/addpkt.P .deps/aliasdb.P \
.deps/announce.P .deps/areamgr.P .deps/atoul.P .deps/backalias.P \
.deps/bwrite.P .deps/cookie.P .deps/fflist.P .deps/filefind.P \
.deps/filemgr.P .deps/flock.P .deps/forward.P .deps/fsort.P \
.deps/ftn2rfc.P .deps/grlist.P .deps/hash.P .deps/hatch.P .deps/lhash.P \
.deps/magic.P .deps/makestat.P .deps/maketags.P .deps/mbaff.P \
.deps/mbdiff.P .deps/mbfido.P .deps/mbfile.P .deps/mbindex.P \
.deps/mbmsg.P .deps/mbseq.P .deps/mgrutil.P .deps/mkftnhdr.P \
.deps/mover.P .deps/msgutil.P .deps/newspost.P .deps/notify.P \
.deps/pack.P .deps/ping.P .deps/post.P .deps/postecho.P \
.deps/postemail.P .deps/postnetmail.P .deps/ptic.P .deps/rfc2ftn.P \
.deps/rnews.P .deps/rollover.P .deps/scan.P .deps/scannews.P \
.deps/sendmail.P .deps/storeecho.P .deps/storenet.P .deps/tic.P \
.deps/toberep.P .deps/tosspkt.P .deps/tracker.P .deps/ulock.P \
.deps/utic.P
SOURCES = $(mbfido_SOURCES) $(mbseq_SOURCES) $(mbaff_SOURCES) $(mbindex_SOURCES) $(mbdiff_SOURCES) $(mbfile_SOURCES) $(mbmsg_SOURCES)
OBJECTS = $(mbfido_OBJECTS) $(mbseq_OBJECTS) $(mbaff_OBJECTS) $(mbindex_OBJECTS) $(mbdiff_OBJECTS) $(mbfile_OBJECTS) $(mbmsg_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbfido/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu mbfido/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -192,9 +198,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
@@ -215,10 +218,6 @@ mbfido: $(mbfido_OBJECTS) $(mbfido_DEPENDENCIES)
@rm -f mbfido
$(LINK) $(mbfido_LDFLAGS) $(mbfido_OBJECTS) $(mbfido_LDADD) $(LIBS)
mbmail: $(mbmail_OBJECTS) $(mbmail_DEPENDENCIES)
@rm -f mbmail
$(LINK) $(mbmail_LDFLAGS) $(mbmail_OBJECTS) $(mbmail_LDADD) $(LIBS)
mbseq: $(mbseq_OBJECTS) $(mbseq_DEPENDENCIES)
@rm -f mbseq
$(LINK) $(mbseq_LDFLAGS) $(mbseq_OBJECTS) $(mbseq_LDADD) $(LIBS)
@@ -337,6 +336,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = mbfido
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbfido/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
@@ -357,232 +361,38 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
addbbs.o: addbbs.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h tic.h fsort.h addbbs.h
addpkt.o: addpkt.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/dbmsgs.h \
pack.h addpkt.h
aliasdb.o: aliasdb.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h aliasdb.h
announce.o: announce.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \
../lib/msgtext.h grlist.h msgutil.h announce.h
areamgr.o: areamgr.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h \
../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h scan.h \
areamgr.h
atoul.o: atoul.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h atoul.h
backalias.o: backalias.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \
../lib/clcomm.h ../lib/dbcfg.h backalias.h
bread.o: bread.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h bread.h
bwrite.o: bwrite.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h bwrite.h
cookie.o: cookie.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h cookie.h
echoout.o: echoout.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \
../lib/clcomm.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h \
echoout.h
fflist.o: fflist.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/clcomm.h ../lib/msg.h fflist.h
filefind.o: filefind.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \
../lib/msgtext.h fflist.h filefind.h msgutil.h
filemgr.o: filemgr.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h \
../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h filemgr.h
flock.o: flock.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/clcomm.h flock.h
forward.o: forward.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbtic.h \
tic.h cookie.h sendmail.h rollover.h forward.h
fsort.o: fsort.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/clcomm.h fsort.h
grlist.o: grlist.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/clcomm.h grlist.h
hash.o: hash.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h hash.h lhash.h
hatch.o: hatch.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbtic.h utic.h \
rollover.h hatch.h
importmsg.o: importmsg.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h \
../lib/dbuser.h ../lib/dbftn.h echoout.h mkrfcmsg.h importmsg.h \
postnetmail.h rollover.h
importnet.o: importnet.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbmsgs.h ../lib/dbuser.h rollover.h importnet.h
lhash.o: lhash.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/clcomm.h lhash.h
magic.o: magic.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbtic.h tic.h utic.h \
magic.h
makestat.o: makestat.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h makestat.h
maketags.o: maketags.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h maketags.h
mbaff.o: mbaff.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \
announce.h filefind.h mbaff.h
mbdiff.o: mbdiff.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbdiff.h
mbfido.o: mbfido.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \
../lib/records.h ../lib/common.h ../lib/clcomm.h \
../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h \
../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h \
flock.h tosspkt.h pack.h ulock.h tic.h fsort.h scan.h mbfido.h \
tracker.h notify.h rollover.h hatch.h scannews.h maketags.h \
makestat.h newspost.h rnews.h backalias.h
mbfile.o: mbfile.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfile.h
mbindex.o: mbindex.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbftn.h \
mbindex.h
mbmail.o: mbmail.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbftn.h ../lib/dbcfg.h \
../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h hash.h \
mkftnhdr.h message.h
mbmsg.o: mbmsg.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/dbcfg.h \
post.h mbmsg.h
mbseq.o: mbseq.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h
message.o: message.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbuser.h \
bread.h bwrite.h hash.h mkftnhdr.h tracker.h viadate.h \
importnet.h
mgrutil.o: mgrutil.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbnode.h sendmail.h \
mgrutil.h
mkftnhdr.o: mkftnhdr.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h atoul.h hash.h \
aliasdb.h mkftnhdr.h
mkrfcmsg.o: mkrfcmsg.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/dbftn.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/common.h \
../lib/clcomm.h rollover.h aliasdb.h postemail.h backalias.h \
mkrfcmsg.h
mover.o: mover.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h tic.h mover.h
msgutil.o: msgutil.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \
../lib/msgtext.h msgutil.h
newspost.o: newspost.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/mbinet.h newspost.h
notify.o: notify.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbnode.h filemgr.h areamgr.h sendmail.h notify.h
pack.o: pack.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/dbftn.h ../lib/clcomm.h ../lib/dbnode.h \
pack.h
ping.o: ping.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \
../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h \
../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h \
postnetmail.h ping.h
post.o: post.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \
../lib/msgtext.h post.h
postemail.o: postemail.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/dbuser.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h \
postemail.h
postnetmail.o: postnetmail.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h \
../lib/common.h ../lib/clcomm.h tracker.h addpkt.h importnet.h \
mkrfcmsg.h areamgr.h filemgr.h ping.h postemail.h
ptic.o: ptic.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/dbtic.h ../lib/clcomm.h ../lib/dbnode.h \
../lib/dbdupe.h ulock.h mover.h toberep.h tic.h utic.h addbbs.h \
magic.h forward.h rollover.h ptic.h
rnews.o: rnews.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h \
../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h \
pack.h scannews.h mbfido.h rnews.h
rollover.o: rollover.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h rollover.h
scan.o: scan.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h \
../lib/dbnode.h ../lib/dbmsgs.h addpkt.h pack.h tracker.h \
mkrfcmsg.h postemail.h scan.h
scannews.o: scannews.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h \
../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h \
mkftnhdr.h hash.h echoout.h rollover.h pack.h scannews.h
sendmail.o: sendmail.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/dbmsgs.h \
addpkt.h rollover.h sendmail.h
tic.o: tic.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/dbftn.h ../lib/clcomm.h ulock.h ptic.h \
fsort.h pack.h tic.h
toberep.o: toberep.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h tic.h toberep.h
tosspkt.o: tosspkt.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbnode.h importmsg.h \
tosspkt.h
tracker.o: tracker.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h \
tracker.h
ulock.o: ulock.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h flock.h ulock.h
utic.o: utic.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
../lib/common.h ../lib/clcomm.h tic.h mover.h utic.h
viadate.o: viadate.c ../lib/libs.h ../lib/../config.h paths.h \
../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \
viadate.h
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
mostlyclean-depend:
clean-depend:
distclean-depend:
-rm -rf .deps
maintainer-clean-depend:
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-cp .deps/$(*F).pp .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
< .deps/$(*F).pp > .deps/$(*F).P; \
tr ' ' '\012' < .deps/$(*F).pp \
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
>> .deps/$(*F).P; \
rm -f .deps/$(*F).pp
info-am:
info: info-recursive
dvi-am:
@@ -620,23 +430,24 @@ distclean-generic:
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \
mostlyclean-am
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am
distclean-depend distclean-generic clean-am
distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-generic distclean-am
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -651,27 +462,29 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck \
install-exec-local install-exec-am install-exec install-data-am \
install-data install-am install uninstall-am uninstall all-redirect \
all-am all installdirs-am installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-local install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local:
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbmail $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbseq $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbindex $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfile $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(bindir)
rm -f $(bindir)/mbmail
ln -s $(bindir)/mbfido $(bindir)/mbmail
rm -f $(bindir)/mbnews
ln -s $(bindir)/mbfido $(bindir)/mbnews
(cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; chown mbse.bbs etc/maptabs/*)
(cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; $(CHOWN) @OWNER@.@GROUP@ etc/maptabs/*)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@@ -13,4 +13,9 @@
| |--> mkrfcmsg --> postemail
+---------------+
+---------------+
FTN | |--> Outbound
------->| postecho |--> MsgBase
| |--> mkrfcmsg --> spool --> newspost
+---------------+

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/addpkt.c
* Purpose ...............: Add mail to .pkt
* Last modification date : 02-Jun-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -198,8 +198,10 @@ int AddMsgHdr(FILE *fp, faddr *f, faddr *t, int flags, int cost, time_t date, ch
if ((tname == NULL) || (strlen(tname) > 36) ||
(fname == NULL) || (strlen(fname) > 36) ||
(subj == NULL) || (strlen(subj) > 72))
(subj == NULL) || (strlen(subj) > 72)) {
WriteError("AddMsgHdr() error in To name, From name or Subject field");
return 1;
}
buffer[0x00] = 2;
buffer[0x01] = 0;

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/areamgr.c
* Purpose ...............: AreaMgr
* Last modification date : 11-Mar-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -67,8 +67,6 @@ extern int echo_imp; /* Echomail imported */
extern int echo_out; /* Echomail forwarded */
extern int echo_bad; /* Bad echomail */
extern int echo_dupe; /* Dupe echomail */
extern char *subj; /* Message subject */
extern char *msgid; /* Original message id */
int areamgr = 0; /* Nr of AreaMgr messages */
int a_help = FALSE;
@@ -81,14 +79,14 @@ unsigned long a_msgs = 0;
void A_Help(faddr *);
void A_Help(faddr *t)
void A_Help(faddr *, char *);
void A_Help(faddr *t, char *replyid)
{
FILE *fp;
Syslog('+', "AreaMgr: Help");
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr help", msgid)) != NULL) {
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr help", replyid)) != NULL) {
fprintf(fp, "Address all requests to '%s' (without quotes)\r", (char *)"Areamgr");
fprintf(fp, "Youre AreaMgr password goes on the subject line.\r\r");
@@ -136,8 +134,8 @@ void A_Help(faddr *t)
void A_Query(faddr *);
void A_Query(faddr *t)
void A_Query(faddr *, char *);
void A_Query(faddr *t, char *replyid)
{
FILE *qp, *gp, *mp;
char *temp, *Group;
@@ -149,7 +147,7 @@ void A_Query(faddr *t)
Syslog('+', "AreaMgr: Query");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", replyid)) != NULL) {
temp = calloc(128, sizeof(char));
@@ -243,7 +241,7 @@ void A_Query(faddr *t)
void A_List(faddr *t, int Notify)
void A_List(faddr *t, char *replyid, int Notify)
{
FILE *qp, *gp, *mp;
char *temp, *Group;
@@ -258,7 +256,7 @@ void A_List(faddr *t, int Notify)
Syslog('+', "AreaMgr: List");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", replyid)) != NULL) {
WriteMailGroups(qp, f);
temp = calloc(128, sizeof(char));
@@ -350,7 +348,7 @@ void A_List(faddr *t, int Notify)
void A_Flow(faddr *t, int Notify)
void A_Flow(faddr *t, char *replyid, int Notify)
{
FILE *qp, *gp, *mp;
char *temp, *Group;
@@ -377,7 +375,7 @@ void A_Flow(faddr *t, int Notify)
Syslog('+', "AreaMgr: Flow report");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", replyid)) != NULL) {
temp = calloc(128, sizeof(char));
@@ -464,8 +462,8 @@ void A_Flow(faddr *t, int Notify)
void A_Status(faddr *);
void A_Status(faddr *t)
void A_Status(faddr *, char *);
void A_Status(faddr *t, char *replyid)
{
FILE *fp;
int i;
@@ -476,7 +474,7 @@ void A_Status(faddr *t)
else
i = Miy - 1;
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr status", msgid)) != NULL) {
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr status", replyid)) != NULL) {
fprintf(fp, "Here is your (echo)mail status:\r\r");
@@ -504,8 +502,8 @@ void A_Status(faddr *t)
void A_Unlinked(faddr *);
void A_Unlinked(faddr *t)
void A_Unlinked(faddr *, char *);
void A_Unlinked(faddr *t, char *replyid)
{
FILE *qp, *gp, *mp;
char *temp, *Group;
@@ -517,7 +515,7 @@ void A_Unlinked(faddr *t)
Syslog('+', "AreaMgr: Unlinked");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", replyid)) != NULL) {
WriteMailGroups(qp, f);
temp = calloc(128, sizeof(char));
@@ -944,7 +942,7 @@ void A_Msgs(char *Buf, int skip)
int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int flags, FILE *fp)
{
int i, rc = 0, spaces;
char *Buf;
@@ -1057,7 +1055,7 @@ int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
* create a response netmail about what we did.
*/
if (ftell(tmp)) {
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your AreaMgr request", msgid)) != NULL) {
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your AreaMgr request", replyid)) != NULL) {
fprintf(np, " Dear %s\r\r", nodes.Sysop);
fprintf(np, "Here is the result of your AreaMgr request:\r\r");
@@ -1081,22 +1079,22 @@ int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
fclose(tmp);
if (a_stat)
A_Status(f);
A_Status(f, replyid);
if (a_query)
A_Query(f);
A_Query(f, replyid);
if (a_list)
A_List(f, FALSE);
A_List(f, replyid, FALSE);
if (a_flow)
A_Flow(f, FALSE);
A_Flow(f, replyid, FALSE);
if (a_unlnk)
A_Unlinked(f);
A_Unlinked(f, replyid);
if (a_help)
A_Help(f);
A_Help(f, replyid);
return rc;
}

View File

@@ -2,10 +2,10 @@
#define _AREAMGR_H
void A_Status(faddr *);
void A_List(faddr *, int);
void A_Flow(faddr *, int);
int AreaMgr(faddr *, faddr *, time_t, int, FILE *);
void A_Status(faddr *, char *);
void A_List(faddr *, char *, int);
void A_Flow(faddr *, char *, int);
int AreaMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *);
#endif

View File

@@ -2,10 +2,10 @@
*
* File ..................: mbaff/filefind.c
* Purpose ...............: Announce new files and FileFind
* Last modification date : 25-Aug-2000
* Last modification date : 10-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2000
* Copyright (C) 1997-2001
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -192,7 +192,7 @@ int StartReply(ff_list *ffl)
* Start message text including kludges
*/
Msg_Id(scanmgr.Aka);
sprintf(temp, "\001REPLYID: %s", ffl->msgid);
sprintf(temp, "\001REPLY: %s", ffl->msgid);
MsgText_Add2(temp);
Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp));
Msg_Pid();
@@ -408,7 +408,8 @@ void ScanFiles(ff_list *tmp)
if (!strcmp(rft->filename, file.Name))
break;
fclose(pFile);
sprintf(temp, "%-12s %5lu Kb. %s", tu(file.Name), file.Size / 1024, To_Low(file.Desc[0],scanmgr.HiAscii));
sprintf(temp, "%-12s %5lu Kb. %s", tu(file.Name), (long)(file.Size / 1024),
To_Low(file.Desc[0],scanmgr.HiAscii));
MsgText_Add2(temp);
/*

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/filemgr.c
* Purpose ...............: FileMgr
* Last modification date : 11-Mar-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -66,8 +66,6 @@ extern int echo_imp; /* Echomail imported */
extern int echo_out; /* Echomail forwarded */
extern int echo_bad; /* Bad fileecho */
extern int echo_dupe; /* Dupe fileecho */
extern char *subj; /* Message subject */
extern char *msgid; /* Original message id */
int filemgr = 0; /* Nr of FileMgr messages */
int f_help = FALSE;
@@ -78,14 +76,14 @@ int f_unlnk = FALSE;
void F_Help(faddr *);
void F_Help(faddr *t)
void F_Help(faddr *, char *);
void F_Help(faddr *t, char *replyid)
{
FILE *fp;
Syslog('+', "FileMgr: Help");
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr help", msgid)) != NULL) {
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr help", replyid)) != NULL) {
fprintf(fp, "Address all requests to '%s' (without quotes)\r", (char *)"Filemgr");
fprintf(fp, "Youre FileMgr password goes on the subject line.\r\r");
@@ -134,8 +132,8 @@ void F_Help(faddr *t)
void F_Query(faddr *);
void F_Query(faddr *t)
void F_Query(faddr *, char *);
void F_Query(faddr *t, char *replyid)
{
FILE *qp, *gp, *fp;
char *temp, *Group;
@@ -147,7 +145,7 @@ void F_Query(faddr *t)
Syslog('+', "FileMgr: Query");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", replyid)) != NULL) {
temp = calloc(128, sizeof(char));
@@ -237,7 +235,7 @@ void F_Query(faddr *t)
void F_List(faddr *t, int Notify)
void F_List(faddr *t, char *replyid, int Notify)
{
FILE *qp, *gp, *fp;
char *temp, *Group;
@@ -252,7 +250,7 @@ void F_List(faddr *t, int Notify)
Syslog('+', "FileMgr: List");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", replyid)) != NULL) {
WriteFileGroups(qp, f);
temp = calloc(128, sizeof(char));
@@ -340,8 +338,8 @@ void F_List(faddr *t, int Notify)
void F_Status(faddr *);
void F_Status(faddr *t)
void F_Status(faddr *, char *);
void F_Status(faddr *t, char *replyid)
{
FILE *fp;
int i;
@@ -352,7 +350,7 @@ void F_Status(faddr *t)
else
i = Miy - 1;
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr Status", msgid)) != NULL) {
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr Status", replyid)) != NULL) {
fprintf(fp, "Here is your fileecho status:\r\r");
@@ -389,8 +387,8 @@ void F_Status(faddr *t)
void F_Unlinked(faddr *);
void F_Unlinked(faddr *t)
void F_Unlinked(faddr *, char *);
void F_Unlinked(faddr *t, char *replyid)
{
FILE *qp, *gp, *fp;
char *temp, *Group;
@@ -402,7 +400,7 @@ void F_Unlinked(faddr *t)
Syslog('+', "FileMgr: Unlinked");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", msgid)) != NULL) {
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", replyid)) != NULL) {
temp = calloc(128, sizeof(char));
@@ -823,7 +821,7 @@ void F_Tick(faddr *t, char *Buf, FILE *tmp)
int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int flags, FILE *fp)
{
int i, rc = 0, spaces;
char *Buf;
@@ -930,7 +928,7 @@ int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
}
if (ftell(tmp)) {
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your FileMgr request", msgid)) != NULL) {
if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your FileMgr request", replyid)) != NULL) {
fprintf(np, " Dear %s\r\r", nodes.Sysop);
fprintf(np, "Here is the result of your FileMgr request:\r\r");
@@ -954,19 +952,19 @@ int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
fclose(tmp);
if (f_stat)
F_Status(f);
F_Status(f, replyid);
if (f_query)
F_Query(f);
F_Query(f, replyid);
if (f_list)
F_List(f, FALSE);
F_List(f, replyid, FALSE);
if (f_unlnk)
F_Unlinked(f);
F_Unlinked(f, replyid);
if (f_help)
F_Help(f);
F_Help(f, replyid);
return rc;
}

View File

@@ -2,9 +2,9 @@
#define _FILEMGR_H
void F_Status(faddr *);
void F_List(faddr *, int);
int FileMgr(faddr *, faddr *, time_t, int, FILE *);
void F_Status(faddr *, char *);
void F_List(faddr *, char *, int);
int FileMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *);
#endif

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/forward.c
* Purpose ...............: File forward to a node
* Last modification date : 11-Mar-2001
* Last modification date : 10-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -133,7 +133,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
fprintf(net, "File : %s\r", TIC.TicIn.OrgName);
fprintf(net, "Description : %s\r", TIC.TicIn.Desc);
fprintf(net, "Area : %s %s\r", TIC.TicIn.Area, TIC.TicIn.AreaDesc);
fprintf(net, "Size : %ld\r", TIC.FileSize);
fprintf(net, "Size : %ld\r", (long)(TIC.FileSize));
fprintf(net, "CRC : %s\r", TIC.TicIn.Crc);
fprintf(net, "Origin : %s\r", TIC.TicIn.Origin);
if (strlen(TIC.TicIn.Magic))

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/mbfido.c
* Purpose ...............: Process Fidonet style mail and files.
* Last modification date : 10-Jul-2001
* Last modification date : 14-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -61,6 +61,7 @@
#include "newspost.h"
#include "rnews.h"
#include "backalias.h"
#include "rfc2ftn.h"
#define UNPACK_FACTOR 300
@@ -77,6 +78,7 @@ int do_stat = FALSE; /* Create statistic HTML pages */
int do_test = FALSE; /* Test routing */
int do_news = FALSE; /* Process NNTP news */
int do_uucp = FALSE; /* Process UUCP newsbatch */
int do_mail = FALSE; /* Process MTA email message */
int do_unsec = FALSE; /* Unsecure tossing */
int do_learn = FALSE; /* News articles learnmode */
int check_crc = TRUE; /* Check .tic crc values */
@@ -115,6 +117,7 @@ void Help(void)
colour(9, 0);
printf(" Commands are:\n\n");
colour(3, 0);
printf(" m mail <recipient> ... MTA Mail mode\n");
printf(" ne news Scan for new news\n");
printf(" no notify <nodes> Send notify messages\n");
printf(" r roll Rollover statistic counters\n");
@@ -246,9 +249,13 @@ void die(int onsig)
int main(int argc, char **argv)
{
int i, Loop;
char *p, *cmd, Options[81];
char *p, *cmd, *temp, Options[81];
struct passwd *pw;
struct tm *t;
fa_list **envrecip, *envrecip_start = NULL;
faddr *taddr;
int envrecip_count = 0;
FILE *ofp;
#ifdef MEMWATCH
mwInit();
@@ -256,9 +263,11 @@ int main(int argc, char **argv)
/*
* The next trick is to supply a fake environment variable
* MBSE_ROOT in case we are started from UUCP.
* MBSE_ROOT in case we are started from UUCP or the MTA.
* this will setup the variable so InitConfig() will work.
* The /etc/passwd must point to the correct homedirectory.
* Some programs can't set uid to mbse, so mbfido is installed
* setuid mbse.
*/
if (getenv("MBSE_ROOT") == NULL) {
pw = getpwuid(getuid());
@@ -310,7 +319,11 @@ int main(int argc, char **argv)
p++;
else
p = argv[0];
if (!strcmp(p, "mbnews")) {
if (!strcmp(p, "mbmail")) {
do_quiet = TRUE;
do_mail = TRUE;
cmd = xstrcpy((char *)"Cmd: mbmail");
} else if (!strcmp(p, "mbnews")) {
do_quiet = TRUE;
do_uucp = TRUE;
cmd = xstrcpy((char *)"Cmd: mbnews");
@@ -320,9 +333,10 @@ int main(int argc, char **argv)
cmd = xstrcpy((char *)"Cmd: mbfido");
}
envrecip = &envrecip_start;
for (i = 1; i < argc; i++) {
cmd = xstrcat(cmd, (char *)" ");
cmd = xstrcat(cmd, tl(argv[i]));
cmd = xstrcat(cmd, argv[i]);
if (strncmp(tl(argv[i]), "ne", 2) == 0)
do_news = TRUE;
@@ -338,36 +352,52 @@ int main(int argc, char **argv)
}
if (strncmp(tl(argv[i]), "r", 1) == 0)
do_roll = TRUE;
if (strncmp(tl(argv[i]), "s", 1) == 0)
else if (strncmp(tl(argv[i]), "s", 1) == 0)
do_scan = TRUE;
if (strncmp(tl(argv[i]), "ta", 2) == 0)
else if (strncmp(tl(argv[i]), "ta", 2) == 0)
do_tags = TRUE;
if (strncmp(tl(argv[i]), "ti", 2) == 0)
else if (strncmp(tl(argv[i]), "ti", 2) == 0)
do_tic = TRUE;
if (strncmp(tl(argv[i]), "te", 2) == 0)
else if (strncmp(tl(argv[i]), "te", 2) == 0)
do_test = TRUE;
if (strncmp(tl(argv[i]), "to", 2) == 0)
else if (strncmp(tl(argv[i]), "to", 2) == 0)
do_toss = TRUE;
if (strncmp(tl(argv[i]), "u", 1) == 0)
else if (strncmp(tl(argv[i]), "u", 1) == 0)
do_uucp = TRUE;
if (strncmp(tl(argv[i]), "w", 1) == 0)
else if (strncmp(tl(argv[i]), "m", 1) == 0)
do_mail = TRUE;
else if (strncmp(tl(argv[i]), "w", 1) == 0)
do_stat = TRUE;
if (strncmp(tl(argv[i]), "-a", 2) == 0)
else if (strncmp(tl(argv[i]), "-a", 2) == 0)
autocrea = TRUE;
if (strncmp(tl(argv[i]), "-f", 2) == 0)
else if (strncmp(tl(argv[i]), "-f", 2) == 0)
do_full = TRUE;
if (strncmp(tl(argv[i]), "-l", 2) == 0)
else if (strncmp(tl(argv[i]), "-l", 2) == 0)
do_learn = TRUE;
if (strncmp(tl(argv[i]), "-noc", 4) == 0)
else if (strncmp(tl(argv[i]), "-noc", 4) == 0)
check_crc = FALSE;
if (strncmp(tl(argv[i]), "-nod", 4) == 0)
else if (strncmp(tl(argv[i]), "-nod", 4) == 0)
check_dupe = FALSE;
if (strncmp(tl(argv[i]), "-q", 2) == 0)
else if (strncmp(tl(argv[i]), "-q", 2) == 0)
do_quiet = TRUE;
if (strncmp(tl(argv[i]), "-unp", 4) == 0)
else if (strncmp(tl(argv[i]), "-unp", 4) == 0)
do_unprot = TRUE;
if (strncmp(tl(argv[i]), "-uns", 4) == 0)
else if (strncmp(tl(argv[i]), "-uns", 4) == 0)
do_unsec = TRUE;
else if (do_mail) {
/*
* Possible recipient address(es).
*/
if ((taddr = parsefaddr(argv[i]))) {
(*envrecip) = (fa_list*)malloc(sizeof(fa_list));
(*envrecip)->next = NULL;
(*envrecip)->addr = taddr;
envrecip = &((*envrecip)->next);
envrecip_count++;
} else {
cmd = strcat(cmd, (char *)" <- unparsable recipient! ");
}
}
}
ProgName();
@@ -384,10 +414,11 @@ int main(int argc, char **argv)
die(101);
if (lockunpack())
die(0);
die(101);
if (initnl())
die(101);
Rollover();
if (!do_mail && !do_uucp)
Rollover();
if (!do_quiet)
printf("\n");
@@ -396,10 +427,36 @@ int main(int argc, char **argv)
*/
cmd = calloc(PATH_MAX, sizeof(char));
sprintf(cmd, "%s/etc/aliases", getenv("MBSE_ROOT"));
if ((do_news || do_scan || do_toss) && file_exist(cmd, R_OK) == 0)
if ((do_news || do_scan || do_toss || do_mail) && file_exist(cmd, R_OK) == 0)
readalias(cmd);
free(cmd);
if (do_mail) {
if (!envrecip_count) {
WriteError("No valid receipients specified, aborting");
die(105);
}
umask(066);
if ((ofp = tmpfile()) == NULL) {
WriteError("$Can't open tmpfile for RFC message");
die(104);
}
temp = calloc(10240, sizeof(char));
while (fgets(temp, 10240, stdin))
fprintf(ofp, temp);
free(temp);
for (envrecip = &envrecip_start; *envrecip; envrecip = &((*envrecip)->next)) {
Syslog('+', "Message to: %s", ascfnode((*envrecip)->addr, 0x7f));
rfc2ftn(ofp, (*envrecip)->addr);
}
fclose(ofp);
packmail();
die(0);
}
if (do_notify)
if (Notify(Options))
packmail();
@@ -410,8 +467,6 @@ int main(int argc, char **argv)
* Hatch new files and process .tic files
* until nothing left to do.
*/
if (!diskfree(CFG.freespace))
die(101);
Loop = TRUE;
do {
Hatch();
@@ -446,7 +501,7 @@ int main(int argc, char **argv)
if (do_stat)
MakeStat();
if (do_uucp)
NewsUUCP(FALSE);
NewsUUCP();
die(0);
return 0;
}
@@ -625,8 +680,7 @@ int TossPkts(void)
}
free(inbound);
if (diskfree(CFG.freespace))
packmail();
packmail();
return maxrc;
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbindex.c
* Purpose ...............: Nodelist Compiler
* Last modification date : 25-May-2001
* Last modification date : 08-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -628,20 +628,22 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
*q++ = '\0';
}
if ((strlen(p) == 3) && (!strcmp(p, "300"))) {
if ((strstr(q, (char *)"X75")) ||
(strstr(q, (char *)"V110L")) ||
(strstr(q, (char *)"V110H")) ||
(strstr(q, (char *)"V120L")) ||
(strstr(q, (char *)"V120H")) ||
(strstr(q, (char *)"ISDN")))
ndx.pflag |= NL_ISDN;
if ((strstr(q, (char *)"IFC")) ||
(strstr(q, (char *)"IBN")) ||
(strstr(q, (char *)"ITN")) ||
(strstr(q, (char *)"IVM")) ||
(strstr(q, (char *)"IFT")) ||
(strstr(q, (char *)"IP")))
ndx.pflag |= NL_TCPIP;
if (q != NULL) {
if ((strstr(q, (char *)"X75")) ||
(strstr(q, (char *)"V110L")) ||
(strstr(q, (char *)"V110H")) ||
(strstr(q, (char *)"V120L")) ||
(strstr(q, (char *)"V120H")) ||
(strstr(q, (char *)"ISDN")))
ndx.pflag |= NL_ISDN;
if ((strstr(q, (char *)"IFC")) ||
(strstr(q, (char *)"IBN")) ||
(strstr(q, (char *)"ITN")) ||
(strstr(q, (char *)"IVM")) ||
(strstr(q, (char *)"IFT")) ||
(strstr(q, (char *)"IP")))
ndx.pflag |= NL_TCPIP;
}
}
Syslog('S',"put: %u:%u/%u.%u reg %u upl %u/%u typ %u flg %02X as (%u,%lu)",

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbmail/message.c
* Purpose ...............: MBSE BBS Mail Gate
* Last modification date : 02-May-2001
* Last modification date : 27-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -54,7 +54,7 @@
#include "mkftnhdr.h"
#include "tracker.h"
#include "viadate.h"
#include "importnet.h"
#include "storenet.h"
#define MAXHDRSIZE 2048
@@ -458,7 +458,7 @@ int putmessage(rfcmsg *msg, ftnmsg *fmsg, FILE *fp, faddr *route, char flavor,fa
if (TrackMail(Dest, &Route) == R_LOCAL) {
/*
* Mail for our local system. Instead of adding the message to a .pkt create
* a temporary file which later will be send via the importnet function.
* a temporary file which later will be send via the storenet function.
*/
postlocal = TRUE;
pkt = tmpfile();
@@ -856,9 +856,9 @@ int putmessage(rfcmsg *msg, ftnmsg *fmsg, FILE *fp, faddr *route, char flavor,fa
fmsg->to->name = xstrcpy(CFG.sysop_name);
}
if (SearchUser(fmsg->to->name)) {
Syslog('m', "importnet(%s, %s, %s, %04x)", ascfnode(fmsg->from,0x7f),
Syslog('m', "storenet(%s, %s, %s, %04x)", ascfnode(fmsg->from,0x7f),
ascfnode(fmsg->to,0x7f), ftndate(fmsg->date), fmsg->flags);
if (importnet(fmsg->from, fmsg->to, fmsg->date, fmsg->flags, pkt))
if (storenet(fmsg->from, fmsg->to, fmsg->date, fmsg->flags, fmsg->subj, fmsg->msgid_a, fmsg->reply_a, pkt))
return 2;
} else {
WriteError("Unknown bbs user");

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbmail/mkftnhdr.c
* Purpose ...............: MBSE BBS Mail Gate
* Last modification date : 25-Mar-2001
* Last modification date : 14-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -206,7 +206,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname)
ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode)
ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *recipient)
{
char *freename = NULL, *rfcfrom = NULL, *p, *q, *l, *r;
char *fbuf = NULL;
@@ -228,8 +228,10 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode)
p = xstrcpy(hdr((char *)"X-Fidonet-Comment-To",msg));
if (p == NULL)
p = xstrcpy(hdr((char *)"X-Apparently-To",msg));
if (p == NULL)
p = xstrcpy(hdr((char *)"To", msg)); /* 14-Aug-2001 MB */
if (p) {
Syslog('N', "getting `to' address from: \"%s\"",p);
Syslog('n', "getting `to' address from: \"%s\"",p);
if ((tmsg->to = parsefaddr(p)) == NULL)
tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0");
if ((l = strrchr(p,'<')) && (r = strchr(p,'>')) && (l < r)) {
@@ -271,10 +273,55 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode)
tmsg->to->name=xstrcpy(l);
}
free(p);
} else
tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0");
Syslog('n', "TO: %s",ascinode(tmsg->to,0x7f));
}
/*
* It will become echomail, the destination FTN address must
* be our address. 14-Aug-2001 MB.
*/
tmsg->to->zone = msgs.Aka.zone;
tmsg->to->net = msgs.Aka.net;
tmsg->to->node = msgs.Aka.node;
tmsg->to->point = msgs.Aka.point;
tmsg->to->domain = xstrcpy(msgs.Aka.domain);
} else {
Syslog('n', "Filling default To: address");
tmsg->to = (faddr*)malloc(sizeof(faddr));
tmsg->to->name = xstrcpy((char *)"All");
tmsg->to->zone = msgs.Aka.zone;
tmsg->to->net = msgs.Aka.net;
tmsg->to->node = msgs.Aka.node;
tmsg->to->point = msgs.Aka.point;
tmsg->to->domain = xstrcpy(msgs.Aka.domain);
}
Syslog('n', "TO: %s",ascfnode(tmsg->to,0xff));
} else {
if (recipient) {
/*
* In mbmail mode the recipient is valid and must be used
* as the destination address. The To: field is probably
* an RFC address an cannot be used to route the message.
*/
tmsg->to = (faddr *)malloc(sizeof(faddr));
tmsg->to->point = recipient->point;
tmsg->to->node = recipient->node;
tmsg->to->net = recipient->net;
tmsg->to->zone = recipient->zone;
tmsg->to->name = xstrcpy(recipient->name);
if (tmsg->to->name && (strlen(tmsg->to->name) > MAXNAME))
tmsg->to->name[MAXNAME]='\0';
tmsg->to->domain = xstrcpy(recipient->domain);
Syslog('m', "Recipient TO: %s", ascfnode(tmsg->to,0xff));
} else {
p = xstrcpy(hdr((char *)"To",msg));
if (p == NULL)
p = xstrcpy(hdr((char *)"X-Apparently-To",msg));
if (p) {
if ((tmsg->to = parsefaddr(p)) == NULL)
WriteError("Unparsable destination address");
else
Syslog('m', "RFC parsed TO: %s",ascfnode(tmsg->to,0xff));
}
}
} /* else (newsmode) */
p = fbuf = xstrcpy(hdr((char *)"Reply-To", msg));
if (fbuf == NULL)
@@ -376,9 +423,12 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode)
Syslog('m', "From address was%s distinguished as ftn", tmsg->from ? "" : " not");
/* FIXME: received email from an Unix mailer comes here as well, only the From address is set.
The msgs.Aka next is not valid. */
if ((tmsg->from == NULL) && ((bestaka = bestaka_s(fido2faddr(msgs.Aka))))) {
if (newsmode)
bestaka = bestaka_s(fido2faddr(msgs.Aka));
else
bestaka = bestaka_s(tmsg->to);
if ((tmsg->from == NULL) && (bestaka)) {
if (CFG.dontregate) {
p = xstrcpy(hdr((char *)"X-FTN-Sender",msg));
if (p == NULL) {
@@ -522,7 +572,10 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode)
Syslog('m', "DATE: %s, MSGID: %s %lx, REPLY: %s %lx",
ftndate(tmsg->date), MBSE_SS(tmsg->msgid_a),tmsg->msgid_n, MBSE_SS(tmsg->reply_a),tmsg->reply_n);
if ((p = hdr((char *)"Organization",msg))) {
p = hdr((char *)"Organization",msg);
if (p == NULL)
p = hdr((char *)"Organisation",msg);
if (p) {
while (isspace(*p))
p++;
tmsg->origin = xstrcpy(hdrconv(p, incode, outcode));

View File

@@ -3,7 +3,7 @@
int ftnmsgid(char *,char **,unsigned long *,char *);
ftnmsg *mkftnhdr(rfcmsg *, int, int, int);
ftnmsg *mkftnhdr(rfcmsg *, int, int, int, faddr *);
#endif

View File

@@ -140,12 +140,12 @@ int Notify(char *Options)
}
if (i == 0) {
F_Status(fido2faddr(nodes.Aka[i]));
A_Status(fido2faddr(nodes.Aka[i]));
F_Status(fido2faddr(nodes.Aka[i]), NULL);
A_Status(fido2faddr(nodes.Aka[i]), NULL);
}
F_List(fido2faddr(nodes.Aka[i]), TRUE);
A_List(fido2faddr(nodes.Aka[i]), TRUE);
A_Flow(fido2faddr(nodes.Aka[i]), TRUE);
F_List(fido2faddr(nodes.Aka[i]), NULL, TRUE);
A_List(fido2faddr(nodes.Aka[i]), NULL, TRUE);
A_Flow(fido2faddr(nodes.Aka[i]), NULL, TRUE);
notify++;
}
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: tosser/pack.c
* Purpose ...............: Pack mail
* Last modification date : 11-Mar-2001
* Last modification date : 05-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -370,6 +370,9 @@ void packmail()
struct dirent *de;
DIR *dp;
if (!diskfree(CFG.freespace))
return;
IsDoing("Packing mail");
if (!do_quiet) {
colour(9, 0);

View File

@@ -62,7 +62,6 @@ extern int do_quiet;
extern int net_in; /* Netmails received */
extern int net_out; /* Netmails forwarded */
extern int net_bad; /* Bad netmails (tracking errors */
extern char *subj; /* Message subject */
extern char *msgid; /* Original message id */

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/postnetmail.c
* Purpose ...............: Post Netmail message from temp file
* Last modification date : 21-Jun-2001
* Last modification date : 03-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -40,8 +40,8 @@
#include "../lib/clcomm.h"
#include "tracker.h"
#include "addpkt.h"
#include "importnet.h"
#include "mkrfcmsg.h"
#include "storenet.h"
#include "ftn2rfc.h"
#include "areamgr.h"
#include "filemgr.h"
#include "ping.h"
@@ -64,15 +64,16 @@ extern int most_debug; /* Headvy debugging flag */
* Post netmail message for temp file. The tempfile is an FTN style message.
*
* 0 - All seems well.
* 1 - Something went wrong.
* 1 - Can't access messagebase.
* 2 - Can't find netmail board.
*
*/
int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t mdate, int flags, int DoPing)
{
char *p, *reply = NULL;
char name[36], *buf;
char *p, *msgid = NULL, *reply = NULL;
char name[36], *buf, *l, *r, *q;
char System[36], ext[4];
int result = 1, email = FALSE;
int result = 1, email = FALSE, fmpt = 0, topt = 0;
faddr *ta, *ra;
fidoaddr na, route, Orig;
FILE *sfp, *net;
@@ -84,6 +85,124 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
Syslog('m', "Post netmail subj: %s", MBSE_SS(subject));
net_in++;
/*
* Extract MSGID and REPLY kludges from this netmail.
*/
buf = calloc(2048, sizeof(char));
rewind(fp);
while ((fgets(buf, 2048, fp)) != NULL) {
Striplf(buf);
Syslogp('m', printable(buf, 0));
if (!strncmp(buf, "\001MSGID: ", 8)) {
msgid = xstrcpy(buf + 8);
/*
* Extra test to see if the mail comes from a pointaddress.
*/
l = strtok(buf," \n");
l = strtok(NULL," \n");
if ((ta = parsefnode(l))) {
if (ta->zone == f->zone && ta->net == f->net && ta->node == f->node && !fmpt && ta->point) {
Syslog('m', "Setting pointinfo (%d) from MSGID", ta->point);
fmpt = f->point = ta->point;
}
tidy_faddr(ta);
}
}
if (!strncmp(buf, "\001FMPT", 5)) {
p = strtok(buf, " \n");
p = strtok(NULL, " \n");
fmpt = atoi(p);
}
if (!strncmp(buf, "\001TOPT", 5)) {
p = strtok(buf, " \n");
p = strtok(NULL, " \n");
topt = atoi(p);
}
if (!strncmp(buf, "\001REPLY: ", 8))
reply = xstrcpy(buf + 8);
/*
* Check DOMAIN and INTL kludges
*/
if (!strncmp(buf, "\001DOMAIN", 7)) {
l = strtok(buf," \n");
l = strtok(NULL," \n");
p = strtok(NULL," \n");
r = strtok(NULL," \n");
q = strtok(NULL," \n");
if ((ta = parsefnode(p))) {
t->point = ta->point;
t->node = ta->node;
t->net = ta->net;
t->zone = ta->zone;
tidy_faddr(ta);
}
t->domain = xstrcpy(l);
if ((ta = parsefnode(q))) {
f->point = ta->point;
f->node = ta->node;
f->net = ta->net;
f->zone = ta->zone;
tidy_faddr(ta);
}
f->domain = xstrcpy(r);
} else {
if (!strncmp(buf, "\001INTL", 5)) {
l = strtok(buf," \n");
l = strtok(NULL," \n");
r = strtok(NULL," \n");
if ((ta = parsefnode(l))) {
t->point = ta->point;
t->node = ta->node;
t->net = ta->net;
t->zone = ta->zone;
if (ta->domain) {
if (t->domain)
free(t->domain);
t->domain = ta->domain;
ta->domain = NULL;
}
tidy_faddr(ta);
}
if ((ta = parsefnode(r))) {
f->point = ta->point;
f->node = ta->node;
f->net = ta->net;
f->zone = ta->zone;
if (ta->domain) {
if (f->domain)
free(f->domain);
f->domain = ta->domain;
ta->domain = NULL;
}
tidy_faddr(ta);
}
}
}
/*
* Check for X-FTN- kludges, this could be gated email.
* This should be impossible.
*/
if (!strncmp(buf, "\001X-FTN-", 7)) {
email = TRUE;
Syslog('?', "Warning: detected ^aX-FTN- kludge in netmail");
}
}
free(buf);
/*
* Only set point info if there was any info.
* GoldED doesn't set FMPT and TOPT kludges.
*/
if (fmpt)
f->point = fmpt;
if (topt)
t->point = topt;
Syslog('m', "Final netmail from: %s", ascfnode(f, 0xff));
Syslog('m', "Final netmail to : %s", ascfnode(t, 0xff));
memset(&na, 0, sizeof(na));
na.zone = t->zone;
na.net = t->net;
@@ -108,12 +227,10 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
if (email) {
/*
* Send this netmail via mkrfcmsg -> postemail.
* Send this netmail via ftn2rfc -> postemail.
*/
if (reply)
free(reply);
most_debug = TRUE;
result = mkrfcmsg(f, t, subject, orig, mdate, flags, fp, 0L, FALSE);
result = ftn2rfc(f, t, subject, orig, mdate, flags, fp);
most_debug = FALSE;
return result;
}
@@ -142,18 +259,16 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
while (fread(&servrec, servhdr.recsize, 1, sfp) == 1) {
if ((strncasecmp(servrec.Service, name, strlen(servrec.Service)) == 0) && servrec.Active) {
switch (servrec.Action) {
case AREAMGR: result = AreaMgr(f, t, mdate, flags, fp);
case AREAMGR: result = AreaMgr(f, t, msgid, subject, mdate, flags, fp);
break;
case FILEMGR: result = FileMgr(f, t, mdate, flags, fp);
case FILEMGR: result = FileMgr(f, t, msgid, subject, mdate, flags, fp);
break;
case EMAIL: most_debug = TRUE;
result = mkrfcmsg(f, t, subject, orig, mdate, flags, fp, 0L, FALSE);
result = ftn2rfc(f, t, subject, orig, mdate, flags, fp);
most_debug = FALSE;
break;
}
Syslog('m', "Handled service %s, rc=%d", servrec.Service, result);
if (reply)
free(reply);
fclose(sfp);
return result;
}
@@ -174,9 +289,7 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
* Import if one fits.
*/
if (SearchUser(name)) {
if (reply)
free(reply);
return importnet(f, t, mdate, flags, fp);
return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
}
Syslog('+', " \"%s\" is not a known BBS user", name);
@@ -187,9 +300,9 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
Syslog('+', " Readdress from %s to %s", name, CFG.sysop_name);
sprintf(name, "%s", CFG.sysop_name);
if (SearchUser(name)) {
return importnet(f, t, mdate, flags, fp);
return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
} else {
WriteError("Readdress import failed");
WriteError("Readdress import failed, sysop doesn't exist. CHECK YOUR SETUP");
return 0;
}
break;
@@ -291,8 +404,6 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
fclose(net);
free(buf);
net_out++;
if (reply)
free(reply);
Syslog('m', "Forward done.");
return 0;
@@ -303,9 +414,7 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
*/
WriteError("No ROUTE for this netmail");
net_bad++;
if (reply)
free(reply);
return importnet(f, t, mdate, flags, fp);
return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
break;
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/ptic.c
* Purpose ...............: Process 1 .tic file
* Last modification date : 08-Jul-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -730,7 +730,7 @@ int ProcessTic(fa_list *sbl, char *Realname)
if (CFG.akavalid[i] && (tic.Aka.zone == CFG.aka[i].zone) &&
!((tic.Aka.net == CFG.aka[i].net) && (tic.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u:%u/%u", CFG.aka[i].zone, CFG.aka[i].net, CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE);
fill_list(&sbl, sbe, NULL);
}
}
@@ -743,7 +743,7 @@ int ProcessTic(fa_list *sbl, char *Realname)
if (!((TIC.Aka.zone == Link.aka.zone) && (TIC.Aka.net == Link.aka.net) &&
(TIC.Aka.node == Link.aka.node) && (TIC.Aka.point == Link.aka.point))) {
sprintf(sbe, "%u:%u/%u", Link.aka.zone, Link.aka.net, Link.aka.node);
fill_list(&sbl, sbe, NULL, FALSE);
fill_list(&sbl, sbe, NULL);
}
}
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/rnews.c
* Purpose ...............: rnews function
* Last modification date : 19-Jul-2001
* Last modification date : 14-Aug-2001
* Remarks ...............: Most of these functions are borrowed from inn.
*
*****************************************************************************
@@ -42,7 +42,7 @@
#include "../lib/msg.h"
#include "../lib/msgtext.h"
#include "pack.h"
#include "scannews.h"
#include "rfc2ftn.h"
#include "mbfido.h"
#include "paths.h"
#include "rnews.h"
@@ -88,6 +88,8 @@ static HEADER RequiredHeaders[] = {
#define ISWHITE(c) ((c) == ' ' || (c) == '\t')
#define caseEQn(a, b, n) (strncasecmp((a), (b), (size_t)(n)) == 0)
/*
* External variables
*/
@@ -95,6 +97,7 @@ extern int do_quiet;
extern int most_debug;
extern int news_in;
extern int news_dupe;
extern int check_dupe;
void ProcessOne(FILE *);
@@ -109,9 +112,11 @@ const char *HeaderFindMem(const char *Article, const int ArtLen, const char *Hea
const char *p;
for (p = Article; ; ) {
/* Match first character, then colon, then whitespace (don't
/*
* Match first character, then colon, then whitespace (don't
* delete that line -- meet the RFC!) then compare the rest
* of the word. */
* of the word.
*/
if (HeaderLen + 1 < Article + ArtLen - p && p[HeaderLen] == ':'
&& ISWHITE(p[HeaderLen + 1]) && caseEQn(p, Header, (size_t)HeaderLen)) {
p += HeaderLen + 2;
@@ -274,7 +279,6 @@ static int Process(char *article)
char *id = NULL;
FILE *fp;
Syslog('n', "Process article");
/*
* Empty article?
*/
@@ -538,7 +542,7 @@ static int UnpackOne(int *fdp, int *countp)
void NewsUUCP(int unspool)
void NewsUUCP(void)
{
int fd = STDIN, i, rc;
@@ -550,19 +554,11 @@ void NewsUUCP(int unspool)
printf("Process UUCP Newsbatch\n");
}
if (unspool) {
// Unspool();
} else {
// if (!UnpackOne(&fd, &i))
// Spool(fd);
most_debug = TRUE;
rc = UnpackOne(&fd, &i);
most_debug = FALSE;
Syslog('+', "Batch result=%d", rc);
WaitForChildren(i);
}
Syslog('+', "End of UUCP batch");
most_debug = TRUE;
rc = UnpackOne(&fd, &i);
most_debug = FALSE;
WaitForChildren(i);
Syslog('+', "End of UUCP batch, rc=%d", rc);
packmail();
if (!do_quiet)
@@ -601,7 +597,7 @@ void ProcessOne(FILE *fp)
groups[nrofgroups] = xstrcpy(group);
nrofgroups++;
} else {
Syslog('n', "Newsgroup %s doesn't exist", group);
Syslog('-', "Newsgroup %s doesn't exist", group);
}
}
}
@@ -620,19 +616,19 @@ void ProcessOne(FILE *fp)
} else if (mbuf == NULL) {
WriteError("No valid Message-ID found");
} else {
news_in++;
IsDoing("Article %d", (news_in + 1));
for (i = 0; i < nrofgroups; i++) {
Syslog('n', "Process %s", groups[i]);
p = xstrcpy(mbuf);
p = xstrcat(p, groups[i]);
crc = str_crc32(p);
if (CheckDupe(crc, D_NEWS, CFG.nntpdupes)) {
if (check_dupe && CheckDupe(crc, D_NEWS, CFG.nntpdupes)) {
news_dupe++;
news_in++;
Syslog('+', "Duplicate article \"%s\" in group %s", mbuf, groups[i]);
} else {
if (SearchMsgsNews(groups[i])) {
do_article(fp);
rfc2ftn(fp, NULL);
}
}
free(groups[i]);

View File

@@ -13,7 +13,7 @@
#define SMBUF 256
void NewsUUCP(int);
void NewsUUCP(void);
#endif

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/scan.h
* Purpose ...............: Scan for outgoing mail.
* Last modification date : 01-Jul-2001
* Last modification date : 13-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -41,7 +41,7 @@
#include "addpkt.h"
#include "pack.h"
#include "tracker.h"
#include "mkrfcmsg.h"
#include "ftn2rfc.h"
#include "postemail.h"
#include "scan.h"
@@ -52,8 +52,6 @@ extern int net_bad;
extern int echo_in;
extern int email_out;
extern int echo_out;
extern int email_imp;
extern int email_bad;
extern int most_debug;
int scanned;
@@ -252,7 +250,7 @@ void ScanFull()
*/
if ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) {
echo_in++;
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE);
fill_list(&sbl, aka2str(msgs.Aka), NULL);
for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] &&
(msgs.Aka.zone == CFG.aka[i].zone) &&
@@ -260,14 +258,14 @@ void ScanFull()
(msgs.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u/%u", CFG.aka[i].net,
CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE);
fill_list(&sbl, sbe, NULL);
}
}
fseek(pAreas, sysstart, SEEK_SET);
for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) {
fread(&Link, sizeof(sysconnect), 1, pAreas);
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) {
fill_list(&sbl, aka2str(Link.aka), NULL, FALSE);
fill_list(&sbl, aka2str(Link.aka), NULL);
}
}
uniq_list(&sbl);
@@ -404,7 +402,7 @@ void ScanOne(char *path, unsigned long MsgNum)
*/
if (msgs.Type == ECHOMAIL || msgs.Type == NEWS) {
echo_in++;
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE);
fill_list(&sbl, aka2str(msgs.Aka), NULL);
for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] &&
(msgs.Aka.zone == CFG.aka[i].zone) &&
@@ -412,14 +410,14 @@ void ScanOne(char *path, unsigned long MsgNum)
(msgs.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u/%u", CFG.aka[i].net,
CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE);
fill_list(&sbl, sbe, NULL);
}
}
fseek(pAreas, sysstart, SEEK_SET);
for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) {
fread(&Link, sizeof(sysconnect), 1, pAreas);
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) {
fill_list(&sbl, aka2str(Link.aka), NULL, FALSE);
fill_list(&sbl, aka2str(Link.aka), NULL);
}
}
uniq_list(&sbl);
@@ -530,8 +528,8 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
while (MsgNum<=Total){
if (Msg_ReadHeader(MsgNum)) {
if (Msg_Lock(15L)) {
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE);
fill_list(&sbl, aka2str(Link.aka), NULL, FALSE);
fill_list(&sbl, aka2str(msgs.Aka), NULL);
fill_list(&sbl, aka2str(Link.aka), NULL);
sort_list(&sbl);
ExportEcho(Link, MsgNum, &sbl);
tidy_falist(&sbl);
@@ -753,7 +751,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl)
rewind(qp);
most_debug = TRUE;
mkrfcmsg(from, dest, NULL, NULL, Msg.Written + (gmt_offset((time_t)0) * 60), flags, qp, 0L, FALSE);
ftn2rfc(from, dest, NULL, NULL, Msg.Written + (gmt_offset((time_t)0) * 60), flags, qp);
most_debug = FALSE;
tidy_faddr(from);
fclose(qp);
@@ -781,6 +779,26 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
Syslog('m', "Export netmail to %s of %s (%s) %s mode", Msg.To, Msg.ToAddress,
(Msg.Crash || Msg.Direct || Msg.FileAttach) ? "Direct" : "Routed", UUCPgate ? "UUCP" : "Netmail");
/*
* Analyze this message if it contains INTL, FMPT and TOPT kludges
* and check if we need them. If they are missing they are inserted.
* GoldED doesn't insert them but MBSE does.
*/
if (Msg_Read(MsgNum, 78)) {
if ((p = (char *)MsgText_First()) != NULL) {
do {
if (strncmp(p, "\001FMPT", 5) == 0)
is_fmpt = TRUE;
if (strncmp(p, "\001TOPT", 5) == 0)
is_topt = TRUE;
if (strncmp(p, "\001INTL", 5) == 0)
is_intl = TRUE;
if (strncmp(p, "--- ", 4) == 0)
break;
} while ((p = (char *)MsgText_Next()) != NULL);
}
}
/*
* Check if this a netmail to our own local UUCP gate.
*/
@@ -824,6 +842,14 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
fprintf(fp, "Content-Transfer-Encoding: 8bit\n");
fprintf(fp, "X-Mailreader: MBSE BBS %s\r\n", VERSION);
if (msgs.Aka.point && !is_fmpt)
fprintf(fp, "X-FTN-FMPT: %d\r", msgs.Aka.point);
if (Dest.point && !is_topt)
fprintf(fp, "X-FTN-TOPT: %d\r", Dest.point);
if (!is_intl)
fprintf(fp, "X-FTN-INTL: %d:%d/%d %d:%d/%d\r", Dest.zone, Dest.net, Dest.node,
msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node);
if (Msg_Read(MsgNum, 78)) {
if ((p = (char *)MsgText_First()) != NULL) {
do {
@@ -947,25 +973,6 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
return;
}
/*
* Analyze this message if it contains INTL, FMPT and TOPT kludges
* and check if we need them. If they are missing they are inserted.
* GoldED doesn't insert them but MBSE does.
*/
if (Msg_Read(MsgNum, 78)) {
if ((p = (char *)MsgText_First()) != NULL) {
do {
if (strncmp(p, "\001FMPT", 5) == 0)
is_fmpt = TRUE;
if (strncmp(p, "\001TOPT", 5) == 0)
is_topt = TRUE;
if (strncmp(p, "\001INTL", 5) == 0)
is_intl = TRUE;
if (strncmp(p, "--- ", 4) == 0)
break;
} while ((p = (char *)MsgText_Next()) != NULL);
}
}
if (msgs.Aka.point && !is_fmpt)
fprintf(qp, "\001FMPT %d\r", msgs.Aka.point);
if (Dest.point && !is_topt)
@@ -1077,9 +1084,9 @@ void ExportEmail(unsigned long MsgNum)
}
rewind(qp);
most_debug = TRUE;
retval = mkrfcmsg(from, too, Msg.Subject, NULL, Msg.Written, flags, qp, 0L, TRUE);
retval = ftn2rfc(from, too, Msg.Subject, NULL, Msg.Written, flags, qp);
most_debug = FALSE;
Syslog('m', "mkrfcmsg rc=%d", retval);
Syslog('m', "ftn2rfc rc=%d", retval);
email_out++;
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/scannews.c
* Purpose ...............: Scan for new News
* Last modification date : 01-Jul-2001
* Last modification date : 04-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -42,9 +42,10 @@
#include "../lib/msgtext.h"
#include "mkftnhdr.h"
#include "hash.h"
#include "echoout.h"
#include "rollover.h"
#include "pack.h"
#include "storeecho.h"
#include "rfc2ftn.h"
#include "scannews.h"
@@ -58,16 +59,6 @@
*/
POverview xoverview = NULL;
int marker = 0;
static int ftnorigin;
static int removemime;
static int removemsgid;
static int removeref;
static int removeinreply;
static int removesupersedes;
static int removeapproved;
static int removereplyto;
static int removereturnto;
static int dirtyoutcode = CHRS_NOTSET;
@@ -84,9 +75,6 @@ extern int echo_out;
extern int echo_in;
extern char *replyaddr;
extern char *toname; /* To user */
extern char *fromname; /* From user */
extern char *subj; /* Message subject */
/*
@@ -99,7 +87,7 @@ void tidy_artlist(List **);
void fill_artlist(List **, char *, long, int);
void Marker(void);
int get_article(char *, char *);
int needputrfc(rfcmsg *);
void tidy_artlist(List **fdp)
@@ -134,49 +122,6 @@ void fill_artlist(List **fdp, char *id, long nr, int dupe)
/*
* write an arbitrary line to message body,
* if a line starts with three dashes, insert a dash and a blank
*/
int charwrite(char *, FILE *);
int charwrite(char *s, FILE *fp)
{
if ((strlen(s) >= 3) && (strncmp(s,"---",3) == 0) && (s[3] != '-')) {
putc('-',fp);
putc(' ',fp);
}
while (*s) {
putc(*s, fp);
s++;
}
return 0;
}
/*
* write (multiline) header to kluge: change \n to ' ' and end line with \n
*/
int kludgewrite(char *, FILE *);
int kludgewrite(char *s, FILE *fp)
{
while (*s) {
if (*s == '\r')
putc('\n', fp);
else {
if (*s != '\n')
putc(*s, fp);
else if (*(s+1))
putc(' ',fp);
}
s++;
}
putc('\n',fp);
return 0;
}
void Marker(void)
{
if (do_quiet)
@@ -397,776 +342,13 @@ int get_article(char *msgid, char *ftntag)
news_in++;
IsDoing("Article %d", (news_in));
retval = do_article(fp);
retval = rfc2ftn(fp, NULL);
fclose(fp);
return retval;
}
int do_article(FILE *fp)
{
char sbe[16], *p, *q, *temp;
int i, incode, outcode, pgpsigned;
int First = TRUE, seenlen, oldnet;
sysconnect Link;
rfcmsg *msg = NULL, *tmsg, *tmp;
ftnmsg *fmsg = NULL;
FILE *ofp;
fa_list *sbl = NULL, *ptl = NULL, *tmpl;
faddr *ta, *From;
unsigned long svmsgid, svreply;
int sot_kludge = FALSE, eot_kludge = FALSE, qp_or_base64 = FALSE, tinyorigin = FALSE;
int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders;
char newsubj[4 * (MAXSUBJ+1)], *oldsubj, *acup_a = NULL;
unsigned long acup_n = 0, crc2;
int html_message = FALSE;
time_t Now;
rewind(fp);
msg = parsrfc(fp);
incode = outcode = CHRS_NOTSET;
pgpsigned = FALSE;
p = hdr((char *)"Content-Type",msg);
if (p)
incode=readcharset(p);
if (incode == CHRS_NOTSET) {
p = hdr((char *)"X-FTN-CHRS",msg);
if (p == NULL)
p = hdr((char *)"X-FTN-CHARSET", msg);
if (p == NULL)
p = hdr((char *)"X-FTN-CODEPAGE", msg);
if (p)
incode = readchrs(p);
}
if ((p = hdr((char *)"Content-Type",msg)) && ((strcasestr(p,(char *)"multipart/signed")) ||
(strcasestr(p,(char *)"application/pgp")))) {
pgpsigned = TRUE;
outcode = incode;
} else if ((p = hdr((char *)"X-FTN-ORIGCHRS", msg)))
outcode = readchrs(p);
else if (dirtyoutcode != CHRS_NOTSET)
outcode = dirtyoutcode;
else
outcode = getoutcode(incode);
for (tmsg = msg; tmsg; tmsg = tmsg->next)
if (strcasecmp(tmsg->key, "X-FTN-SEEN-BY") == 0)
fill_list(&sbl, tmsg->val, NULL, TRUE);
if (!CFG.allowcontrol) {
if (hdr((char *)"Control",msg)) {
Syslog('n', "skipping news message");
tidy_falist(&sbl);
tidyrfc(msg);
return RETVAL_OK;
}
}
if ((fmsg = mkftnhdr(msg, incode, outcode, TRUE)) == NULL) {
WriteError("Unable to create FTN headers from RFC ones, aborting");
tidy_falist(&sbl);
tidyrfc(msg);
return RETVAL_ERROR;
}
/*
* Setup PATH line
*/
sprintf(sbe, "%u/%u", msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl, sbe);
fmsg->area = xstrcpy(msgs.Tag);
svmsgid = fmsg->msgid_n;
svreply = fmsg->reply_n;
if ((p = hdr((char *)"Message-ID",msg))) {
ftnmsgid(p, &fmsg->msgid_a, &fmsg->msgid_n, fmsg->area);
hash_update_s(&fmsg->msgid_n, fmsg->area);
}
if ((p = hdr((char *)"References",msg))) {
p = strrchr(p,' ');
ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area);
if (!chkftnmsgid(p)) {
hash_update_s(&fmsg->reply_n, fmsg->area);
}
} else if ((p = hdr((char *)"In-Reply-To",msg))) {
ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area);
if (!chkftnmsgid(p)) {
hash_update_s(&fmsg->reply_n, fmsg->area);
}
}
if (incode == CHRS_NOTSET)
incode = msgs.Rfccode;
if (outcode == CHRS_NOTSET)
outcode = msgs.Ftncode;
if ((incode == CHRS_NOTSET) && (hdr((char *)"Message-ID",msg))) {
if (chkftnmsgid(hdr((char *)"Message-ID",msg)))
incode = CHRS_DEFAULT_FTN;
else
incode = CHRS_DEFAULT_RFC;
}
temp = calloc(4096, sizeof(char));
removemime = FALSE;
removemsgid = FALSE;
removeref = FALSE;
removeinreply = FALSE;
removesupersedes = FALSE;
removeapproved = FALSE;
removereplyto = TRUE;
removereturnto = TRUE;
ftnorigin = fmsg->ftnorigin;
if ((hdr((char *)"X-PGP-Signed",msg)))
pgpsigned = TRUE;
if (pgpsigned)
Syslog('n', "pgpsigned = %s", pgpsigned ? "True":"False");
q = hdr((char *)"Content-Transfer-Encoding",msg);
if (q)
while (*q && isspace(*q))
q++;
if (!(q))
q = (char *)"8bit";
if ((p = hdr((char *)"Content-Type",msg))) {
while (*p && isspace(*p))
p++;
/*
* turn the quoted-printable decode mode on; remember FTN is virtually 8-bit clean
*/
if ((strncasecmp(p, "text/plain", 10) == 0) && (strncasecmp(q, "quoted-printable", 16) == 0))
qp_or_base64 = 1;
/*
* turn the base64 decode mode on
*/
else if ((strncasecmp(p, "text/plain", 10) == 0) && (strncasecmp(q, "base64", 6) == 0))
qp_or_base64 = 2;
/*
* text/html support from FSC-HTML 001 proposal of Odinn Sorensen (2:236/77)
*/
if (strncasecmp(p, "text/html", 9) == 0)
html_message = TRUE;
for (tmp = msg; tmp; tmp = tmp->next)
if (((strcasecmp(tmp->key,"X-FTN-KLUDGE") == 0) && (strcasecmp(tmp->val,"FSCHTML") == 0)) ||
(strcasecmp(tmp->key,"X-FTN-HTML") == 0))
html_message = FALSE;
if ((readcharset(p) != CHRS_NOTSET ) && ((q == NULL) || (strncasecmp(q,"7bit",4) == 0) ||
((!pgpsigned) && (qp_or_base64==1)) || ((!pgpsigned) && (qp_or_base64==2)) || (strncasecmp(q,"8bit",4) == 0)))
removemime=1; /* no need in MIME headers */
/*
* some old MUA puts "text" instead of "text/plain; charset=..."
*/
else if ((strcasecmp(p,"text\n") == 0))
removemime = TRUE;
}
if (removemime || qp_or_base64 || html_message)
Syslog('n', "removemime=%s, qp_or_base64 = %d, html_message=%s", removemime ? "True":"False", qp_or_base64,
html_message ? "True":"False");
if ((p = hdr((char *)"Message-ID",msg))) {
if (!removemsgid)
removemsgid = chkftnmsgid(p);
}
Syslog('n', "removemsgid = %s", removemsgid ? "True":"False");
if ((!removeref) && (p = hdr((char *)"References",msg))) {
p = xstrcpy(p);
q = strtok(p," \t\n");
if ((q) && (strtok(NULL," \t\n") == NULL))
removeref = chkftnmsgid(q);
free(p);
}
if (removeref)
Syslog('n', "removeref = %s", removeref ? "True":"False");
if ((p = hdr((char *)"Supersedes",msg)))
removesupersedes = chkftnmsgid(p);
if (removesupersedes)
Syslog('n', "removesupersedes = %s", removesupersedes ? "True":"False");
if ((p = hdr((char *)"Approved",msg))) {
while (*p && isspace(*p))
p++;
if ((q = strchr(p,'\n')))
*q='\0';
if (strlen(msgs.Moderator) && (strcasestr(msgs.Moderator,p)))
removeapproved = TRUE;
if (q)
*q='\n';
}
if (removeapproved)
Syslog('n', "removeapproved = %s", removeapproved ? "True":"False");
if ((p = hdr((char *)"Reply-To",msg))) {
removereplyto = FALSE;
if ((q = hdr((char *)"From",msg))) {
char *r;
r = xstrcpy(p);
p = r;
while(*p && isspace(*p))
p++;
if (p[strlen(p)-1] == '\n')
p[strlen(p)-1]='\0';
if (strcasestr(q,p))
removereplyto = TRUE;
free(r);
}
}
Syslog('n', "removereplyto = %s", removereplyto ? "True":"False");
if ((p = hdr((char *)"Return-Receipt-To",msg))) {
removereturnto = FALSE;
if ((q = hdr((char *)"From",msg))) {
char *r;
r = xstrcpy(p);
p = r;
while (*p && isspace(*p))
p++;
if (p[strlen(p)-1] == '\n')
p[strlen(p)-1]='\0';
if (strcasestr(q,p))
removereturnto = TRUE;
// free(r);
}
}
if (!removereturnto)
Syslog('n', "removereturnto = %s", removereturnto ? "True":"False");
p = ascfnode(fmsg->from,0x1f);
i = 79-11-3-strlen(p);
if (ftnorigin && fmsg->origin && (strlen(fmsg->origin) > i)) {
/* This is a kludge... I don't like it too much. But well,
if this is a message of FTN origin, the original origin (:)
line MUST have been short enough to fit in 79 chars...
So we give it a try. Probably it would be better to keep
the information about the address format from the origin
line in a special X-FTN-... header, but this seems even
less elegant. Any _good_ ideas, anyone? */
/* OK, I am keeping this, though if should never be used
al long as X-FTN-Origin is used now */
p = ascfnode(fmsg->from,0x0f);
Syslog('n', "checkorigin 3");
i = 79-11-3-strlen(p);
tinyorigin = TRUE;
}
if (tinyorigin)
Syslog('n', "tinyorigin = %s", tinyorigin ? "True":"False");
if ((fmsg->origin) && (strlen(fmsg->origin) > i))
fmsg->origin[i]='\0';
forbidsplit = (ftnorigin || (hdr((char *)"X-FTN-Split",msg)));
needsplit = 0;
splitpart = 0;
hdrsize = 20;
hdrsize += (fmsg->subj)?strlen(fmsg->subj):0;
if (fmsg->from)
hdrsize += (fmsg->from->name)?strlen(fmsg->from->name):0;
if (fmsg->to)
hdrsize += (fmsg->to->name)?strlen(fmsg->to->name):0;
do {
Syslog('n', "split loop, splitpart = %d", splitpart);
datasize = 0;
if (splitpart) {
sprintf(newsubj,"[part %d] ",splitpart+1);
strncat(newsubj,fmsg->subj,MAXSUBJ-strlen(newsubj));
} else {
strncpy(newsubj,fmsg->subj,MAXSUBJ);
}
strcpy(newsubj, hdrnconv(newsubj, incode, outcode, MAXSUBJ));
newsubj[MAXSUBJ]='\0';
if (splitpart) {
hash_update_n(&fmsg->msgid_n,splitpart);
}
oldsubj = fmsg->subj;
fmsg->subj = newsubj;
/*
* Create a new temp message in FTN style format
*/
if ((ofp = tmpfile()) == NULL) {
WriteError("$Can't open second tmpfile");
tidy_falist(&sbl);
tidy_falist(&ptl);
tidyrfc(msg);
return RETVAL_ERROR;
}
fprintf(ofp, "AREA:%s\n", msgs.Tag);
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
if (fmsg->reply_s)
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
else if (fmsg->reply_a)
fprintf(ofp, "\1REPLY: %s %08lx\n", fmsg->reply_a, fmsg->reply_n);
Now = time(NULL) - (gmt_offset((time_t)0) * 60);
fprintf(ofp, "\001TZUTC: %s\n", gmtoffset(Now));
fmsg->subj = oldsubj;
if ((p = hdr((char *)"X-FTN-REPLYADDR",msg))) {
Syslog('n', "replyaddr 1 %s", p);
hdrsize += 10+strlen(p);
fprintf(ofp,"\1REPLYADDR:");
kludgewrite(p,ofp);
} else if (replyaddr) {
Syslog('n', "replyaddr 2");
hdrsize += 10+strlen(replyaddr);
fprintf(ofp,"\1REPLYADDR: ");
kludgewrite(replyaddr,ofp);
}
if ((p = hdr((char *)"X-FTN-REPLYTO",msg))) {
hdrsize += 8+strlen(p);
fprintf(ofp,"\1REPLYTO:");
kludgewrite(p,ofp);
} else if (replyaddr) {
hdrsize += 15;
fprintf(ofp,"\1REPLYTO: %s UUCP\n", aka2str(msgs.Aka));
} else if ((p = hdr((char *)"Reply-To",msg))) {
if ((ta = parsefaddr(p))) {
if ((q = hdr((char *)"From",msg))) {
if (!strcasestr(q,p)) {
fprintf(ofp,"\1REPLYTO: %s %s\n", ascfnode(ta,0x1f), ta->name);
}
tidy_faddr(ta);
}
}
}
if ((p=strip_flags(hdr((char *)"X-FTN-FLAGS",msg)))) {
hdrsize += 15;
fprintf(ofp,"\1FLAGS:%s\n",p);
free(p);
}
if (!hdr((char *)"X-FTN-PID", msg)) {
p = hdr((char *)"User-Agent", msg);
if (p == NULL)
p = hdr((char *)"X-Newsreader", msg);
if (p == NULL)
p = hdr((char *)"X-Mailer", msg);
if (p) {
hdrsize += 4 + strlen(p);
fprintf(ofp, "\1PID:");
kludgewrite(p, ofp);
} else {
fprintf(ofp, "\001PID: MBSE-FIDO %s\n", VERSION);
}
}
hdrsize += 8 + strlen(getchrs(outcode));
fprintf(ofp, "\001CHRS: %s\n", getchrs(outcode));
if (html_message) {
hdrsize += 9;
fprintf(ofp, "\1HTML: 5\n");
}
if (CFG.allowcontrol && (!hdr((char *)"X-FTN-ACUPDATE",msg)) && (p=hdr((char *)"Control",msg))) {
if (strstr(p,"cancel")) {
ftnmsgid(p,&acup_a,&acup_n,fmsg->area);
if (acup_a) {
hash_update_s(&acup_n,fmsg->area);
hdrsize += 26 + strlen(acup_a);
fprintf(ofp,"\1ACUPDATE: DELETE %s %08lx\n", acup_a,acup_n);
}
}
}
if ((!hdr((char *)"X-FTN-ACUPDATE",msg)) && (p=hdr((char *)"Supersedes",msg))) {
ftnmsgid(p,&acup_a,&acup_n,fmsg->area);
if (acup_a) {
hash_update_s(&acup_n,fmsg->area);
hdrsize += 26 + strlen(acup_a);
fprintf(ofp,"\1ACUPDATE: MODIFY %s %08lx\n", acup_a,acup_n);
}
}
#ifdef FSC_0070
/* FSC-0070 */
if((p = hdr((char *)"Message-ID", msg)) && !(hdr((char *)"X-FTN-RFCID", msg))) {
q = strdup(p);
fprintf(ofp,"\1RFCID:");
if ((l = strrchr(q, '<')) && (r = strchr(q, '>')) && (l < r)) {
*l++ = ' ';
while(*l && isspace(*l))
l++;
l--; /* leading ' ' */
*r-- = '\0';
while(*r && isspace(*r))
*r-- = '\0';
} else
l = q;
kludgewrite(l, ofp);
hdrsize += 6 + strlen(l);
free(q);
}
#endif /* FSC_0070 */
if (!(hdr((char *)"X-FTN-Tearline", msg)) && !(hdr((char *)"X-FTN-TID", msg))) {
sprintf(temp, " MBSE-FIDO %s", VERSION);
hdrsize += 4 + strlen(temp);
fprintf(ofp, "\1TID:");
kludgewrite(temp, ofp);
}
if ((splitpart == 0) || (hdrsize < MAXHDRSIZE)) {
for (tmp = msg; tmp; tmp = tmp->next) {
if ((!strncmp(tmp->key,"X-Fsc-",6)) ||
(!strncmp(tmp->key,"X-FTN-",6) &&
strcasecmp(tmp->key,"X-FTN-Tearline") &&
strcasecmp(tmp->key,"X-FTN-Origin") &&
strcasecmp(tmp->key,"X-FTN-Sender") &&
strcasecmp(tmp->key,"X-FTN-Split") &&
strcasecmp(tmp->key,"X-FTN-FLAGS") &&
strcasecmp(tmp->key,"X-FTN-AREA") &&
strcasecmp(tmp->key,"X-FTN-MSGID") &&
strcasecmp(tmp->key,"X-FTN-REPLY") &&
strcasecmp(tmp->key,"X-FTN-SEEN-BY") &&
strcasecmp(tmp->key,"X-FTN-PATH") &&
strcasecmp(tmp->key,"X-FTN-REPLYADDR") &&
strcasecmp(tmp->key,"X-FTN-REPLYTO") &&
strcasecmp(tmp->key,"X-FTN-To") &&
strcasecmp(tmp->key,"X-FTN-From") &&
strcasecmp(tmp->key,"X-FTN-CHARSET") &&
strcasecmp(tmp->key,"X-FTN-CHRS") &&
strcasecmp(tmp->key,"X-FTN-CODEPAGE") &&
strcasecmp(tmp->key,"X-FTN-ORIGCHRS") &&
strcasecmp(tmp->key,"X-FTN-SOT") &&
strcasecmp(tmp->key,"X-FTN-EOT") &&
strcasecmp(tmp->key,"X-FTN-Via"))) {
if ((strcasecmp(tmp->key,"X-FTN-KLUDGE") == 0)) {
if (!strcasecmp(tmp->val," SOT:\n"))
sot_kludge = TRUE;
else if (!strcasecmp(tmp->val," EOT:\n"))
eot_kludge = TRUE;
else {
hdrsize += strlen(tmp->val);
fprintf(ofp,"\1");
/* we should have restored the original string here... */
kludgewrite((tmp->val)+1,ofp);
}
} else {
hdrsize += strlen(tmp->key)+strlen(tmp->val);
fprintf(ofp,"\1%s:",tmp->key+6);
kludgewrite(tmp->val,ofp);
}
}
}
/* ZConnect are X-ZC-*: in usenet, \1ZC-*: in FTN */
for (tmp=msg;tmp;tmp=tmp->next)
if ((!strncmp(tmp->key,"X-ZC-",5))) {
hdrsize += strlen(tmp->key)+strlen(tmp->val);
fprintf(ofp,"\1%s:",tmp->key+2);
kludgewrite(tmp->val,ofp);
}
/* mondo.org gateway uses ".MSGID: ..." in usenet */
for (tmp=msg;tmp;tmp=tmp->next)
if ((!strncmp(tmp->key,".",1)) && (strcasecmp(tmp->key,".MSGID"))) {
hdrsize += strlen(tmp->key)+strlen(tmp->val);
fprintf(ofp,"\1%s:",tmp->key+1);
kludgewrite(tmp->val,ofp);
}
rfcheaders=0;
for (tmp = msg; tmp; tmp = tmp->next) {
if ((needputrfc(tmp) == 1)) {
if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) {
hdrsize += 10+strlen(tmp->val);
fprintf(ofp,"\1RFC-Newsgroups:");
} else {
hdrsize += strlen(tmp->key)+strlen(tmp->val);
fprintf(ofp,"\1RFC-%s:",tmp->key);
}
kludgewrite(hdrconv(tmp->val, incode, outcode),ofp);
}
}
for (tmp=msg;tmp;tmp=tmp->next) {
if ((needputrfc(tmp) > 1)) {
rfcheaders++;
if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) {
hdrsize += 10+strlen(tmp->val);
fprintf(ofp,"Newsgroups:");
} else {
hdrsize += strlen(tmp->key)+strlen(tmp->val);
fprintf(ofp,"%s:",tmp->key);
}
charwrite(hdrconv(tmp->val, incode, outcode),ofp);
}
}
if (rfcheaders)
charwrite((char *)"\n",ofp);
if ((hdr((char *)"X-FTN-SOT",msg)) || (sot_kludge))
fprintf(ofp,"\1SOT:\n");
if ((splitpart == 0) && (hdr((char *)"X-PGP-Signed",msg)))
fprintf(ofp,PGP_SIGNED_BEGIN"\n");
}
if (replyaddr) {
// free(replyaddr); /* Gives SIGSEGV */
replyaddr = NULL;
}
if (needsplit) {
fprintf(ofp," * Continuation %d of a split message *\n\n", splitpart);
needsplit = FALSE;
} else if ((p=hdr((char *)"X-Body-Start",msg))) {
datasize += strlen(p);
if (qp_or_base64==1)
charwrite(strkconv(qp_decode(p), incode, outcode), ofp);
else if (qp_or_base64==2)
charwrite(strkconv(b64_decode(p), incode, outcode), ofp);
else
charwrite(strkconv(p, incode, outcode), ofp);
}
while (!(needsplit=(!forbidsplit) && (((splitpart && (datasize > (CFG.new_split * 1024))) ||
(!splitpart && ((datasize+hdrsize) > (CFG.new_split * 1024)))))) && (bgets(temp,4096-1,fp))) {
datasize += strlen(temp);
if (qp_or_base64==1)
charwrite(strkconv(qp_decode(temp), incode, outcode), ofp);
else if (qp_or_base64==2)
charwrite(strkconv(b64_decode(temp), incode, outcode), ofp);
else
charwrite(strkconv(temp, incode, outcode), ofp);
}
if (needsplit) {
fprintf(ofp,"\n * Message split, to be continued *\n");
splitpart++;
} else if ((p=hdr((char *)"X-PGP-Signed",msg))) {
fprintf(ofp,PGP_SIG_BEGIN"\n");
if ((q=hdr((char *)"X-PGP-Version",msg))) {
fprintf(ofp,"Version:");
charwrite(q,ofp);
}
if ((q=hdr((char *)"X-PGP-Charset",msg))) {
fprintf(ofp,"Charset:");
charwrite(q,ofp);
}
if ((q=hdr((char *)"X-PGP-Comment",msg))) {
fprintf(ofp,"Comment:");
charwrite(q,ofp);
}
fprintf(ofp,"\n");
p=xstrcpy(p);
q=strtok(p," \t\n");
fprintf(ofp,"%s\n",q);
while ((q=(strtok(NULL," \t\n"))))
fprintf(ofp,"%s\n",q);
fprintf(ofp,PGP_SIG_END"\n");
}
if ((p=hdr((char *)"X-FTN-EOT",msg)) || (eot_kludge))
fprintf(ofp,"\1EOT:\n");
if ((p=hdr((char *)"X-FTN-Tearline",msg))) {
fprintf(ofp,"---");
if (strcasecmp(p," (none)\n") == 0)
charwrite((char *)"\n",ofp);
else
charwrite(p,ofp);
} else
fprintf(ofp,"--- MBSE BBSv.%s\n",VERSION);
if ((p = hdr((char *)"X-FTN-Origin",msg))) {
if (*(q=p+strlen(p)-1) == '\n')
*q='\0';
fprintf(ofp," * Origin:");
charwrite(hdrconv(p, incode, outcode),ofp);
} else {
fprintf(ofp," * Origin: "); /* strlen=11 */
if (fmsg->origin)
charwrite(hdrconv(fmsg->origin, incode, outcode), ofp);
else
charwrite(CFG.origin, ofp);
fprintf(ofp," (%s)",
ascfnode(fmsg->from,tinyorigin?0x0f:0x1f));
}
/*
* Setup SEEN-BY lines
*/
for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] && (msgs.Aka.zone == CFG.aka[i].zone) &&
!((msgs.Aka.net == CFG.aka[i].net) && (msgs.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u/%u", CFG.aka[i].net, CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE);
}
}
sprintf(sbe, "%u/%u", msgs.Aka.net, msgs.Aka.node);
First = TRUE;
/*
* Count downlinks, if there are none then no more SEEN-BY entries will be added.
*/
i = 0;
while (GetMsgSystem(&Link, First)) {
First = FALSE;
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause) && (!Link.cutoff)) {
sprintf(sbe, "%u/%u", Link.aka.net, Link.aka.node);
fill_list(&sbl, sbe, NULL, FALSE);
i++;
}
}
uniq_list(&sbl);
sort_list(&sbl);
seenlen=MAXSEEN+1;
if (i) {
/* ensure it will not match for the first entry */
oldnet = sbl->addr->net-1;
for (tmpl = sbl; tmpl; tmpl = tmpl->next) {
if (tmpl->addr->net == oldnet)
sprintf(sbe," %u",tmpl->addr->node);
else
sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node);
oldnet = tmpl->addr->net;
seenlen += strlen(sbe);
if (seenlen > MAXSEEN) {
seenlen = 0;
fprintf(ofp,"\nSEEN-BY:");
sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node);
seenlen = strlen(sbe);
}
fprintf(ofp,"%s",sbe);
}
} else {
fprintf(ofp,"\nSEEN-BY: %s",sbe);
}
for (tmp = msg; tmp; tmp = tmp->next) {
if (!strcasecmp(tmp->key,"X-FTN-PATH")) {
fill_path(&ptl,tmp->val);
}
}
sprintf(sbe,"%u/%u",msgs.Aka.net, msgs.Aka.node);
fill_path(&ptl,sbe);
uniq_list(&ptl);
seenlen = MAXPATH+1;
/* ensure it will not match for the first entry */
oldnet = ptl->addr->net-1;
for (tmpl = ptl; tmpl; tmpl = tmpl->next) {
if (tmpl->addr->net == oldnet)
sprintf(sbe," %u",tmpl->addr->node);
else
sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node);
oldnet = tmpl->addr->net;
seenlen += strlen(sbe);
if (seenlen > MAXPATH) {
seenlen = 0;
fprintf(ofp,"\n\1PATH:");
sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node);
seenlen = strlen(sbe);
}
fprintf(ofp,"%s",sbe);
}
fprintf(ofp,"\n");
tidy_falist(&ptl);
fflush(ofp);
rewind(ofp);
Syslog('n', "========== Fido start");
while (fgets(temp, 4096, ofp) != NULL) {
/*
* Only log kludges, skip the body
*/
if ((temp[0] == '\001') || !strncmp(temp, "AREA:", 5) || !strncmp(temp, "SEEN-BY", 7)) {
Striplf(temp);
Syslogp('n', printable(temp, 0));
}
}
Syslog('n', "========== Fido end");
rewind(ofp);
Msg_New();
if ((fmsg->to != NULL) && (fmsg->to->name != NULL))
strcpy(Msg.To, fmsg->to->name);
else
sprintf(Msg.To, "All");
Syslog('n', "Msg.To: %s", printable(Msg.To, 0));
toname = xstrcpy(Msg.To);
if ((fmsg->from != NULL) && (fmsg->from->name != NULL)) {
strcpy(Msg.From, fmsg->from->name);
Syslog('n', "Msg.From: %s", printable(Msg.From, 0));
fromname = xstrcpy(Msg.From);
} else {
Syslog('n', "Warning: no Msg.From name found");
}
strcpy(Msg.Subject, fmsg->subj);
subj = xstrcpy(Msg.Subject);
Msg.Echomail = TRUE;
Msg.Written = fmsg->date;
Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60);
sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka));
/*
* These are the only usefull flags in echomail
*/
if ((fmsg->flags & M_PVT) && ((msgs.MsgKinds == BOTH) || (msgs.MsgKinds == PRIVATE)))
Msg.Private = TRUE;
if (fmsg->flags & M_FILE)
Msg.FileAttach = TRUE;
/*
* Set MSGID and REPLYID crc.
*/
if (fmsg->msgid_a != NULL) {
crc2 = -1;
Msg.MsgIdCRC = upd_crc32(fmsg->msgid_a, crc2, strlen(fmsg->msgid_a));
}
if (fmsg->reply_a != NULL) {
crc2 = -1;
Msg.ReplyCRC = upd_crc32(fmsg->reply_a, crc2, strlen(fmsg->reply_a));
}
if (Msg_Open(msgs.Base)) {
if (Msg_Lock(30L)) {
rewind(ofp);
fgets(temp, 2048, ofp); /* "Eat" the first line AREA:... */
Msg_Write(ofp);
Msg_AddMsg();
Msg_UnLock();
echo_in++;
Syslog('+', "Newsgate %s => %s msg %ld", msgs.Newsgroup, msgs.Tag, Msg.Id);
}
Msg_Close();
StatAdd(&msgs.Received, 1);
time(&msgs.LastRcvd);
StatAdd(&mgroup.MsgsRcvd, 1);
time(&mgroup.LastDate);
}
/*
* Now start exporting this echomail.
*/
First = TRUE;
while (GetMsgSystem(&Link, First)) {
First = FALSE;
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause) && (!Link.cutoff)) {
if (SearchNode(Link.aka)) {
StatAdd(&nodes.MailSent, 1L);
UpdateNode();
SearchNode(Link.aka);
}
echo_out++;
Syslog('n', "Export to %s", aka2str(Link.aka));
From = fido2faddr(msgs.Aka);
EchoOut(From, Link.aka, ofp, fmsg->flags, 0, fmsg->date);
tidy_faddr(From);
}
}
free(fromname);
free(toname);
free(subj);
fclose(ofp);
} while (needsplit);
tidy_falist(&sbl);
tidy_falist(&ptl);
free(temp);
news_imp++;
tidyrfc(msg);
tidy_ftnmsg(fmsg);
UpdateMsgs();
return RETVAL_OK;
}
int get_xover(char *grpname, long startnr, long endnr, List **art)
{
char cmd[81], *ptr, *ptr2, *resp, *p;
@@ -1319,119 +501,3 @@ int get_xoverview(void)
}
int needputrfc(rfcmsg *msg)
{
faddr *ta;
/* 0-junk, 1-kludge, 2-pass */
// Syslog('M', "needputrfc(%s)", printable(msg->key,0));
if ((msg->key == NULL) || (strlen(msg->key) == 0)) return 0;
if (!strcasecmp(msg->key,"X-UUCP-From")) return -1;
if (!strcasecmp(msg->key,"X-Body-Start")) return -1;
if (!strncasecmp(msg->key,".",1)) return 0;
if (!strncasecmp(msg->key,"X-FTN-",6)) return 0;
if (!strncasecmp(msg->key,"X-Fsc-",6)) return 0;
if (!strncasecmp(msg->key,"X-ZC-",5)) return 0;
if (!strcasecmp(msg->key,"X-Gateway")) return 0;
if (!strcasecmp(msg->key,"Path")) return 0;
if (!strcasecmp(msg->key,"Newsgroups")) {
if ((hdr((char *)"X-Origin-Newsgroups",msg)))
return 0;
else if (strstr(msg->val,","))
return 1;
else
return 0;
}
if (!strcasecmp(msg->key,"X-Origin-Newsgroups")) {
if (strstr(msg->val,","))
return 1;
else
return 0;
}
if (!strcasecmp(msg->key,"Control")) {
if (CFG.allowcontrol) {
if (strstr(msg->val,"cancel"))
return 1;
else
return 0;
} else
return 0;
}
if (!strcasecmp(msg->key,"Return-Path")) return 1;
if (!strcasecmp(msg->key,"Xref")) return 0;
if (!strcasecmp(msg->key,"Approved")) return removeapproved ? -1:2;
if (!strcasecmp(msg->key,"X-URL")) return 0;
if (!strcasecmp(msg->key,"Return-Receipt-To")) return removereturnto? 0:1;
if (!strcasecmp(msg->key,"Notice-Requested-Upon-Delivery-To")) return 0;
if (!strcasecmp(msg->key,"Received")) return 0;
if (!strcasecmp(msg->key,"From")) {
if ((ta = parsefaddr(msg->val))) {
tidy_faddr(ta);
return 0;
} else {
return 2;
}
}
if (!strcasecmp(msg->key,"To")) {
return 0;
}
if (!strcasecmp(msg->key,"Cc")) return 2;
if (!strcasecmp(msg->key,"Bcc")) return 0;
if (!strcasecmp(msg->key,"Reply-To")) {
if ((ta = parsefaddr(msg->val))) {
tidy_faddr(ta);
return -1;
} else
return removereplyto ?0:4;
}
if (!strcasecmp(msg->key,"Lines")) return 0;
if (!strcasecmp(msg->key,"Date")) return 0;
if (!strcasecmp(msg->key,"Subject")) {
if ((msg->val) && (strlen(msg->val) > MAXSUBJ))
return 2;
else
return 0;
}
if (!strcasecmp(msg->key,"Organization")) return 1;
if (!strcasecmp(msg->key,"Comment-To")) return 0;
if (!strcasecmp(msg->key,"X-Comment-To")) return 0;
if (!strcasecmp(msg->key,"X-Apparently-To")) return 0;
if (!strcasecmp(msg->key,"Apparently-To")) return 0;
if (!strcasecmp(msg->key,"X-Fidonet-Comment-To")) return 0;
if (!strcasecmp(msg->key,"Keywords")) return 2;
if (!strcasecmp(msg->key,"Summary")) return 2;
if (!strcasecmp(msg->key,"MIME-Version")) return removemime ?0:1;
if (!strcasecmp(msg->key,"Content-Type")) return removemime ?0:1;
if (!strcasecmp(msg->key,"Content-Length")) return removemime ?0:1;
if (!strcasecmp(msg->key,"Content-Transfer-Encoding")) return removemime ?0:1;
if (!strcasecmp(msg->key,"Content-Name")) return 2;
if (!strcasecmp(msg->key,"Content-Description")) return 2;
if (!strcasecmp(msg->key,"Message-ID")) return removemsgid ?0:1;
if (!strcasecmp(msg->key,"References")) return removeref ?0:1;
if (!strcasecmp(msg->key,"Supersedes")) return removesupersedes ?0:1;
if (!strcasecmp(msg->key,"Distribution")) return ftnorigin ?0:0;
if (!strcasecmp(msg->key,"X-Newsreader")) return 0;
if (!strcasecmp(msg->key,"X-Mailer")) return 0;
if (!strcasecmp(msg->key,"User-Agent")) return 0;
if (!strncasecmp(msg->key,"NNTP-",5)) return 0;
if (!strncasecmp(msg->key,"X-Trace",7)) return 0;
if (!strncasecmp(msg->key,"X-Complaints",12)) return 0;
if (!strncasecmp(msg->key,"X-MSMail",9)) return 0;
if (!strncasecmp(msg->key,"X-MimeOLE",9)) return 0;
if (!strncasecmp(msg->key,"X-MIME-Autoconverted",20)) return 0;
if (!strcasecmp(msg->key,"X-Origin-Date")) return 0;
if (!strncasecmp(msg->key,"X-PGP-",6)) return 0;
if (!strncasecmp(msg->key,"Resent-",7)) return 0;
if (!strcasecmp(msg->key,"X-Mailing-List")) return 0;
if (!strcasecmp(msg->key,"X-Loop")) return 0;
if (!strcasecmp(msg->key,"Precedence")) return 0;
/*if (!strcasecmp(msg->key,"")) return ;*/
return 1;
}

View File

@@ -32,7 +32,6 @@ enum { RETVAL_ERROR = -1, RETVAL_OK = 0, RETVAL_NOARTICLES, RETVAL_UNEXPECTEDANS
void ScanNews(void);
int do_article(FILE *);
#endif

View File

@@ -2,7 +2,7 @@
*
* File ..................: mbfido/tic.c
* Purpose ...............: Process .tic files
* Last modification date : 08-Jul-2001
* Last modification date : 31-Jul-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -311,7 +311,7 @@ int LoadTic(char *inb, char *tfn)
}
if (strncasecmp(Temp, "seenby ", 7) == 0) {
fill_list(&sbl, Temp+7, NULL, FALSE);
fill_list(&sbl, Temp+7, NULL);
Kwd = TRUE;
}

View File

@@ -2,7 +2,7 @@
*
* File ..................: tosser/tosspkt.c
* Purpose ...............: Toss a single *.pkt file
* Last modification date : 03-Jun-2001
* Last modification date : 03-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
@@ -34,9 +34,18 @@
#include "../lib/records.h"
#include "../lib/common.h"
#include "../lib/clcomm.h"
#include "../lib/msg.h"
#include "../lib/msgtext.h"
#include "../lib/dbcfg.h"
#include "../lib/dbnode.h"
#include "importmsg.h"
#include "../lib/dbmsgs.h"
#include "../lib/dbdupe.h"
#include "../lib/dbuser.h"
#include "../lib/dbftn.h"
#include "tosspkt.h"
#include "postnetmail.h"
#include "postecho.h"
#include "rollover.h"
@@ -44,6 +53,11 @@
* External declarations
*/
extern int do_quiet;
extern int do_unsec;
extern int check_dupe;
extern int autocrea;
extern time_t t_start;
extern int most_debug;
@@ -68,15 +82,20 @@ int email_in = 0; /* Email received */
int email_imp = 0; /* Email imported */
int email_out = 0; /* Email forwarded */
int email_bad = 0; /* Bad email */
char *toname = NULL; /* To user */
char *fromname = NULL; /* From user */
char *subj = NULL; /* Message subject */
extern char *msgid;
static int at_zero = 0;
char *aread(char *, int, FILE *);
/*
* Internal prototypes
*/
char *aread(char *, int, FILE *);
int importmsg(faddr *, faddr *, faddr *, char *, char *, time_t, int, int, FILE *);
void autocreate(char *, faddr *);
char *aread(char *s, int count, FILE *fp)
{
int i,c,next;
@@ -118,6 +137,220 @@ char *aread(char *s, int count, FILE *fp)
/*
* Import 1 message, forward if needed.
* pkt_from, from, to, subj, orig, mdate, flags, cost, file
*
* 0 - All Seems Well.
* 1 - Can't access messagebase.
* 2 - Cannot open mareas.data
* 3 - Echomail without Origin line.
* 4 - Echomail from unknown node, disconnected node.
* 5 - Locking error.
*
*/
int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj,
time_t mdate, int flags, int cost, FILE *fp)
{
char *buf, *marea = NULL;
int echomail = FALSE, rc = 0, bad = FALSE, Known = FALSE, FirstLine;
sysconnect Link;
if (CFG.slow_util && do_quiet)
usleep(1);
memset(&Link, 0, sizeof(Link));
/*
* Increase uplink's statistic counter.
*/
Link.aka.zone = p_from->zone;
Link.aka.net = p_from->net;
Link.aka.node = p_from->node;
Link.aka.point = p_from->point;
if (SearchNode(Link.aka)) {
StatAdd(&nodes.MailRcvd, 1);
UpdateNode();
SearchNode(Link.aka);
Known = TRUE;
}
buf = calloc(2048, sizeof(char));
marea = NULL;
/*
* First read the message for kludges we need.
*/
rewind(fp);
FirstLine = TRUE;
while ((fgets(buf, 2048, fp)) != NULL) {
Striplf(buf);
/*
* Check if message is echomail and if the areas exists.
*/
if (FirstLine && (!strncmp(buf, "AREA:", 5))) {
marea = xstrcpy(tu(buf + 5));
if (orig == NULL) {
Syslog('!', "Echomail without Origin line");
echo_bad++;
echo_in++;
bad = TRUE;
free(buf);
free(marea);
return 3;
}
if (!SearchMsgs(marea)) {
WriteError("Unknown echo area %s", marea);
if (autocrea) {
autocreate(marea, p_from);
if (!SearchMsgs(marea)) {
WriteError("Autocreate of area %s failed.", area);
echo_bad++;
echo_in++;
bad = TRUE;
free(marea);
free(buf);
return 4;
}
} else {
echo_bad++;
echo_in++;
bad = TRUE;
free(buf);
free(marea);
return 4;
}
}
echomail = TRUE;
free(marea);
}
if (*buf != '\001')
FirstLine = FALSE;
} /* end of checking kludges */
if (echomail)
rc = postecho(p_from, f, t, orig, subj, mdate, flags, cost, fp, TRUE);
else
rc = postnetmail(fp, f, t, orig, subj, mdate, flags, TRUE);
free(buf);
return rc;
}
/*
* Create echomail area if it doesn't excist and allowed.
* Contributed by Redy Rodriguez.
*/
void autocreate(char *marea, faddr *p_from)
{
FILE *pMsgs;
char temp[250];
int i;
struct _sysconnect syscon;
if (!SearchMsgs((char *)"DEFAULT")){
WriteError("Can't find DEFAULT area, can't autocreate:");
autocrea = FALSE;
return;
}
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((pMsgs = fopen(temp, "r+")) == NULL) {
WriteError("$Database error: Can't create %s", temp);
return;
}
strncat(msgs.Name,marea,40-strlen(msgs.Name));
strncpy(msgs.Tag,marea,50);
strncpy(msgs.QWKname,marea,20);
strncat(msgs.Base,marea,64-strlen(msgs.Base));
fseek(pMsgs, 0, SEEK_END);
Syslog('+', "Autocreate area %s", marea);
memset(&syscon, 0, sizeof(syscon));
syscon.aka.zone = p_from->zone;
syscon.aka.node = p_from->node;
syscon.aka.net = p_from->net;
if (SearchFidonet(p_from->zone))
strcpy(syscon.aka.domain,fidonet.domain);
else {
WriteError("New area %s from node of unknown zone %d not created.", marea,p_from->zone);
fclose(pMsgs);
return;
}
syscon.sendto = TRUE;
syscon.receivefrom = TRUE;
if (msgs.Aka.zone == 0) {
for (i = 0; i < 40; i++) {
if (CFG.akavalid[i]) {
msgs.Aka.zone=CFG.aka[i].zone;
msgs.Aka.net=CFG.aka[i].net;
msgs.Aka.node=CFG.aka[i].node;
msgs.Aka.point=CFG.aka[i].point;
strcpy(msgs.Aka.domain,CFG.aka[i].domain);
i=40;
}
}
for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] && (strcmp(CFG.aka[i].domain,msgs.Aka.domain)==0)) {
msgs.Aka.zone=CFG.aka[i].zone;
msgs.Aka.net=CFG.aka[i].net;
msgs.Aka.node=CFG.aka[i].node;
msgs.Aka.point=CFG.aka[i].point;
strcpy(msgs.Aka.domain,CFG.aka[i].domain);
i=40;
}
}
for (i = 0; i < 40; i++) {
if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone)) {
msgs.Aka.zone=CFG.aka[i].zone;
msgs.Aka.net=CFG.aka[i].net;
msgs.Aka.node=CFG.aka[i].node;
msgs.Aka.point=CFG.aka[i].point;
strcpy(msgs.Aka.domain,CFG.aka[i].domain);
i=40;
}
}
for (i = 0; i < 40; i++) {
if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone) && (CFG.aka[i].net == p_from->net)) {
msgs.Aka.zone=CFG.aka[i].zone;
msgs.Aka.net=CFG.aka[i].net;
msgs.Aka.node=CFG.aka[i].node;
msgs.Aka.point=CFG.aka[i].point;
strcpy(msgs.Aka.domain,CFG.aka[i].domain);
i=40;
}
}
for (i = 0; i < 40; i++) {
if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone) &&
(CFG.aka[i].net == p_from->net) && (CFG.aka[i].node == p_from->node)) {
msgs.Aka.zone=CFG.aka[i].zone;
msgs.Aka.net=CFG.aka[i].net;
msgs.Aka.node=CFG.aka[i].node;
msgs.Aka.point=CFG.aka[i].point;
strcpy(msgs.Aka.domain,CFG.aka[i].domain);
i=40;
}
}
}
fwrite(&msgs, msgshdr.recsize, 1, pMsgs);
fwrite(&syscon, sizeof(syscon), 1, pMsgs);
memset(&syscon, 0, sizeof(syscon));
for (i = 1 ; i < CFG.toss_systems; i++ )
fwrite(&syscon, sizeof(syscon), 1, pMsgs);
fclose(pMsgs);
return;
}
/*
* Toss one packet.
*
@@ -198,11 +431,8 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
time_t mdate = 0L;
FILE *fp;
unsigned char buffer[0x0e];
off_t orig_off;
char *subj = NULL;
subj = NULL;
toname = NULL;
fromname = NULL;
result = fread(&buffer, 1, sizeof(buffer), pkt);
if (result == 0) {
Syslog('m', "Zero bytes message, assume end of pkt");
@@ -259,7 +489,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
if (strlen(buf) > 36)
Syslog('!', "to name too long (%d) \"%s\"", strlen(buf), printable(buf, 0));
t.name = xstrcpy(buf);
toname = xstrcpy(buf);
if (aread(buf, sizeof(buf)-1, pkt)) {
if (*(p=t.name+strlen(t.name)-1) == '\n')
*p = '\0';
@@ -272,7 +501,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
if (strlen(buf) > 36)
Syslog('!', "from name too long (%d) \"%s\"", strlen(buf), printable(buf, 0));
f.name = xstrcpy(buf);
fromname = xstrcpy(buf);
if (aread(buf, sizeof(buf)-1, pkt)) {
if (*(p=f.name+strlen(f.name)-1) == '\n')
*p = '\0';
@@ -307,7 +535,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
WriteError("$unable to open temporary file");
return 4;
}
orig_off = 0L;
/*
* Read the text from the .pkt file
@@ -320,7 +547,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
* Extract info from Origin line if found.
*/
if (!strncmp(buf," * Origin:",10)) {
orig_off = ftell(fp);
p=buf+10;
while (*p == ' ') p++;
if ((l=strrchr(p,'(')) && (r=strrchr(p,')')) && (l < r)) {
@@ -346,7 +572,7 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
}
}
rc = importmsg(p_from, &f,&t,orig,mdate,flags,cost,fp,orig_off);
rc = importmsg(p_from, &f,&t,orig,subj,mdate,flags,cost,fp);
if (rc)
rc+=10;
if (rc > maxrc)
@@ -370,14 +596,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
free(t.domain);
t.domain=NULL;
if (fromname)
free(fromname);
fromname = NULL;
if (toname)
free(toname);
toname = NULL;
if (subj)
free(subj);
subj = NULL;
@@ -386,10 +604,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
free(orig);
orig = NULL;
if (msgid)
free(msgid);
msgid = NULL;
if (feof(pkt) || ferror(pkt)) {
WriteError("Unexpected end of packet");
return 5;