home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume18 / fnet / part01 next >
Encoding:
Text File  |  1989-03-05  |  62.5 KB  |  1,933 lines

  1. Subject:  v18i002:  Fido/Usenet gateway, Part01/05
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Heikki Suonsivu <hsu@santra.hut.fi>
  7. Posting-number: Volume 18, Issue 2
  8. Archive-name: fnet/part01
  9.  
  10. This code implements a gateway between Usenet/UUCP/Mail and Fido.
  11. I haven't tried it.  It's in ALPHA test.
  12.  
  13. ---- Cut Here and unpack ----
  14. #!/bin/sh
  15. # shar:    Shell Archiver  (v1.22)
  16. #
  17. # This is part 1 of a multipart archive
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. #
  20. #    Run the following text with /bin/sh to create:
  21. #      README
  22. #      HISTORY
  23. #      INSTALL
  24. #      LICENCE
  25. #      NOTES
  26. #      PROBLEMS
  27. #      TODO
  28. #      Alias
  29. #      fnews.cf
  30. #      notes
  31. #      de
  32. #      d
  33. #      fcaller
  34. #      Makefile
  35. #      getdate.y
  36. #      rfmail.c
  37. #      funcs.c
  38. #      rfnews.c
  39. #      rmail.c
  40. #      fpack.c
  41. #      funpack.c
  42. #      fcall.c
  43. #      fio.c
  44. #      xtsend.c
  45. #      xtrec.c
  46. #      nodelist.c
  47. #      gethostname.c
  48. #      dateconv.c
  49. #      address.c
  50. #      crc.c
  51. #      lintlib.c
  52. #      sprintfs.c
  53. #      strempty.c
  54. #      listscan.c
  55. #      ftime.c
  56. #      fnet.h
  57. #      config.h
  58. #      fpack.h
  59. #      rmail.h
  60. #      fio.h
  61. #      crc.h
  62. #      hsu.h
  63. #      shuffle.h
  64. #      sysexits.h
  65. #      nodelist.h
  66. #      fnews.h
  67. #
  68. if test -r s2_seq_.tmp
  69. then echo "Must unpack archives in sequence!"
  70.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  71.      exit 1; fi
  72. echo "x - extracting README (Text)"
  73. sed 's/^X//' << 'SHAR_EOF' > README &&
  74. XNOTE: I don't speak/write English very well so there are probably
  75. Xlots of strange sentences, feel free to mail me at mcvax!santra!hsu
  76. Xor mcvax!clinet!hsu to ask if you can't understand what I meant.
  77. X
  78. XThis program has been originally written by Teemu Torma. Teemu gave up
  79. Xdeveloping this for something like a year ago so I have continued his
  80. Xwork.  Most of work probably is still from Teemu, I have done
  81. Xfidonet-pickup, nodelist indices (rewrote) some work on news-echo
  82. Xconversions, and most of debugging on receiver, news-echo-stuff and to
  83. Xget both directions to work with binkley. The only other mailer
  84. XI have tested this with is Dutchie.
  85. X
  86. XThis is still in alpha-state, I haven't done much testing on
  87. Xerror conditions, somewhere it may exit if something is wrong, somewhere
  88. Xit sends mail to root/uucp etc :)
  89. X
  90. XIf you think this is for you, check TODO for what you could
  91. Xdo for it, for partial (I'm lazy!) version-history you can check
  92. XHISTORY. For some info about what it does in certain conditions, you
  93. Xshould see NOTES. For installation, check INSTALL, but do it
  94. XAFTER reading all the other files.
  95. X
  96. XIf you find 'notes' in the archive, it's my comment file for my internal
  97. Xuse. Probably it doesn't help much unless you speak Finnish :-)
  98. X
  99. X
  100. XAbout testing
  101. X-------------
  102. X
  103. X*IMPORTANT*
  104. X
  105. XI have never tested this in a real news-environment, as getting news
  106. Xto local machine here in Finland is quite expensive and price is
  107. Xper-site, not per-feed. Plus the extra hard disk I would need to get
  108. Xnews fit on my machine. Currently I just have fidonet echomails.
  109. XBecause of this, be extremely careful when installing this thing, as
  110. Xsome mistake I or you made when installing could cause flood of
  111. Xunwanted stuff worldwide, and a big bill for you! I take no
  112. Xreponsibility whatever.
  113. X
  114. X
  115. SHAR_EOF
  116. chmod 0644 README || echo "restore of README fails"
  117. echo "x - extracting HISTORY (Text)"
  118. sed 's/^X//' << 'SHAR_EOF' > HISTORY &&
  119. X0.3.3
  120. X
  121. X- WAITCLEAR.
  122. X- PREWAIT, WAITCLEAR, MAX_SEND_RETRIES. Makes it more configureable, though
  123. Xconfiguration file would be far better for this kind of purpose.
  124. X
  125. X- Fixed bugs in sealink, which caused transfers on bad lines
  126. Xto stop with too many retries message.
  127. X
  128. X- Fixed bug in funpack which could cause terminating too early. It was
  129. Xa bug in get_string, which didn't read the terminating null char if
  130. Xstring was too long just equal to maximum length (someone had 35 char
  131. Xname :-), and it read one null more, thought it had no subject, sent
  132. Xsubject as message body to mail and got something else than message magic (2),
  133. Xand thought here is the end. Also now reports if it got something else
  134. Xthan 2, and stops then.
  135. X
  136. X0.3.2
  137. X
  138. X- Receiver is now Sealink capable (if that means just adding blocknum
  139. Xand its complement after naks and acks?). It seems to work?  I did it
  140. Xbecause I had problems when communicating with Binkley, which says
  141. X'timeout' in long transfers, with no apparent reason, message appears
  142. Xwithout any delay which could be the reason for such message?  Maybe
  143. Xthis works better?  Sender is not capable of Sealink, though it
  144. Xwouldn't be difficult?
  145. X
  146. X- Some minor changes.
  147. X
  148. X0.3.1
  149. X
  150. X- Line wrap now according to FSC-0001.TXT.
  151. X
  152. X- rnews can be replaced by command in fnews.cf. This makes possible
  153. Xforwarding sysop-echos and such restricted echos to selected users or
  154. Xconverting echos to mailing lists.
  155. X
  156. X- 'of (node-specification)' will be now removed from name if it is
  157. Xthere and node-specification specified an existing node. This node-spec
  158. Xwill be saved and used if originator cannot be found for some reason
  159. Xfor reply-to path. Order to use is nodelist, orig in name, origin line
  160. Xin message, echo feed.
  161. X
  162. X- Zone support has gone giant step forward. For points I need more info,
  163. Xie where they are located in fidonet structures. There shouldn't be
  164. Xnet-node combinations anywhere, its all Node structures.
  165. X
  166. X- Packet names have been changed to a very strange format, and files
  167. Xare stored in in and out directories. Specially the name format may change
  168. Xin future again, now its really strange.
  169. X
  170. X- Special characters will be removed user names and scandinavian chars will
  171. Xbe converted to a and o. Neither conversion happens in usenet format
  172. Xmessages, but I'll work on it (news software may take care if it itself?).
  173. X
  174. X- REMOVE_ID_IN_PARENTHESIS and SEARCH_NAME_IN_NODELIST are no more
  175. Xoptions, they will be forced in this version.
  176. X
  177. X- Some bug fixes.
  178. X
  179. X- Maybe something else too but I dont remember what.
  180. X
  181. X0.2.3
  182. X
  183. X- Echomail origin, seenby and so on will be partially printed by
  184. Xprogram, makes maintaining easier as admin doesn't need to change
  185. Xnode numbers in many places, and version number will be up to date.
  186. X
  187. X- Some bugs fixed.
  188. SHAR_EOF
  189. chmod 0644 HISTORY || echo "restore of HISTORY fails"
  190. echo "x - extracting INSTALL (Text)"
  191. sed 's/^X//' << 'SHAR_EOF' > INSTALL &&
  192. XKind of an installation manual...
  193. X
  194. Xcopy/untar/unshar all the stuff in /usr/lib/fnet or any directory
  195. Xyou would like to use as lib dir.
  196. X
  197. XIf you haven't got any publicdomain dial package, I would recommend
  198. Xgetting one, I have never seen working version of SVR* dial package.
  199. XI tried using HDB, but its configuration happens same way the
  200. Xlogin handshake in Systems (expect-send-expect), which doesn't give
  201. Xmuch chance for regognizing different kind of responses etc, I would
  202. Xlike to continue redialing continuously if system is busy and so on.
  203. XI have been using dial package from Gene H. Olson, ihnp4!quest!gene,
  204. Xthanks for his nice work! I picked it up from local pay-unix-bbs
  205. X(City Lines Oy/mcvax!clinet, Teemu works there), so it may be
  206. Xa bit old version.
  207. X
  208. X
  209. Xconfig.h
  210. X--------
  211. X
  212. XEdit config.h. It should (but maybe not) include all necessary
  213. Xinformation.
  214. X
  215. XNote: Use full pathnames, with no trailing slash!
  216. X
  217. X#define USG
  218. Xleave it there, unless you are on BSD, in which case you have
  219. Xlots of work to do, as both Teemu and me have to work on SYSV.* (which
  220. XI don't like at all, an operating system which cannot change file size
  221. Xto nothing else than 0? and more...:-).
  222. X
  223. X#define MY_ZONE 2
  224. X#define MY_REGION 22
  225. X#define MY_NET 504
  226. X#define MY_NODE 7
  227. X#define MY_POINT 0
  228. XThis specifies your fidonet address.
  229. X
  230. XIf you don't know what should be here, you should contact with nearest
  231. XFidonet system and try to find out from sysop (fidonet)address of
  232. Xnearest fidonet network/region coordinator, who will assing you a node
  233. Xnumber, and ask him about how to arrange routing. He probably gives
  234. Xyou list of sysops to whom you should contact and ask if you can
  235. Xpoll echomails from, or tells you who to poll. It might be good
  236. Xidea if you get FSC*.TXT documents and bunch of fidonews which would
  237. Xgive you better idea what fidonet is. (Ok, I guess you know it already
  238. Xif you have come this far :-).
  239. X
  240. XAnd, the most important, you can contact IFNA, International FidoNet
  241. XAssociation, if you need more info. I recommend you to become a member
  242. Xif you have interest in this hobby.
  243. X
  244. X#define PREWAIT 2
  245. XThis is time to be waited between connect and sending TSYNCH, ie start
  246. Xof fidonet handshake. Originally it was 5 but some binkleyterm users
  247. Xsqueeze time too short and this causes problems, so I have it as 2.
  248. X
  249. X#define WAITCLEAR 4
  250. XAfter sending cr+sps to line, protocol waits for line to be cleared. This
  251. Xtime often depends on the modems, as some modems wait for error correction
  252. Xtimeout for long time.
  253. X
  254. X#define MAXBAUD 1200
  255. XThis is used in creating packets and in dial, where dial baud/speed is
  256. Xset to either it or to speed of the system we are dialing at.
  257. X
  258. X#define MINBAUD 300
  259. XIf speed of systems to be called is less than this, this will be
  260. Xused instead. I haven't used this, It's for people with constant-speed
  261. Xmodems.
  262. X
  263. X#define MAX_LINELEN 72
  264. XThis tells the program how wide it should format the messages. Fidonet
  265. Xhas hairy message format, which varies a lot, as people use lots of
  266. Xdifferent 'soft' carriage returns for message formatting. Its nice for
  267. Xsome environments (like commode-64 :-), though.
  268. X
  269. X#define RECEIVE_PATH "emma"
  270. XThis will be added in the beginning of news messages, to make news
  271. Xnot to echo it back. This is same system name you must add to
  272. XNEWSLIB/sys file, I have the following in /usr/lib/news/sys
  273. Xemma:fidonet,to.emma::/usr/lib/fnet/rfnews
  274. X
  275. X#define DOMAIN ".UUCP"
  276. X.UUCP if not there. I haven't checked this out, but I guess its ok.
  277. X
  278. X#define SPOOL "/usr/spool/fnet"
  279. XPrepacked messages, send- and receive-bundles go here.
  280. X
  281. X#define LIBDIR "/usr/lib/fnet"
  282. XThis is where you have all the source and binaries. This should be
  283. Xchanged so that sources would be somewhere else.
  284. X
  285. X#define RNEWS "/usr/bin/rnews"
  286. XThis is rnews from news package. If you can't find it, you either
  287. Xaren't running news, or you are running some other news-handling
  288. Xprogram.  This program should be capable of getting a message in
  289. Xnormal mail format, there is Newsgroups: line and so on, which would
  290. Xtell it to which newsgroup it belongs, and then put the message where
  291. Xit should be put.  It also forwards the message to other systems if
  292. Xthey are redistributed, in which case it should check out the path so
  293. Xit won't send it back to fidonet, as that would produce a loop, which
  294. Xwouln't be funny for the sysop running the fido system :-) Remeber
  295. Xthat messages sent back to fidonet aren't probably any more so much
  296. Xlike originals that confmail etc would regognize them as duplicates!
  297. X
  298. X#define LOGFILE "/usr/lib/fnet/log"
  299. XLog file in which all kinds of messages are appended. You should check
  300. Xit out sometimes and clean it up, it grows for ever.
  301. X
  302. X#define IDSEQUENCE "/usr/lib/fnet/idseq"
  303. XThis is a file which includes seqence number for creating unique message
  304. Xid.
  305. X
  306. X#define USERUID 50
  307. XI haven't checked out what this does?
  308. X
  309. X#define ALIAS "/usr/lib/fnet/Alias
  310. XSee comments in the file itself (should be in the distribution).
  311. X
  312. X#define RMAIL "/bin/rmail"
  313. XThis is probably ok for you system, it should be mail sender, just don't
  314. Xset it to mailer which can loop back to rfmail :-)
  315. XIf you dont want to be a gateway, just make it local-mailer.
  316. X
  317. X/* #define HAVE_SYSEXITS
  318. XDefine this if you have <sysexits.h>
  319. X
  320. X#define INT16 short
  321. XThis isn't used in all places where 16-bit int is wanted, so be
  322. Xcareful with this! Due to alignment problems I run into, I
  323. Xremoved structure writes and reads.
  324. X
  325. X#define SWAB_BYTES
  326. XDefine this on MC68* and so on which have most significant byte at
  327. Xlowest memory address (a mess dos has least significant byte there).
  328. XRemeber that if that one filler-long in header structure will be
  329. Xused some day, there is no swapper for that yet! (I hope I remember
  330. Xit too).
  331. X
  332. X#define RETURN_FAILED_MAIL
  333. XDefine this if you want rfmail to return underlivered mail. You do
  334. Xnot need this if you are running sendmail or similiar which returns
  335. Xundelivered mail.
  336. X
  337. XShortnames.
  338. XThis is for those idiot SV machines which don't accept more than 8
  339. Xchars per name. You also need gnu cpp if your cpp doesn't have more
  340. Xthan 8 chars either. I have got a miniframe, so I need this.  Note,
  341. Xthere might be more of those problem-causers crept in during time I
  342. Xhave been developing this on 386 microport machine now.
  343. X
  344. X#define DIALTABLE "358-0-", "",  "358-", "9",  "", "990"
  345. X
  346. XThis is for dialing, I did just a quick hack but it probably
  347. Xworks on most cases, originally it wanted phone number as a parameter,
  348. Xnow it picks up it from nodelist, so I needed some kind of
  349. Xtable here.
  350. XTrick is to compare string to the beginning of the phone number,
  351. Xand if it matches, replace it with string following. Last one,
  352. Xin which empty string would be checked for, must be there.
  353. X
  354. X
  355. XMakefile
  356. X--------
  357. XENA should be something which allows you to change ownerships to something
  358. Xelse. I found it easier to make this work running under ena shell (I know,
  359. XI'm trying to commit a suicide :-),
  360. X
  361. XSHELL should be /bin/sh, ksh might work also if you have it. In fact, in
  362. Xthis Microport version of 386 I have there is a bug in /bin/sh which
  363. Xcauses problems when using it.
  364. X
  365. XCFLAGS
  366. X------
  367. X-DLOCK_LOCKF means that this machine has lock function called lockf,
  368. Xotherwise it calls it locking (like in miniframe CTIX). If you don't
  369. Xhave either, you are in trouble.
  370. X
  371. XOWNER
  372. XGROUP
  373. XUucp and daemon or uucp and mail are good candidates?
  374. X
  375. XCheck out chmod's in Makefile, I have been probably too open with them.
  376. X(Single user 386 with no external logins :-)
  377. X
  378. XI don't use SCCS either, but maybe I start using it, I just have had
  379. Xso many things to think about so reading the manual is still waiting.
  380. X
  381. X
  382. XFiles and rest of work
  383. X----------------------
  384. X
  385. Xchown all files for same groups you specified in Makefile, make the
  386. Xspool directory and other directories under it and chown them too.
  387. X
  388. XEdit the Areas, Aliases files following the instructions in them.
  389. XYou need to generate newsgroups for echomails using inews -C.
  390. XI have names groups as fidonet.something.
  391. X
  392. Xinstall it to crontab/etc so that it calls to fidonet host you
  393. Xshould be polling at. It should do
  394. X
  395. Xfpack -f your_boss_fidonet_address
  396. Xfcall -l /dev/ttysomething -m -d -f your_boss_fidonet_address
  397. Xfunpack
  398. X
  399. Xand put output to log (note: Log will be enormous if you don't
  400. Xcut debug values in distributed config.h, this alpha-version
  401. Xwill have debugs on ready for you to debug, as it probably won't
  402. Xrun as is anyway :-).
  403. X
  404. XGet new nodelist. Best place to hunt for it is nearest fidonet system.
  405. XConvert it to unix format before using it (just lfs, no cr+lf, no ^Z).
  406. X
  407. XModifying rn common.h (line 559 in version 4.3 I have) from
  408. X
  409. X#    define NEWSHEADER "Newsgroups: %(%F=^$?%C:%F)\nSubject: %
  410. (%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References:
  411.  %R\n)Sender: \nReply-To: %L@%H.UUCP (%N)\nFollowup-To: \nDistribution: %
  412. (%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords: %[keywords]\n\n"
  413. X
  414. Xto
  415. X#    define NEWSHEADER "Newsgroups: %(%F=^$?%C:%F)\nSubject: %
  416. (%S=^$?%\"\n\nSubject: \":Re: %S)\nSummary: \nExpires: \n%(%R=^$?:References:
  417.  %R\n)Sender: \nReply-To: %L@%H.UUCP (%N)\nFollowup-To: \nDistribution: %
  418. (%i=^$?%\"Distribution: \":%D)\nOrganization: %o\nKeywords:
  419.  %[keywords]\nComment-To: %t\n\n"
  420. X
  421. X(Just added Comment-To: %t\n in the end!)
  422. XIt adds name of recipent to news messsages, so it will be in fidonet
  423. Xecho replies, otherwise you need to type it hand or leave it out in which
  424. Xcase to-field be set to All.
  425. X
  426. XYou should arrange addresses which look like fidonet addresses,
  427. Xprobably everything of format huu@something.fidonet to be passed to
  428. Xrfmail.  You could try rmail which comes with this software, though I
  429. Xhaven't tried it yet, better choice would be to use sendmail or
  430. Xanything which can forward certain kind of addresses to other mailer.
  431. X
  432. SHAR_EOF
  433. chmod 0644 INSTALL || echo "restore of INSTALL fails"
  434. echo "x - extracting LICENCE (Text)"
  435. sed 's/^X//' << 'SHAR_EOF' > LICENCE &&
  436. XIf there is a COPYRIGHT file also, check it out.
  437. X
  438. XI have used getdate.y and ftime.c from news package, thanks for Steven
  439. XM. Bellovin (unc!smb) and Chapel Hill. I hope they don't mind even
  440. Xthough I didn't ask for it!
  441. X
  442. X-------------------------------------------------------------------------
  443. XThis software should be used in friendly and lawful manner!
  444. X
  445. XIf using this in Finland, I personally recommend joining network 504.
  446. X
  447. XYou may not sell this software, you must give it free! Idea is to keep
  448. Xthis and all derived versions as free and source-distributed.
  449. X
  450. XWe take absolutely no responsibility on any trouble caused by using this,
  451. Xso you are on your own risk if you use this.
  452. X
  453. XComments, new features and bug fixes can be sent to hsu@clinet,
  454. Xhsu@santra, 2:504/1, 2:504/7, ...!mcvax!santra!hsu, HSU@FINGATE.BITNET
  455. XHeikki Suonsivu / Kuutamokatu 5 A 7 / 02210 Espoo / FINLAND
  456. X
  457. X
  458. SHAR_EOF
  459. chmod 0644 LICENCE || echo "restore of LICENCE fails"
  460. echo "x - extracting NOTES (Text)"
  461. sed 's/^X//' << 'SHAR_EOF' > NOTES &&
  462. XProblems with porting
  463. X---------------------
  464. X
  465. XWhy all people can't make standards? Even names can be messed up with
  466. Xall kinds of fields, someone puts linefeeds there, fills it up with blanks,
  467. Xadds 'of net/node' or '(USERID)' or something like that. Linefeeds in
  468. Xmessages have several versions, cr+lf, lf, cr+seadogsoftcr, seadogsoftcr,
  469. Xcr+lf+cr_with_8bit_on and all other combinations of those :-)
  470. X
  471. X
  472. XChanges in message format
  473. X-------------------------
  474. X
  475. XFrom 0.3.1 line wraps should be correctly handled.
  476. X
  477. XSubject will be set to 'No subject' if its empty, as news doesn't accept
  478. Xmissing subject, it ignores the message without one.
  479. X
  480. XFSC controls (^Axxxx) are converted to FSC-control:xxxx, which
  481. Xprobably works better in ascii-environments line news. It also
  482. Xprevents terminals going nuts if there are terminals which do
  483. Xsomething about ^A.
  484. X
  485. XNeither is converted back when sending the message out, thouch making
  486. XNo subject back to empty string maybe would be reasonable?
  487. X
  488. XNumber of headers will be added to messages.
  489. X
  490. X
  491. XProgram structure
  492. X-----------------
  493. X
  494. XLooks like spaghetti?
  495. SHAR_EOF
  496. chmod 0644 NOTES || echo "restore of NOTES fails"
  497. echo "x - extracting PROBLEMS (Text)"
  498. sed 's/^X//' << 'SHAR_EOF' > PROBLEMS &&
  499. XUsers in fidonet are allowed to enter private messages in echos,
  500. Xwhich causes trouble, how to handle those messages?
  501. X
  502. XPacket name can be longer than maximum filename length in system V,
  503. Xcould there be some really fancy idea of creating names or just make
  504. Xthem fido compatible, though that doesn't show zone and point in
  505. Xpacket name?
  506. SHAR_EOF
  507. chmod 0644 PROBLEMS || echo "restore of PROBLEMS fails"
  508. echo "x - extracting TODO (Text)"
  509. sed 's/^X//' << 'SHAR_EOF' > TODO &&
  510. XIt probably needs complete rewrite :-)
  511. X
  512. XProtocol module seems to need improvement, specially startup sometimes
  513. Xseems to be rough. I also tried to work with opus without any kind of
  514. Xfront end as v32 modem I had took too long time to time out and
  515. Xbinkley started to opus, but protocol startup failed, it got one
  516. Xpacket but then started complaining about funny packet numbers and I
  517. Xhavent had time to check it out.
  518. X
  519. XBatching news would improve performance a lot, though I guess rewriting
  520. Xfunpack would save even more.
  521. X
  522. XPoint and zone addressing should be done. It knows zones but looses
  523. Xthe info when packing. I'll rewrite packer to get some routing stuff
  524. Xin and I try to get that done same time. If zones are important you might
  525. Xget around limitations with sendmail or customizing smail or like.
  526. X
  527. XForwarding to other fidonet nodes should be implemented? It would be
  528. Xbetter to pick message as is, just change from and destination node
  529. Xaddresses and stick it to packets needed, which would create blazing
  530. Xfast redistribution. Going through news would be cpu hogger never seen
  531. Xas theres very little advantage.
  532. X
  533. XFfgets still does need more tuneup: Sometimes I received messages with
  534. Xsoft crs and no blank. So, if lines get combined, a blank should be
  535. Xinserted if soft cr is found. I think according to fsc-001 its really
  536. Xthe problem in someone elses software, as fsc-001 says that soft crs
  537. Xetc should be ignored, not replaced with (single) blank. but I think
  538. Xit would be better to accept that format also.
  539. X
  540. XMessage-id should really be something which could allow noticing
  541. Xduplicates.  maybe date and node number could be used.
  542. X
  543. XDate length problem is still open, is it 20 chars like in fsc-001 or
  544. X19 like in all messages I receive (via confmail)?
  545. X
  546. XFcall xmodem receive is horrible cpu hog. I have to profile it and see
  547. Xwhats happening, probably readline?
  548. X
  549. XI/P packets could be in subdirectories or even node structure
  550. X
  551. Xcould be built for spool directory like
  552. X
  553. X...fnet/I/2/504/1/0   2:504/1.0
  554. X...fnet/I/2/504/26/0  2:504/26.0
  555. X...fnet/I/2/504/26/2  2:504/26.2
  556. X
  557. XMessage body should be checked out for control chars and ibmscii. I have
  558. Xa separate filter which takes care of that, I just have
  559. Xto install it, so wait for the next version.
  560. X
  561. XRECEIVE_PATH could be fidonet path, not symbolic as it is now, I have
  562. Xto check out if news, mail etc accept addresses which start with a number.
  563. X
  564. XIf fnews.cf has errors in newsgroup flags, it will coredump. One should
  565. Xcheck those strtoks there.
  566. X
  567. XWhen receiving new echo area, it should be automatically added
  568. Xto fnews.cf, and su newsuser /usr/lib/news/inews -C fidonet.echoareaname
  569. Xshould be called.
  570. X
  571. XHDB uucp seems to be able to kill fcall calling out? Lock file is uucp
  572. Xmail, is in /usr/spool/locks (svr3) and has process id in it with 10 chars
  573. Xand \n at end.
  574. X
  575. Xrfmail could accept any kind of fidonet address, like
  576. Xsysop-name.fidonet, system-name.fidonet and such things. Though, this
  577. Xwould require some artifical intelligence!
  578. X
  579. XProcessing private echo messages could be changed, now it tries to send
  580. Xthem to local user, failing in parsing address and sending the stuff to
  581. Xuucp or root. Use accept-private and trash-private to get around this.
  582. X
  583. XConfigure-script? have to check out it there is public domain one?
  584. XYes there is, it just came over usenet but I haven't tried it yet.
  585. X
  586. XThere should be a configuration file for everything, not it needs
  587. Xrecompilation for just about everything.
  588. X
  589. XNodelist and Index files are in memory, this will break up the roof in
  590. Xbrain-damaged architectures. There should be an option for making
  591. Xindices disk-resident if user wants it. Biggest problem is the name
  592. Xlist, it could be rewritten to use char * for names insted of
  593. Xconstant-length name. With current nodelist of about 4000 nodes, it
  594. Xwill be > 150 k. Disk-resident would be nice but I haven't got
  595. Xmergesort/disky qsort/disky bsearch around so I skipped it.
  596. X
  597. XFrom: field should really be identical to Reply-To: field and latter
  598. Xcould be removed. On the other hand, there would be info about from
  599. Xwhich echo feed it came from, but that should be separate field. I'll
  600. Xleave it as is now, comments?
  601. X
  602. XI will try to build routine capable of reading list of names with
  603. Xfidonet numbers to use for finding out mail address, so lists like
  604. XFFUA (Finnish Fido Users Association) membership list could be used.
  605. X
  606. XGenerally all fields could follow rfc822 spec from FSC documentation
  607. Xbut it has some problems with news: No spec for newsgroups statement
  608. Xand areas conversion. Most echomail names still are just names, like
  609. XC_ECHO and so on, if people had been using fidonet.something from the
  610. Xbeginning, things would be easier. I tried to push it through, so its
  611. Xused in Finland, and in some conferences in Europe, most notably in
  612. XEnet.sysop I started in Europe when I first time got my hands on
  613. Xechomail :-)
  614. X
  615. XIn-Reply-To: could be set to what is in FSC-Control: EID: xxxx , but I
  616. Xhave to find out more about EID: mechanism before I get into it.
  617. X
  618. XNow it uses Comment-To: to set up receiver field, node address is
  619. Xeither the one in nodelist or * origin. Origin probably bad guess but
  620. Xthat's all we have got! For this reason, storing information about
  621. Xreceved fidonet addresses would be good idea.
  622. X
  623. XSome people may get theirs reply-to field to point to node first found
  624. Xin nodelist, even if they want to get mail to some other node.
  625. X
  626. XThere would be another solution for reply-via mail. If it doesn't find
  627. Xcorrect node from origin line or nodelist, it should send the mail
  628. Xback to original echo as private message. clumsy, though.
  629. X
  630. XMan pages are completely missing, I haven't got experience on writing
  631. Xroff but maybe I have time to open the manual next week!
  632. X
  633. XFile requests and other fancy stuff. Never heard of :-)
  634. Xmodem7/telink is there, but haven't tried it yet.
  635. X
  636. XThere should be some kind of locking-mechanish using lock files, as
  637. Xnot all machines have lockf or locking.  I try to hack on other things
  638. Xmyself as I have locking/lockf.
  639. X
  640. Xfgets in funpack.c looks for * Origin in both mails and echos, only
  641. Xechos are needed.
  642. X
  643. Xfcall should be modified to be capable of being slave like uucico. It
  644. Xcould try slave mode if no node is specified, but I need a getty which
  645. Xnotices TSYNC when someone calls in.
  646. X
  647. XAREA: fields and FSC-controls might be moved to message header, as
  648. Xthey could be removed when reading news easily with rn parameters, but
  649. Xconverting them back to their original places is a bit nasty, maybe I
  650. Xshould include some kind of line-number? On the other hand, is it
  651. Xnecessary to have them at their original places anyway, message format
  652. Xwill be changed a bit always?
  653. X
  654. Xfunpack: opens and closes config file for every message. Lots of other
  655. Xinefficiences all around. Parsing headers should really be rewritten,
  656. Xnow it makes number of passes through the message.
  657. X
  658. Xreaction to incorrect permissions etc can be fatal, rfmail just
  659. Xignores the message if log file could not be opened, though it says
  660. Xerror but cannot log it. It should at least send message to news admin
  661. Xand then maybe loop until it can read write log file... ok, getting too
  662. Xfancy.
  663. X
  664. XCurrently only one fidonet mail/echo feed is supported as receiver,
  665. Xbut several systems can be polled for mail. This could be reasonably
  666. Xeasy to correct, just make fpack ignore messages not destined to
  667. Xsystem specified, or even better, pack messages according to routing
  668. Xfiles, which could be simple.
  669. X
  670. XArcmail capability should be build, even one-directional
  671. Xwould be help, I just have to compile arc for this machine, running
  672. X(pk)arc under dosmerge isn't reliable with my beta-version of
  673. Xdosmerge, and people without 386 couldn't run it at all.
  674. X
  675. XNow there are routines in some programs which could be used (and be
  676. Xhelpful and cleaner) in other programs also, and sometimes code
  677. Xis really quick-hack-style.
  678. X
  679. XKeep in touch!
  680. X
  681. SHAR_EOF
  682. chmod 0644 TODO || echo "restore of TODO fails"
  683. echo "x - extracting Alias (Text)"
  684. sed 's/^X//' << 'SHAR_EOF' > Alias &&
  685. X#
  686. X#   @(#)%M%  %I%  Teemu Torma %H%
  687. X#
  688. X#   File for aliases.
  689. X#
  690. X#   Each line contains alias-name, followed by optional net/node information.
  691. X#   If alias is followed by net/node information, alias is used only if
  692. X#   mail is going to that net/node. There may be more than one net/node
  693. X#   spesification for one alias, in that case they are separated by commas.
  694. X#
  695. X#   If net is missing from net/node spesification, e.g. net/node is only
  696. X#   single number, node is to be considered on our net. If node is missing,
  697. X#   e.g. it is empty string, all nodes in that net are valid.
  698. X#
  699. X#   First alias found will be used, so if there are aliases with same name,
  700. X#   that alias that doesn't have net/node limits or has wider limits that
  701. X#   some other alias, should ba after later alias.
  702. X#
  703. X#   NOTE: sysop-aliases are not necessary, because rfmail uses normally
  704. X#   name found from nodelist if mail is to sysop and alias settings
  705. X#   overrides that. Only on some cases sysop-alias might be useful, e.g.
  706. X#   if there are more than one sysop, you may want to use just Sysop or
  707. X#   one of the sysops.
  708. X#
  709. X#   These aliases are used when receiving mail from fidonet, to
  710. X#   handle incoming news with private flag set. If no alias exist,
  711. X#   forget about message.
  712. X#
  713. X#   Alias for sysop in node 1 (our net, 504)
  714. Xsysop,1                         Heikki Suonsivu
  715. X#   Mail to tot in net 504 will be send to Teemu Torma
  716. Xtot,504/                        Teemu Torma
  717. Xhsu,504/                        Heikki Suonsivu
  718. SHAR_EOF
  719. chmod 0644 Alias || echo "restore of Alias fails"
  720. echo "x - extracting fnews.cf (Text)"
  721. sed 's/^X//' << 'SHAR_EOF' > fnews.cf &&
  722. X#
  723. X#   @(#)%M%  %I%  Teemu Torma %H%
  724. X#
  725. X#   Configuration file for Usenet News <-> echomail programs.
  726. X#   Each Section is separated by *-character at the first column.
  727. X#   Lines beginning with #-character are considered as comments.
  728. X#
  729. X#   Net/Node to send this article. Format is Net/Node, e.g 504/8.
  730. X#
  731. X504/26
  732. X*
  733. X#
  734. X#   Newsgroup -> echomail area conversions. First is newsgroup followed
  735. X#   by area name to send it. If article is send to multiple newsgroups,
  736. X#   it is send to first echomail area found.
  737. X#
  738. Xfidonet.504.sysop       504.SYSOP
  739. Xfidonet.binkley         BINKLEY
  740. Xfidonet.c_echo          C_ECHO
  741. Xfidonet.eech            EECH
  742. Xfidonet.enet.sysop      ENET.SYSOP
  743. Xfidonet.fin.airways     FIN.AIRWAYS
  744. Xfidonet.fin.bbshelp     FIN.BBSHELP
  745. Xfidonet.fin.computer    FIN.COMPUTER
  746. Xfidonet.fin.culture     FIN.CULTURE
  747. Xfidonet.fin.food        FIN.FOOD
  748. Xfidonet.fin.sysop       FIN.SYSOP
  749. Xfidonet.fin.general     FIN.GENERAL
  750. Xfidonet.fin.bbs         FIN.BBS
  751. Xfidonet.fin.games       FIN.GAMES
  752. Xfidonet.fin.ham         FIN.HAM
  753. Xfidonet.fin.market      FIN.MARKET
  754. Xfidonet.fin.scifi       FIN.SCIFI
  755. Xfidonet.fin.unix        FIN.UNIX
  756. Xfidonet.fin.koulut      FIN.KOULUT
  757. Xfidonet.ham             HAM
  758. Xfidonet.hst             HST
  759. Xfidonet.ifna            IFNA
  760. Xfidonet.internat        INTERNAT
  761. Xfidonet.net_dev         NET_DEV
  762. Xfidonet.newopus         NEWOPUS
  763. Xfidonet.penpal          PENPAL
  764. Xfidonet.sffan           SFFAN
  765. Xfidonet.zone2           ZONE2
  766. X*
  767. X#
  768. X#   Header field spesifications. Here are header-fields, one by line,
  769. X#   and only those  header-lines are put in the beginning of fidonet
  770. X#   message.
  771. X#
  772. X# Newsgroups:
  773. XFrom:
  774. XDate:
  775. XSubject:
  776. XKeywords:
  777. XSummary:
  778. XLines:
  779. XComment-To:
  780. X# Organization:
  781. X*
  782. X#
  783. X#   Information to put at the end of message, e.g. Origin-message and
  784. X#   seen-by;s. Text is copied literally until *-character is found
  785. X#   at the first column. You should have your echo feed there, even though
  786. X#   news path mechanism will take care of its being posted just once.
  787. X# Fri Oct 28 02:42:08 1988 Version 0.2.3
  788. X# First line should be Origin text, next line seen-by row without my node
  789. X#
  790. X# --- rfmail 0.2.2
  791. X# * Origin: Missing Link (between usenet and fidonet) (2:504/7)
  792. X# SEEN-BY: 504/7 504/26
  793. X# PATH: 504/7
  794. XMissing Link (between usenet and fidonet)
  795. X504/7 26
  796. X*
  797. X#
  798. X#   Echomail -> newsgroup conversions. First field is area name, second
  799. X#   is newsgroup and third distribution for that newsgroup. If distribution
  800. X#   begins with "/" (slash), it is to be taken as program name to pipe
  801. X#   this article. Article will contain all From, To and subject-lines,
  802. X#   also Newsgroups: line will be present.
  803. X#   Other flags whould follow, they include:
  804. X#     accept-private    private messages will be saved as news-articles,
  805. X#                       otherwise they will go to mail or /dev/null,
  806. X#                       depending if receiver exists is this system or not.
  807. X#     command           rest of line is interpreted as command to be
  808. X#                       execute, message text in stdin.
  809. X#
  810. X504.SYSOP       fidonet.504.sysop    fidonet accept-private
  811. XBINKLEY         fidonet.binkley      fidonet trash-private
  812. XC_ECHO          fidonet.c_echo       fidonet trash-private
  813. XEECH            fidonet.eech         fidonet accept-private
  814. XENET.SYSOP      fidonet.enet.sysop   fidonet accept-private
  815. XFIN.AIRWAYS     fidonet.fin.airways  fidonet trash-private
  816. XFIN.BBSHELP     fidonet.fin.bbshelp  fidonet trash-private
  817. XFIN.COMPUTER    fidonet.fin.computer fidonet trash-private
  818. XFIN.CULTURE     fidonet.fin.culture  fidonet trash-private
  819. XFIN.FOOD        fidonet.fin.food     fidonet trash-private
  820. XFIN.SYSOP       fidonet.fin.sysop    fidonet accept-private
  821. XFIN.GENERAL     fidonet.fin.general  fidonet trash-private
  822. XFIN.BBS         fidonet.fin.bbs      fidonet trash-private
  823. XFIN.GAMES       fidonet.fin.games    fidonet trash-private
  824. XFIN.HAM         fidonet.fin.ham      fidonet trash-private
  825. XFIN.MARKET      fidonet.fin.market   fidonet trash-private
  826. XFIN.SCIFI       fidonet.fin.scifi    fidonet trash-private
  827. XFIN.UNIX        fidonet.fin.unix     fidonet trash-private
  828. XFIN.KOULUT      fidonet.fin.koulut   fidonet trash-private
  829. XHAM             fidonet.ham          fidonet trash-private
  830. XHST             fidonet.hst          fidonet trash-private
  831. XIFNA            fidonet.ifna         fidonet accept-private
  832. XINTERNAT        fidonet.internat     fidonet trash-private
  833. XNET_DEV         fidonet.net_dev      fidonet accept-private
  834. XNEWOPUS         fidonet.newopus      fidonet trash-private
  835. XPENPAL          fidonet.penpal       fidonet trash-private
  836. XSFFAN           fidonet.sffan        fidonet trash-private
  837. XZONE2           fidonet.zone2        fidonet accept-private
  838. X*
  839. SHAR_EOF
  840. chmod 0644 fnews.cf || echo "restore of fnews.cf fails"
  841. echo "x - extracting notes (Text)"
  842. sed 's/^X//' << 'SHAR_EOF' > notes &&
  843. Xtsekkaa tuo sekvenssointi tarkkaan lapi, eli miten getsequence palauttaa
  844. Xja LAITA kaikkialle kutsut siihen, niita ei ole viela!!!
  845. X
  846. XNimen parsinta ei pelaa vielakaan, jos ei ole From rivia niin se
  847. Xluulee ekaa rivia nimeksi!
  848. X
  849. XNimesta pois (JJAZZ)
  850. X
  851. XMailin lahetys ei toimi, vaittaa ettei ole datea ja Reply-to pathia
  852. Xei ilmeisesti huomioida.
  853. X
  854. Xfunpack: Jos se toteaa etta kyseessa on newssi, se tunkee fileen
  855. Xsenderin sijaa temppifileeseen. Sitten kun se on siella, se etsii
  856. Xsielta ' * Origin: ... (z:n/n)' rivia, joista osoite etsitaan, ensisijaisesti
  857. XKummastakin huomioidaan Viimeinen rivi, eli koko viesti pitaa lukea
  858. Xlavitse. Homma tehdaan itse asiasssa fgetsissa, jos se huomee jomman
  859. Xkumman niin se asettaa Node originnode struktuuriin oikeat tiedot.
  860. XLopuksi looppi joka kirjoittaa viestin senderille ja muuttaa ohimennessaan
  861. XReply-To noden oikeaksi. Pirunmoinen homma ikaankuin turhan takia, mutta
  862. Xsellaista on elama.
  863. X
  864. XJuu, tuo yllaoleva on kokonaan pielessa, news-artikkeileissa ei saa
  865. Xparsia osoitetta vaan se from jne pitaa ottaa viestista itsestaan,
  866. Xdestination-osoite on vaan routtausta varten, keskustelijoitten
  867. Xnimilla ei valttamatta ole mitaan tekemista sen kanssa!!!
  868. X
  869. Xjos senderia ei loydy / ei aliasta euid, niin tutkippa real uid
  870. X
  871. X=-------
  872. X
  873. Xfunpackissa ja rfmailissa lgetdatet muutettava sellaisiksi
  874. Xetta ne kayttavat getdatea ja siten ehka tajuavat dateformaatit
  875. Xoikein, nyt syntyy hamminkia!
  876. X
  877. XMan page miniframesta.
  878. X
  879. XHamminkia mailin kanssa, miten vitussa ne newssit saadaan jakoon!! Tutki
  880. Xse vitun perkeleen sendbatch ja jos ei muu auta niin sitten ei voi
  881. Xmuuta kuin rakentaa se batch siihen rfnewssiin. readnewssin -c:ta
  882. Xei voi kayttaa kun se panee kaiken yhteen fileeseen. Milla vitulla se
  883. Xnormaalisti kaivaa esille sen mita pitaa lahettaa ja mita ei?????
  884. X
  885. X
  886. X
  887. SHAR_EOF
  888. chmod 0644 notes || echo "restore of notes fails"
  889. echo "x - extracting de (Text)"
  890. sed 's/^X//' << 'SHAR_EOF' > de &&
  891. X: use /bin/sh
  892. Xfunpack    > loki 2>&1
  893. SHAR_EOF
  894. chmod 0755 de || echo "restore of de fails"
  895. echo "x - extracting d (Text)"
  896. sed 's/^X//' << 'SHAR_EOF' > d &&
  897. X: use /bin/sh
  898. XDIALDEBUG=a
  899. Xexport DIALDEBUG
  900. Xfpack -f 504/26 2>&1 | tee loki
  901. Xfcall -l /dev/tty00 -m -d -s 1200 -b 1200 -f 2:504/26 2>&1 | tee -a loki
  902. X
  903. SHAR_EOF
  904. chmod 0755 d || echo "restore of d fails"
  905. echo "x - extracting fcaller (Text)"
  906. sed 's/^X//' << 'SHAR_EOF' > fcaller &&
  907. X: use /bin/sh
  908. Xcd /u2/lib/fnet
  909. XDIALDEBUG=a
  910. Xexport DIALDEBUG
  911. Xfpack -f 504/26 > loki 2>&1
  912. Xfcall -l /dev/tty00 -m -s 1200 -b 1200 -d -f 504/26 >> loki 2>&1
  913. Xfunpack    >> loki 2>&1
  914. X
  915. SHAR_EOF
  916. chmod 0751 fcaller || echo "restore of fcaller fails"
  917. echo "x - extracting Makefile (Text)"
  918. sed 's/^X//' << 'SHAR_EOF' > Makefile &&
  919. X#
  920. X#    @(#)%M%  %I%  Teemu Torma %H%
  921. X#
  922. X#    Makefile for FidoNet routines
  923. X#
  924. X#    @(#)Copyright (C) Teemu Torma 1987
  925. X#
  926. X#    Use tab stops at every 4 columns.
  927. X#
  928. XENA    =
  929. XSHELL    =    /bin/sh
  930. XINCLUDE    =    /usr/include
  931. XCFLAGS    =    -DLOCK_LOCKF -g
  932. XLNFLAGS    =    -DLOCK_LOCKF
  933. X# removed -O
  934. XFUNPACK    =    funpack.o funcs.o nodelist.o gethostname.o address.o \
  935. X        getdate.o ftime.o sprintfs.o listscan.o strempty.o
  936. XLFUNPACK=    funpack.ln funcs.ln nodelist.ln gethostname.ln address.ln \
  937. X        ftime.ln sprintfs.ln listscan.ln strempty.ln
  938. XRMAIL    =    rmail.o address.o funcs.o sprintfs.o
  939. XLRMAIL    =    rmail.ln address.ln funcs.ln sprintfs.ln
  940. XRFMAIL    =    rfmail.o funcs.o nodelist.o gethostname.o address.o getdate.o \
  941. X        ftime.o sprintfs.o strempty.o
  942. XLRFMAIL    =    rfmail.ln funcs.ln nodelist.ln gethostname.ln address.ln \
  943. X        ftime.ln sprintfs.ln strempty.ln
  944. XRFNEWS    =    rfnews.o funcs.o nodelist.o address.o sprintfs.o
  945. XLRFNEWS    =    rfnews.ln funcs.ln nodelist.ln address.ln sprintfs.ln
  946. XFPACK    =    fpack.o funcs.o nodelist.o address.o sprintfs.o
  947. XLFPACK    =    fpack.ln funcs.ln nodelist.ln address.ln sprintfs.ln
  948. XFCALL    =    fcall.o funcs.o fio.o xtsend.o xtrec.o crc.o nodelist.o \
  949. X        address.o sprintfs.o
  950. XLFCALL    =    fcall.ln funcs.ln fio.ln xtsend.ln xtrec.ln crc.ln \
  951. X        nodelist.ln address.ln sprintfs.ln
  952. XCFILES    =    rfmail.c funcs.c rfnews.c rmail.c fpack.c funpack.c fcall.c \
  953. X                fio.c xtsend.c xtrec.c nodelist.c gethostname.c dateconv.c \
  954. X                address.c crc.c lintlib.c sprintfs.c \
  955. X        strempty.c listscan.c ftime.c
  956. XHFILES    =    fnet.h config.h fpack.h rmail.h fio.h crc.h hsu.h shuffle.h \
  957. X        sysexits.h nodelist.h fnews.h
  958. XOTHERFILES    =    README HISTORY INSTALL LICENCE NOTES PROBLEMS \
  959. X            TODO Alias fnews.cf notes de d fcaller Makefile \
  960. X            getdate.y
  961. XLIBS    =    -lPW -ldial
  962. XALL    =    funpack fcall fpack rfmail rfnews rmail hsu.h
  963. XOWNER    =    uucp
  964. XGROUP    =    mail
  965. X
  966. X.c.ln: $<
  967. X    lint -c $(LNFLAGS) $<
  968. X
  969. X.SUFFIXES: .ln
  970. X
  971. Xall:        ${ALL}
  972. X    touch all
  973. X
  974. Xgetdate.o: getdate.y
  975. X    @echo "expect 8 shift/reduce conflicts"
  976. X    yacc getdate.y
  977. X    mv y.tab.c getdate.c
  978. X    $(CC) $(CFLAGS) -c getdate.c
  979. X    -rm -f getdate.c
  980. X
  981. Xfunpack:    ${FUNPACK}
  982. X    cc ${LDFLAGS} -o funpack ${FUNPACK} ${LIBS}
  983. X    $(ENA) chown ${OWNER} funpack
  984. X    $(ENA) chgrp ${GROUP} funpack
  985. X    $(ENA) chmod 4711 funpack
  986. X
  987. Xrfmail:        ${RFMAIL}
  988. X    cc ${LDFLAGS} -o rfmail ${RFMAIL} ${LIBS}
  989. X    $(ENA) chown ${OWNER} rfmail
  990. X    $(ENA) chgrp ${GROUP} rfmail
  991. X    $(ENA) chmod 4711 rfmail
  992. X
  993. Xrfnews:        ${RFNEWS}
  994. X    cc ${LDFLAGS} -o rfnews ${RFNEWS} ${LIBS}
  995. X    $(ENA) chown ${OWNER} rfnews
  996. X    $(ENA) chgrp ${GROUP} rfnews
  997. X    $(ENA) chmod 4711 rfnews
  998. X
  999. Xfpack:        ${FPACK}
  1000. X    cc ${LDFLAGS} -o fpack ${FPACK} ${LIBS}
  1001. X    $(ENA) chown ${OWNER} fpack
  1002. X    $(ENA) chgrp ${GROUP} fpack
  1003. X    $(ENA) chmod 4711 fpack
  1004. X
  1005. Xfcall:        ${FCALL}
  1006. X    cc ${LDFLAGS} -o fcall ${FCALL} ${LIBS}
  1007. X    $(ENA) chown ${OWNER} fcall
  1008. X    $(ENA) chgrp ${GROUP} fcall
  1009. X    $(ENA) chmod 4711 fcall
  1010. X
  1011. Xrmail:        ${RMAIL}
  1012. X    cc ${LDFLAGS} -o rmail ${RMAIL} ${LIBS}
  1013. X
  1014. Xinstall:    all
  1015. X    @for i in ${ALL}; \
  1016. X    do \
  1017. X        echo "Moving $$i into ${LIBDIR} ... \c"; \
  1018. X        cp $$i ${LIBDIR}; \
  1019. X        $(ENA) chown ${OWNER} ${LIBDIR}/$$i; \
  1020. X        $(ENA) chgrp ${GROUP} ${LIBDIR}/$$i; \
  1021. X        $(ENA) chmod 4111 ${LIBDIR}/$$i; \
  1022. X        echo "done."; \
  1023. X    done
  1024. X
  1025. Xlintlib.ln:    lintlib.c
  1026. X    lint -c -x lintlib.c
  1027. X
  1028. Xlfunpack: $(LFUNPACK) lintlib.ln
  1029. X    lint $(LFUNPACK) lintlib.ln
  1030. X    touch lfunpack
  1031. X
  1032. Xlrmail: $(LRMAIL) lintlib.ln
  1033. X    lint $(LRMAIL) lintlib.ln
  1034. X    touch lrmail
  1035. X
  1036. Xlrfmail: $(LRFMAIL) lintlib.ln
  1037. X    lint $(LRFMAIL) lintlib.ln
  1038. X    touch lrfmail
  1039. X
  1040. Xlrfnews: $(LRFNEWS) lintlib.ln
  1041. X    lint $(LRFNEWS) lintlib.ln
  1042. X    touch lrfnews
  1043. X
  1044. Xlfpack: $(LFPACK) lintlib.ln
  1045. X    lint $(LFPACK) lintlib.ln
  1046. X    touch lfpack
  1047. X
  1048. Xlfcall: $(LFCALL) lintlib.ln
  1049. X    lint $(LFCALL) lintlib.ln
  1050. X    touch lfcall
  1051. X
  1052. Xlint:    lfunpack lrmail lrfmail lrfnews lfpack lfcall
  1053. X
  1054. Xtar:
  1055. X    tar cvf - $(OTHERFILES) $(CFILES) $(HFILES) | compress > fnet.tar.Z
  1056. X
  1057. Xinitsccs:
  1058. X    @if [ -d SCCS ];                        \
  1059. X    then                                \
  1060. X      echo "Directory SCCS/ already exist.";            \
  1061. X      exit 1;                            \
  1062. X    fi;                                \
  1063. X    echo "Creating directory SCCS/...";                \
  1064. X    mkdir SCCS;                            \
  1065. X    for file in ${SCCS};                        \
  1066. X    do                                \
  1067. X      echo "Creating SCCS/s.$$file...";                \
  1068. X      admin -i$$file SCCS/s.$$file;                    \
  1069. X      if [ $$? -eq 0 ];                        \
  1070. X        then                            \
  1071. X          echo "Getting file SCCS/s.$$file...";            \
  1072. X          rm -f $$file;                        \
  1073. X          get SCCS/s.$$file;                    \
  1074. X        fi;                                \
  1075. X    done
  1076. X
  1077. Xedit:
  1078. X    get -e $(OTHERFILES) $(CFILES) $(HFILES)
  1079. X
  1080. Xlook:
  1081. X    get $(OTHERFILES) $(CFILES) $(HFILES)
  1082. X
  1083. Xdelta:
  1084. X    delta $(OTHERFILES) $(CFILES) $(HFILES)
  1085. X
  1086. Xshar:
  1087. X    shar -v -c -l60 -ofnetdist. $(OTHERFILES) ${CFILES} ${HFILES}
  1088. X
  1089. Xclean:
  1090. X    -rm lfunpack lrmail lrfmail lrfnews lfpack lfcall
  1091. X    -rm funpack rfmail rfnews fpack fcall rmail
  1092. X    -rm *.ln *.o .make .funpack .lint log loki
  1093. X    -rm *.idx
  1094. X
  1095. Xdepend:
  1096. X    @echo '/^# DO NOT/+1,$$d\nw\nq' | ed - Makefile; \
  1097. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile; \
  1098. X    for i in ${CFILES} ; \
  1099. X    do \
  1100. X        if [ -r $$i ]; \
  1101. X        then \
  1102. X            echo "Finding dependences for $$i ... \c"; \
  1103. X            for j in `grep '^#[     ]*include[     ]*"[^"]*"' < $$i | \
  1104. X                sed 's/^#[     ]*include[     ]*"\([^"]*\)".*/\1/'`; \
  1105. X            do \
  1106. X                if [ -r $$j ]; \
  1107. X                then \
  1108. X                    echo "`basename $$i .c`.o: $$j" >> Makefile; \
  1109. X                    echo "`basename $$i .c`.ln: $$j" >> Makefile; \
  1110. X                else \
  1111. X                    echo "`basename $$i .c`.o: ${HEADERS}/$$j" \
  1112. X                            >> Makefile; \
  1113. X                    echo "`basename $$i .c`.ln: ${HEADERS}/$$j" \
  1114. X                        >> Makefile; \
  1115. X                fi; \
  1116. X            done; \
  1117. X            echo "done."; \
  1118. X        else \
  1119. X            echo "Can not open $$i." 1>&2; \
  1120. X        fi; \
  1121. X    done; \
  1122. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile; \
  1123. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile; \
  1124. X    echo '# see make depend above' >> Makefile
  1125. X
  1126. X# DO NOT DELETE THIS LINE -- make depend uses it
  1127. X# DEPENDENCIES MUST END AT END OF FILE
  1128. Xrfmail.o: hsu.h
  1129. Xrfmail.ln: hsu.h
  1130. Xrfmail.o: config.h
  1131. Xrfmail.ln: config.h
  1132. Xrfmail.o: fnet.h
  1133. Xrfmail.ln: fnet.h
  1134. Xrfmail.o: nodelist.h
  1135. Xrfmail.ln: nodelist.h
  1136. Xfuncs.o: hsu.h
  1137. Xfuncs.ln: hsu.h
  1138. Xfuncs.o: config.h
  1139. Xfuncs.ln: config.h
  1140. Xfuncs.o: fnet.h
  1141. Xfuncs.ln: fnet.h
  1142. Xfuncs.o: sysexits.h
  1143. Xfuncs.ln: sysexits.h
  1144. Xfuncs.o: nodelist.h
  1145. Xfuncs.ln: nodelist.h
  1146. Xfuncs.o: shuffle.h
  1147. Xfuncs.ln: shuffle.h
  1148. Xrfnews.o: hsu.h
  1149. Xrfnews.ln: hsu.h
  1150. Xrfnews.o: config.h
  1151. Xrfnews.ln: config.h
  1152. Xrfnews.o: fnet.h
  1153. Xrfnews.ln: fnet.h
  1154. Xrfnews.o: fnews.h
  1155. Xrfnews.ln: fnews.h
  1156. Xrfnews.o: nodelist.h
  1157. Xrfnews.ln: nodelist.h
  1158. Xrmail.o: hsu.h
  1159. Xrmail.ln: hsu.h
  1160. Xrmail.o: rmail.h
  1161. Xrmail.ln: rmail.h
  1162. Xrmail.o: config.h
  1163. Xrmail.ln: config.h
  1164. Xrmail.o: sysexits.h
  1165. Xrmail.ln: sysexits.h
  1166. Xrmail.o: nodelist.h
  1167. Xrmail.ln: nodelist.h
  1168. Xrmail.o: fnet.h
  1169. Xrmail.ln: fnet.h
  1170. Xfpack.o: hsu.h
  1171. Xfpack.ln: hsu.h
  1172. Xfpack.o: config.h
  1173. Xfpack.ln: config.h
  1174. Xfpack.o: fnet.h
  1175. Xfpack.ln: fnet.h
  1176. Xfpack.o: fpack.h
  1177. Xfpack.ln: fpack.h
  1178. Xfpack.o: nodelist.h
  1179. Xfpack.ln: nodelist.h
  1180. Xfunpack.o: hsu.h
  1181. Xfunpack.ln: hsu.h
  1182. Xfunpack.o: config.h
  1183. Xfunpack.ln: config.h
  1184. Xfunpack.o: fnet.h
  1185. Xfunpack.ln: fnet.h
  1186. Xfunpack.o: fpack.h
  1187. Xfunpack.ln: fpack.h
  1188. Xfunpack.o: nodelist.h
  1189. Xfunpack.ln: nodelist.h
  1190. Xfunpack.o: sysexits.h
  1191. Xfunpack.ln: sysexits.h
  1192. Xfunpack.o: fnews.h
  1193. Xfunpack.ln: fnews.h
  1194. Xfcall.o: hsu.h
  1195. Xfcall.ln: hsu.h
  1196. Xfcall.o: config.h
  1197. Xfcall.ln: config.h
  1198. Xfcall.o: fnet.h
  1199. Xfcall.ln: fnet.h
  1200. Xfcall.o: fio.h
  1201. Xfcall.ln: fio.h
  1202. Xfcall.o: nodelist.h
  1203. Xfcall.ln: nodelist.h
  1204. Xfio.o: fnet.h
  1205. Xfio.ln: fnet.h
  1206. Xfio.o: fio.h
  1207. Xfio.ln: fio.h
  1208. Xxtsend.o: fnet.h
  1209. Xxtsend.ln: fnet.h
  1210. Xxtsend.o: fio.h
  1211. Xxtsend.ln: fio.h
  1212. Xxtsend.o: crc.h
  1213. Xxtsend.ln: crc.h
  1214. Xxtrec.o: hsu.h
  1215. Xxtrec.ln: hsu.h
  1216. Xxtrec.o: fnet.h
  1217. Xxtrec.ln: fnet.h
  1218. Xxtrec.o: fio.h
  1219. Xxtrec.ln: fio.h
  1220. Xxtrec.o: crc.h
  1221. Xxtrec.ln: crc.h
  1222. Xnodelist.o: hsu.h
  1223. Xnodelist.ln: hsu.h
  1224. Xnodelist.o: config.h
  1225. Xnodelist.ln: config.h
  1226. Xnodelist.o: fnet.h
  1227. Xnodelist.ln: fnet.h
  1228. Xnodelist.o: nodelist.h
  1229. Xnodelist.ln: nodelist.h
  1230. Xdateconv.o: fnet.h
  1231. Xdateconv.ln: fnet.h
  1232. Xaddress.o: hsu.h
  1233. Xaddress.ln: hsu.h
  1234. Xaddress.o: config.h
  1235. Xaddress.ln: config.h
  1236. Xaddress.o: fnet.h
  1237. Xaddress.ln: fnet.h
  1238. Xaddress.o: nodelist.h
  1239. Xaddress.ln: nodelist.h
  1240. Xaddress.o: shuffle.h
  1241. Xaddress.ln: shuffle.h
  1242. Xsprintfs.o: hsu.h
  1243. Xsprintfs.ln: hsu.h
  1244. Xlintlib.o: hsu.h
  1245. Xlintlib.ln: hsu.h
  1246. Xlintlib.o: config.h
  1247. Xlintlib.ln: config.h
  1248. Xgetdate.y.o: config.h
  1249. Xgetdate.y.ln: config.h
  1250. Xsprintfs.o: hsu.h
  1251. Xsprintfs.ln: hsu.h
  1252. Xstrempty.o: hsu.h
  1253. Xstrempty.ln: hsu.h
  1254. X# DEPENDENCIES MUST END AT END OF FILE
  1255. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  1256. X# see make depend above
  1257. SHAR_EOF
  1258. chmod 0644 Makefile || echo "restore of Makefile fails"
  1259. echo "x - extracting getdate.y (Text)"
  1260. sed 's/^X//' << 'SHAR_EOF' > getdate.y &&
  1261. X%token ID MONTH DAY MERIDIAN NUMBER UNIT MUNIT SUNIT ZONE DAYZONE AGO
  1262. X%{
  1263. X    /*     Originally from: Steven M. Bellovin (unc!smb)    */
  1264. X    /*    Dept. of Computer Science            */
  1265. X    /*    University of North Carolina at Chapel Hill    */
  1266. X    /*    @(#)getdate.y    2.17    11/30/87            */
  1267. X
  1268. X#include <sys/types.h>
  1269. X#include "config.h"
  1270. X#ifdef NEEDED
  1271. X/* This is now in config.h */
  1272. X#ifdef USG
  1273. Xstruct timeb
  1274. X{
  1275. X    time_t    time;
  1276. X    unsigned short millitm;
  1277. X    short    timezone;
  1278. X    short    dstflag;
  1279. X};
  1280. X#else
  1281. X#include <sys/timeb.h>
  1282. X#endif
  1283. X#include <ctype.h>
  1284. X#endif
  1285. X
  1286. X#if defined(BSD4_2) || defined (BSD4_1C)
  1287. X#include <sys/time.h>
  1288. X#else /* sane */
  1289. X#include <time.h>
  1290. X#endif /* sane */
  1291. X
  1292. X#define    NULL    0
  1293. X#define daysec (24L*60L*60L)
  1294. X    static int timeflag, zoneflag, dateflag, dayflag, relflag;
  1295. X    static time_t relsec, relmonth;
  1296. X    static int hh, mm, ss, merid, daylight;
  1297. X    static int dayord, dayreq;
  1298. X    static int month, day, year;
  1299. X    static int ourzone;
  1300. X#define AM 1
  1301. X#define PM 2
  1302. X#define DAYLIGHT 1
  1303. X#define STANDARD 2
  1304. X#define MAYBE    3
  1305. X%}
  1306. X
  1307. X%%
  1308. Xtimedate:         /* empty */
  1309. X    | timedate item;
  1310. X
  1311. Xitem:    tspec =
  1312. X        {timeflag++;}
  1313. X    | zone =
  1314. X        {zoneflag++;}
  1315. X    | dtspec =
  1316. X        {dateflag++;}
  1317. X    | dyspec =
  1318. X        {dayflag++;}
  1319. X    | rspec =
  1320. X        {relflag++;}
  1321. X    | nspec;
  1322. X
  1323. Xnspec:    NUMBER =
  1324. X        {if (timeflag && dateflag && !relflag) year = $1;
  1325. X        else {timeflag++;hh = $1/100;mm = $1%100;ss = 0;merid = 24;}};
  1326. X
  1327. Xtspec:    NUMBER MERIDIAN =
  1328. X        {hh = $1; mm = 0; ss = 0; merid = $2;}
  1329. X    | NUMBER ':' NUMBER =
  1330. X        {hh = $1; mm = $3; merid = 24;}
  1331. X    | NUMBER ':' NUMBER MERIDIAN =
  1332. X        {hh = $1; mm = $3; merid = $4;}
  1333. X    | NUMBER ':' NUMBER NUMBER =
  1334. X        {hh = $1; mm = $3; merid = 24;
  1335. X        daylight = STANDARD; ourzone = -($4%100 + 60*($4/100));}
  1336. X    | NUMBER ':' NUMBER ':' NUMBER =
  1337. X        {hh = $1; mm = $3; ss = $5; merid = 24;}
  1338. X    | NUMBER ':' NUMBER ':' NUMBER MERIDIAN =
  1339. X        {hh = $1; mm = $3; ss = $5; merid = $6;}
  1340. X    | NUMBER ':' NUMBER ':' NUMBER NUMBER =
  1341. X        {hh = $1; mm = $3; ss = $5; merid = 24;
  1342. X        daylight = STANDARD; ourzone = -($6%100 + 60*($6/100));};
  1343. X
  1344. Xzone:    ZONE =
  1345. X        {ourzone = $1; daylight = STANDARD;}
  1346. X    | DAYZONE =
  1347. X        {ourzone = $1; daylight = DAYLIGHT;};
  1348. X
  1349. Xdyspec:    DAY =
  1350. X        {dayord = 1; dayreq = $1;}
  1351. X    | DAY ',' =
  1352. X        {dayord = 1; dayreq = $1;}
  1353. X    | NUMBER DAY =
  1354. X        {dayord = $1; dayreq = $2;};
  1355. X
  1356. Xdtspec:    NUMBER '/' NUMBER =
  1357. X        {month = $1; day = $3;}
  1358. X    | NUMBER '/' NUMBER '/' NUMBER =
  1359. X        {month = $1; day = $3; year = $5;}
  1360. X    | MONTH NUMBER =
  1361. X        {month = $1; day = $2;}
  1362. X    | MONTH NUMBER ',' NUMBER =
  1363. X        {month = $1; day = $2; year = $4;}
  1364. X    | NUMBER MONTH =
  1365. X        {month = $2; day = $1;}
  1366. X    | NUMBER MONTH NUMBER =
  1367. X        {month = $2; day = $1; year = $3;};
  1368. X
  1369. X
  1370. Xrspec:    NUMBER UNIT =
  1371. X        {relsec +=  60L * $1 * $2;}
  1372. X    | NUMBER MUNIT =
  1373. X        {relmonth += $1 * $2;}
  1374. X    | NUMBER SUNIT =
  1375. X        {relsec += $1;}
  1376. X    | UNIT =
  1377. X        {relsec +=  60L * $1;}
  1378. X    | MUNIT =
  1379. X        {relmonth += $1;}
  1380. X    | SUNIT =
  1381. X        {relsec++;}
  1382. X    | rspec AGO =
  1383. X        {relsec = -relsec; relmonth = -relmonth;};
  1384. X%%
  1385. X
  1386. Xstatic int mdays[12] =
  1387. X    {31, 0, 31,  30, 31, 30,  31, 31, 30,  31, 30, 31};
  1388. X#define epoch 1970
  1389. X
  1390. Xextern struct tm *localtime();
  1391. X
  1392. Xtime_t
  1393. Xdateconv(mm, dd, yy, h, m, s, mer, zone, dayflag)
  1394. Xint mm, dd, yy, h, m, s, mer, zone, dayflag;
  1395. X{
  1396. X    time_t tod, jdate;
  1397. X    register int i;
  1398. X    time_t timeconv();
  1399. X
  1400. X    if (yy < 0) yy = -yy;
  1401. X    if (yy < 100) yy += 1900;
  1402. X    mdays[1] = 28 + (yy%4 == 0 && (yy%100 != 0 || yy%400 == 0));
  1403. X    if (yy < epoch || yy > 1999 || mm < 1 || mm > 12 ||
  1404. X        dd < 1 || dd > mdays[--mm]) return (-1);
  1405. X    jdate = dd-1;
  1406. X        for (i=0; i<mm; i++) jdate += mdays[i];
  1407. X    for (i = epoch; i < yy; i++) jdate += 365 + (i%4 == 0);
  1408. X    jdate *= daysec;
  1409. X    jdate += zone * 60L;
  1410. X    if ((tod = timeconv(h, m, s, mer)) < 0) return (-1);
  1411. X    jdate += tod;
  1412. X    if (dayflag==DAYLIGHT || (dayflag==MAYBE&&localtime(&jdate)->tm_isdst))
  1413. X        jdate += -1*60*60;
  1414. X    return (jdate);
  1415. X}
  1416. X
  1417. Xtime_t
  1418. Xdayconv(ord, day, now)
  1419. Xint ord, day; time_t now;
  1420. X{
  1421. X    register struct tm *loctime;
  1422. X    time_t tod;
  1423. X    time_t daylcorr();
  1424. X
  1425. X    tod = now;
  1426. X    loctime = localtime(&tod);
  1427. X    tod += daysec * ((day - loctime->tm_wday + 7) % 7);
  1428. X    tod += 7*daysec*(ord<=0?ord:ord-1);
  1429. X    return daylcorr(tod, now);
  1430. X}
  1431. X
  1432. Xtime_t
  1433. Xtimeconv(hh, mm, ss, mer)
  1434. Xregister int hh, mm, ss, mer;
  1435. X{
  1436. X    if (mm < 0 || mm > 59 || ss < 0 || ss > 59) return (-1);
  1437. X    switch (mer) {
  1438. X        case AM: if (hh < 1 || hh > 12) return(-1);
  1439. X             return (60L * ((hh%12)*60L + mm)+ss);
  1440. X        case PM: if (hh < 1 || hh > 12) return(-1);
  1441. X             return (60L * ((hh%12 +12)*60L + mm)+ss);
  1442. X        case 24: if (hh < 0 || hh > 23) return (-1);
  1443. X             return (60L * (hh*60L + mm)+ss);
  1444. X        default: return (-1);
  1445. X    }
  1446. X}
  1447. Xtime_t
  1448. Xmonthadd(sdate, relmonth)
  1449. Xtime_t sdate, relmonth;
  1450. X{
  1451. X    struct tm *ltime;
  1452. X    time_t dateconv();
  1453. X    time_t daylcorr();
  1454. X    int mm, yy;
  1455. X
  1456. X    if (relmonth == 0) return 0;
  1457. X    ltime = localtime(&sdate);
  1458. X    mm = 12*ltime->tm_year + ltime->tm_mon + relmonth;
  1459. X    yy = mm/12;
  1460. X    mm = mm%12 + 1;
  1461. X    return daylcorr(dateconv(mm, ltime->tm_mday, yy, ltime->tm_hour,
  1462. X        ltime->tm_min, ltime->tm_sec, 24, ourzone, MAYBE), sdate);
  1463. X}
  1464. X
  1465. Xtime_t
  1466. Xdaylcorr(future, now)
  1467. Xtime_t future, now;
  1468. X{
  1469. X    int fdayl, nowdayl;
  1470. X
  1471. X    nowdayl = (localtime(&now)->tm_hour+1) % 24;
  1472. X    fdayl = (localtime(&future)->tm_hour+1) % 24;
  1473. X    return (future-now) + 60L*60L*(nowdayl-fdayl);
  1474. X}
  1475. X
  1476. Xstatic char *lptr;
  1477. X
  1478. Xyylex()
  1479. X{
  1480. X    extern int yylval;
  1481. X    int sign;
  1482. X    register char c;
  1483. X    register char *p;
  1484. X    char idbuf[20];
  1485. X    int pcnt;
  1486. X
  1487. X    for (;;) {
  1488. X        while (isspace(*lptr))
  1489. X            lptr++;
  1490. X
  1491. X        if (isdigit(c = *lptr) || c == '-' || c == '+') {
  1492. X            if (c== '-' || c == '+') {
  1493. X                if (c=='-') sign = -1;
  1494. X                else sign = 1;
  1495. X                if (!isdigit(*++lptr)) {
  1496. X                    /* yylval = sign; return (NUMBER); */
  1497. X                    return yylex();    /* skip the '-' sign */
  1498. X                }
  1499. X            } else sign = 1;
  1500. X            yylval = 0;
  1501. X            while (isdigit(c = *lptr++))
  1502. X                yylval = 10*yylval + c - '0';
  1503. X            yylval *= sign;
  1504. X            lptr--;
  1505. X            return (NUMBER);
  1506. X
  1507. X        } else if (isalpha(c)) {
  1508. X            p = idbuf;
  1509. X            while (isalpha(c = *lptr++) || c=='.')
  1510. X                if (p < &idbuf[sizeof(idbuf)-1]) *p++ = c;
  1511. X            *p = '\0';
  1512. X            lptr--;
  1513. X            return (lookup(idbuf));
  1514. X        }
  1515. X
  1516. X        else if (c == '(') {
  1517. X            pcnt = 0;
  1518. X            do {
  1519. X                c = *lptr++;
  1520. X                if (c == '\0') return(c);
  1521. X                else if (c == '(') pcnt++;
  1522. X                else if (c == ')') pcnt--;
  1523. X            } while (pcnt > 0);
  1524. X        }
  1525. X
  1526. X        else return (*lptr++);
  1527. X    }
  1528. X}
  1529. X
  1530. Xstruct table {
  1531. X    char *name;
  1532. X    int type, value;
  1533. X};
  1534. X
  1535. Xstruct table mdtab[] = {
  1536. X    {"january", MONTH, 1},
  1537. X    {"february", MONTH, 2},
  1538. X    {"march", MONTH, 3},
  1539. X    {"april", MONTH, 4},
  1540. X    {"may", MONTH, 5},
  1541. X    {"june", MONTH, 6},
  1542. X    {"july", MONTH, 7},
  1543. X    {"august", MONTH, 8},
  1544. X    {"september", MONTH, 9},
  1545. X    {"sept", MONTH, 9},
  1546. X    {"october", MONTH, 10},
  1547. X    {"november", MONTH, 11},
  1548. X    {"december", MONTH, 12},
  1549. X
  1550. X    {"sunday", DAY, 0},
  1551. X    {"monday", DAY, 1},
  1552. X    {"tuesday", DAY, 2},
  1553. X    {"tues", DAY, 2},
  1554. X    {"wednesday", DAY, 3},
  1555. X    {"wednes", DAY, 3},
  1556. X    {"thursday", DAY, 4},
  1557. X    {"thur", DAY, 4},
  1558. X    {"thurs", DAY, 4},
  1559. X    {"friday", DAY, 5},
  1560. X    {"saturday", DAY, 6},
  1561. X    {0, 0, 0}};
  1562. X
  1563. X#define HRS *60
  1564. X#define HALFHR 30
  1565. Xstruct table mztab[] = {
  1566. X    {"a.m.", MERIDIAN, AM},
  1567. X    {"am", MERIDIAN, AM},
  1568. X    {"p.m.", MERIDIAN, PM},
  1569. X    {"pm", MERIDIAN, PM},
  1570. X    {"nst", ZONE, 3 HRS + HALFHR},        /* Newfoundland */
  1571. X    {"n.s.t.", ZONE, 3 HRS + HALFHR},
  1572. X    {"ast", ZONE, 4 HRS},        /* Atlantic */
  1573. X    {"a.s.t.", ZONE, 4 HRS},
  1574. X    {"adt", DAYZONE, 4 HRS},
  1575. X    {"a.d.t.", DAYZONE, 4 HRS},
  1576. X    {"est", ZONE, 5 HRS},        /* Eastern */
  1577. X    {"e.s.t.", ZONE, 5 HRS},
  1578. X    {"edt", DAYZONE, 5 HRS},
  1579. X    {"e.d.t.", DAYZONE, 5 HRS},
  1580. X    {"cst", ZONE, 6 HRS},        /* Central */
  1581. X    {"c.s.t.", ZONE, 6 HRS},
  1582. X    {"cdt", DAYZONE, 6 HRS},
  1583. X    {"c.d.t.", DAYZONE, 6 HRS},
  1584. X    {"mst", ZONE, 7 HRS},        /* Mountain */
  1585. X    {"m.s.t.", ZONE, 7 HRS},
  1586. X    {"mdt", DAYZONE, 7 HRS},
  1587. X    {"m.d.t.", DAYZONE, 7 HRS},
  1588. X    {"pst", ZONE, 8 HRS},        /* Pacific */
  1589. X    {"p.s.t.", ZONE, 8 HRS},
  1590. X    {"pdt", DAYZONE, 8 HRS},
  1591. X    {"p.d.t.", DAYZONE, 8 HRS},
  1592. X    {"yst", ZONE, 9 HRS},        /* Yukon */
  1593. X    {"y.s.t.", ZONE, 9 HRS},
  1594. X    {"ydt", DAYZONE, 9 HRS},
  1595. X    {"y.d.t.", DAYZONE, 9 HRS},
  1596. X    {"hst", ZONE, 10 HRS},        /* Hawaii */
  1597. X    {"h.s.t.", ZONE, 10 HRS},
  1598. X    {"hdt", DAYZONE, 10 HRS},
  1599. X    {"h.d.t.", DAYZONE, 10 HRS},
  1600. X
  1601. X    {"gmt", ZONE, 0 HRS},
  1602. X    {"g.m.t.", ZONE, 0 HRS},
  1603. X    {"bst", DAYZONE, 0 HRS},        /* British Summer Time */
  1604. X    {"b.s.t.", DAYZONE, 0 HRS},
  1605. X    {"eet", ZONE, 0 HRS},        /* European Eastern Time */
  1606. X    {"e.e.t.", ZONE, 0 HRS},
  1607. X    {"eest", DAYZONE, 0 HRS},    /* European Eastern Summer Time */
  1608. X    {"e.e.s.t.", DAYZONE, 0 HRS},
  1609. X    {"met", ZONE, -1 HRS},        /* Middle European Time */
  1610. X    {"m.e.t.", ZONE, -1 HRS},
  1611. X    {"mest", DAYZONE, -1 HRS},    /* Middle European Summer Time */
  1612. X    {"m.e.s.t.", DAYZONE, -1 HRS},
  1613. X    {"wet", ZONE, -2 HRS },        /* Western European Time */
  1614. X    {"w.e.t.", ZONE, -2 HRS },
  1615. X    {"west", DAYZONE, -2 HRS},    /* Western European Summer Time */
  1616. X    {"w.e.s.t.", DAYZONE, -2 HRS},
  1617. X
  1618. X    {"jst", ZONE, -9 HRS},        /* Japan Standard Time */
  1619. X    {"j.s.t.", ZONE, -9 HRS},    /* Japan Standard Time */
  1620. X                    /* No daylight savings time */
  1621. X
  1622. X    {"aest", ZONE, -10 HRS},    /* Australian Eastern Time */
  1623. X    {"a.e.s.t.", ZONE, -10 HRS},
  1624. X    {"aesst", DAYZONE, -10 HRS},    /* Australian Eastern Summer Time */
  1625. X    {"a.e.s.s.t.", DAYZONE, -10 HRS},
  1626. X    {"acst", ZONE, -(9 HRS + HALFHR)},    /* Australian Central Time */
  1627. X    {"a.c.s.t.", ZONE, -(9 HRS + HALFHR)},
  1628. X    {"acsst", DAYZONE, -(9 HRS + HALFHR)},    /* Australian Central Summer */
  1629. X    {"a.c.s.s.t.", DAYZONE, -(9 HRS + HALFHR)},
  1630. X    {"awst", ZONE, -8 HRS},        /* Australian Western Time */
  1631. X    {"a.w.s.t.", ZONE, -8 HRS},    /* (no daylight time there, I'm told */
  1632. X    {0, 0, 0}};
  1633. X
  1634. Xstruct table unittb[] = {
  1635. X    {"year", MUNIT, 12},
  1636. X    {"month", MUNIT, 1},
  1637. X    {"fortnight", UNIT, 14*24*60},
  1638. X    {"week", UNIT, 7*24*60},
  1639. X    {"day", UNIT, 1*24*60},
  1640. X    {"hour", UNIT, 60},
  1641. X    {"minute", UNIT, 1},
  1642. X    {"min", UNIT, 1},
  1643. X    {"second", SUNIT, 1},
  1644. X    {"sec", SUNIT, 1},
  1645. X    {0, 0, 0}};
  1646. X
  1647. Xstruct table othertb[] = {
  1648. X    {"tomorrow", UNIT, 1*24*60},
  1649. X    {"yesterday", UNIT, -1*24*60},
  1650. X    {"today", UNIT, 0},
  1651. X    {"now", UNIT, 0},
  1652. X    {"last", NUMBER, -1},
  1653. X    {"this", UNIT, 0},
  1654. X    {"next", NUMBER, 2},
  1655. X    {"first", NUMBER, 1},
  1656. X    /* {"second", NUMBER, 2}, */
  1657. X    {"third", NUMBER, 3},
  1658. X    {"fourth", NUMBER, 4},
  1659. X    {"fifth", NUMBER, 5},
  1660. X    {"sixth", NUMBER, 6},
  1661. X    {"seventh", NUMBER, 7},
  1662. X    {"eigth", NUMBER, 8},
  1663. X    {"ninth", NUMBER, 9},
  1664. X    {"tenth", NUMBER, 10},
  1665. X    {"eleventh", NUMBER, 11},
  1666. X    {"twelfth", NUMBER, 12},
  1667. X    {"ago", AGO, 1},
  1668. X    {0, 0, 0}};
  1669. X
  1670. Xstruct table milzone[] = {
  1671. X    {"a", ZONE, 1 HRS},
  1672. X    {"b", ZONE, 2 HRS},
  1673. X    {"c", ZONE, 3 HRS},
  1674. X    {"d", ZONE, 4 HRS},
  1675. X    {"e", ZONE, 5 HRS},
  1676. X    {"f", ZONE, 6 HRS},
  1677. X    {"g", ZONE, 7 HRS},
  1678. X    {"h", ZONE, 8 HRS},
  1679. X    {"i", ZONE, 9 HRS},
  1680. X    {"k", ZONE, 10 HRS},
  1681. X    {"l", ZONE, 11 HRS},
  1682. X    {"m", ZONE, 12 HRS},
  1683. X    {"n", ZONE, -1 HRS},
  1684. X    {"o", ZONE, -2 HRS},
  1685. X    {"p", ZONE, -3 HRS},
  1686. X    {"q", ZONE, -4 HRS},
  1687. X    {"r", ZONE, -5 HRS},
  1688. X    {"s", ZONE, -6 HRS},
  1689. X    {"t", ZONE, -7 HRS},
  1690. X    {"u", ZONE, -8 HRS},
  1691. X    {"v", ZONE, -9 HRS},
  1692. X    {"w", ZONE, -10 HRS},
  1693. X    {"x", ZONE, -11 HRS},
  1694. X    {"y", ZONE, -12 HRS},
  1695. X    {"z", ZONE, 0 HRS},
  1696. X    {0, 0, 0}};
  1697. X
  1698. Xlookup(id)
  1699. Xchar *id;
  1700. X{
  1701. X#define gotit (yylval=i->value,  i->type)
  1702. X
  1703. X    char idvar[128];
  1704. X    register char *j, *k;
  1705. X    register struct table *i;
  1706. X    int abbrev;
  1707. X
  1708. X    (void) strcpy(idvar, id);
  1709. X    j = idvar;
  1710. X    k = id - 1;
  1711. X    while (*++k)
  1712. X        *j++ = isupper(*k) ? tolower(*k) : *k;
  1713. X    *j = '\0';
  1714. X
  1715. X    if (strlen(idvar) == 3)
  1716. X        abbrev = 1;
  1717. X    else
  1718. X        if (strlen(idvar) == 4 && idvar[3] == '.') {
  1719. X            abbrev = 1;
  1720. X            idvar[3] = '\0';
  1721. X        }
  1722. X    else
  1723. X        abbrev = 0;
  1724. X
  1725. X    for (i = mdtab; i->name; i++) {
  1726. X        k = idvar;
  1727. X        for (j = i->name; *j++ == *k++;) {
  1728. X            if (abbrev && j == i->name+3)
  1729. X                return gotit;
  1730. X            if (j[-1] == 0)
  1731. X                return gotit;
  1732. X        }
  1733. X    }
  1734. X
  1735. X    for (i = mztab; i->name; i++)
  1736. X        if (strcmp(i->name, idvar) == 0)
  1737. X            return gotit;
  1738. X
  1739. X    for (i=mztab; i->name; i++)
  1740. X        if (strcmp(i->name, idvar) == 0)
  1741. X            return gotit;
  1742. X
  1743. X    for (i=unittb; i->name; i++)
  1744. X        if (strcmp(i->name, idvar) == 0)
  1745. X            return gotit;
  1746. X
  1747. X    if (idvar[strlen(idvar)-1] == 's')
  1748. X        idvar[strlen(idvar)-1] = '\0';
  1749. X
  1750. X    for (i=unittb; i->name; i++)
  1751. X        if (strcmp(i->name, idvar) == 0)
  1752. X            return gotit;
  1753. X
  1754. X    for (i = othertb; i->name; i++)
  1755. X        if (strcmp(i->name, idvar) == 0)
  1756. X            return gotit;
  1757. X
  1758. X    if (strlen(idvar) == 1 && isalpha(*idvar)) {
  1759. X        for (i = milzone; i->name; i++)
  1760. X            if (strcmp(i->name, idvar) == 0)
  1761. X                return gotit;
  1762. X    }
  1763. X
  1764. X    return ID;
  1765. X}
  1766. X
  1767. Xtime_t
  1768. Xgetdate(p, now)
  1769. Xchar *p;
  1770. Xstruct timeb *now;
  1771. X{
  1772. X#define mcheck(f)    if (f>1) err++
  1773. X    time_t monthadd();
  1774. X    int err;
  1775. X    struct tm *lt;
  1776. X    struct timeb ftz;
  1777. X
  1778. X    time_t sdate, tod;
  1779. X
  1780. X    lptr = p;
  1781. X    if (now == ((struct timeb *) NULL)) {
  1782. X        now = &ftz;
  1783. X        ftime(&ftz);
  1784. X    }
  1785. X    lt = localtime(&now->time);
  1786. X    year = lt->tm_year;
  1787. X    month = lt->tm_mon+1;
  1788. X    day = lt->tm_mday;
  1789. X    relsec = 0; relmonth = 0;
  1790. X    timeflag=zoneflag=dateflag=dayflag=relflag=0;
  1791. X    ourzone = now->timezone;
  1792. X    daylight = MAYBE;
  1793. X    hh = mm = ss = 0;
  1794. X    merid = 24;
  1795. X
  1796. X    if (err = yyparse()) return (-1);
  1797. X
  1798. X    mcheck(timeflag);
  1799. X    mcheck(zoneflag);
  1800. X    mcheck(dateflag);
  1801. X    mcheck(dayflag);
  1802. X
  1803. X    if (err) return (-1);
  1804. X    if (dateflag || timeflag || dayflag) {
  1805. X        sdate = dateconv(month,day,year,hh,mm,ss,merid,ourzone,daylight);
  1806. X        if (sdate < 0) return -1;
  1807. X    }
  1808. X    else {
  1809. X        sdate = now->time;
  1810. X        if (relflag == 0)
  1811. X            sdate -= (lt->tm_sec + lt->tm_min*60 +
  1812. X                lt->tm_hour*(60L*60L));
  1813. X    }
  1814. X
  1815. X    sdate += relsec;
  1816. X    sdate += monthadd(sdate, relmonth);
  1817. X
  1818. X    if (dayflag && !dateflag) {
  1819. X        tod = dayconv(dayord, dayreq, sdate);
  1820. X        sdate += tod;
  1821. X    }
  1822. X
  1823. X    /*
  1824. X    ** Have to do *something* with a legitimate -1 so it's distinguishable
  1825. X    ** from the error return value.  (Alternately could set errno on error.)
  1826. X    */
  1827. X    return (sdate == -1) ? 0 : sdate;
  1828. X}
  1829. X
  1830. Xyyerror(s) char *s;
  1831. X{}
  1832. SHAR_EOF
  1833. chmod 0644 getdate.y || echo "restore of getdate.y fails"
  1834. echo "x - extracting rfmail.c (Text)"
  1835. sed 's/^X//' << 'SHAR_EOF' > rfmail.c &&
  1836. X#ifndef lint
  1837. Xstatic char *sccsid = "@(#)%M%  %I%  Teemu Torma %H%";
  1838. X#endif
  1839. X
  1840. X/* Read mail from standard input and put it into spool-directory.
  1841. X   Usually this program is executed by our rmail, but it can be
  1842. X   excuted manually or put as external fidomailer. If our rmail is
  1843. X   not used (or some other modified rmail), mail from other UUCP
  1844. X   node can not be sent to fidonet, because (normally) the other
  1845. X   node sends mail in this site by using rmail.
  1846. X
  1847. X   @(#)Copyright (c) 1987 by Teemu Torma
  1848. X
  1849. X   Permission is given to distribute this program and alter this code as
  1850. X   needed to adapt it to forign systems provided that this header is
  1851. X   included and that the original author's name is preserved. */
  1852. X
  1853. X#include <stdio.h>
  1854. X#include <string.h>
  1855. X#include <unistd.h>
  1856. X#include <ctype.h>
  1857. X#include <pwd.h>
  1858. X#include <sys/types.h>
  1859. X#include <time.h>
  1860. X#include <varargs.h>
  1861. X#include "hsu.h"
  1862. X#include "config.h"
  1863. X#include "fnet.h"
  1864. X#include "nodelist.h"
  1865. X
  1866. Xextern struct passwd *getpwuid();
  1867. Xextern char *mktemp();
  1868. Xextern int getopt();
  1869. Xextern char *optarg;
  1870. Xextern int optind;
  1871. Xextern void exit();
  1872. Xextern char *spoolfile(), *basename();
  1873. Xextern char *regex();
  1874. Xextern time_t time();
  1875. Xextern FILE *popen();
  1876. Xextern int errno;
  1877. Xextern char *sys_errlist[];
  1878. X
  1879. X/* verbosity */
  1880. Xint verbose = INIT_VERBOSE;
  1881. X
  1882. X/* non-private mail */
  1883. Xbool public = False;
  1884. X
  1885. X/* News-article */
  1886. Xint newsmode = FALSE;
  1887. X
  1888. X/* version of rfmail */
  1889. Xchar *version = "%I%";
  1890. X
  1891. X/* Our net/node information */
  1892. XNode this;
  1893. X
  1894. X/* Extract address from Reply-To or From field. Possible formats are:
  1895. X   - Full Name <address>
  1896. X   - address (Full Name)
  1897. X   - address */
  1898. X
  1899. Xvoid
  1900. Xget_address(field, address)
  1901. X     char *field, *address;
  1902. X{
  1903. X  register char *cp, *np;
  1904. X
  1905. X  /* strip possible newline */
  1906. X  if (cp = strchr(field, '\n'))
  1907. X    *cp = 0;
  1908. X
  1909. X  if ((cp = strchr(field, '(')) && strchr(cp + 1, ')'))
  1910. X    {
  1911. X      /* format is 'address (full name)' */
  1912. X      for (np = field; np < cp - 1; np++)
  1913. X        *address++ = *np;
  1914. X      *address = 0;
  1915. X    }
  1916. X  else
  1917. X    if ((cp = strchr(field, '<')) && (np = strchr(cp + 1, '>')))
  1918. X      {
  1919. X        /* format is 'full name <address>' */
  1920. X        while (cp < np)
  1921. X          *address++ = *cp++;
  1922. X        *address = 0;
  1923. X      }
  1924. X    else
  1925. X      /* line contains only address */
  1926. X      (void) strcpy(address, field);
  1927. SHAR_EOF
  1928. echo "End of part 1"
  1929. echo "File rfmail.c is continued in part 2"
  1930. echo "2" > s2_seq_.tmp
  1931. exit 0
  1932.  
  1933.