-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
1160 lines (765 loc) · 36.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
------------------------------------------------------------------------------
ReadMe for mfreq suite
(c) 1994-2019 by Markus Reschke
------------------------------------------------------------------------------
Last edit: 2019-01-02
* About
mfreq is a suite of tools for FTS style file requesting. It consists of a
file index generator, filelist generator and a SRIF compatible file request
handler. The original version of mfreq was developed for the venerable
Commodore Amiga (tm) back in the 1990ies.
Features:
- case-sensitive and long filenames
- filenames with spaces
- magics
- ifcico-style magic files
- smart magics
- password protected files
- case-insensitive freqests (if enabled by cfg)
- request limits
- response netmail or text
- dir.bbs and files.bbs
- update of file description files
- multiline support for filelists
- tested with binkd and qico-xe
* Updating
If you update your current version of mfreq to a later one, always run
mfreq-index to update your file indexes. There might be some changes
in the file formats.
* Copyright
All files of the mfreq suite are copyrighted by Markus Reschke.
* License
The mfreq suite is distributed under the EUPL v1.1. For details see
EUPL-v1.1.pdf or http://joinup.ec.europa.eu/software/page/eupl.
* Acknowledgements
The SRIF protcol is described in FSC-0086 (see http://www.ftsc.org).
------------------------------------------------------------------------------
mfreq-index
------------------------------------------------------------------------------
* About
This tool scans fileechos and directories to create a file index for a fast
frequest processing later on. It also takes care of magic file names.
* Usage
The command line usage is:
mfreq-index [-h/-?] [-c <cfg filepath>] [-l <log filepath>]
-h/-? prints usage information (optional)
-c configuration filepath (optional)
-l log filepath (optional)
Whithout the -c option the default filepath "/etc/fido/mfreq/index.cfg" will
be used as configuration file. The -l option overrides the LogFile command of
the configuration file. If neither the -l option nor the LogFile command are
given, nothing will be logged.
* Hints
mfreq-index collects all file data in memory until it writes the data into
an index file. If you have to deal with memory contraints please group your
file areas and create an index file for each group. The frequest handler
will accept multiple index files.
Symbolic file links are not supported for file areas or magic files. They
will be not followed.
* Configuration
The configuration file is more like a list of commands, which are processed
by mfreq-index to create the file index. It's a simple ASCII text file. For
a quick setup you'll find an example configuration "index.cfg" in the
sample-cfg directory.
+ Basic Syntax
Empty lines and lines starting with a "#" are treated as comments. Any other
lines should contain a valid command. Commands mostly have additional arguments
and options. Arguments with spaces, like a filepath, should be enclosed in
quotation marks, for example "/fido/my files".
The command parser also supports following quoted special characters:
- \" for a literal "
- \\ for a literal \
Outside quotations you may also use commas instead of whitespaces to separate
options.
+ LogFile Command
Syntax:
LogFile <log filepath>
The LogFile command specifies a filepath to be used as log file. If the -l
option of the command line is used, it will overwrite the LogFile command. This
command may be used only once. The best practice is to place LogFile as
first command in the configuration.
To prevent running several instances of mfreq-index writing the same file
index at the same time the logfile will be locked.
mfreq-index logs when it's started or ended. If you see a log entry that the
program ended with errors, please run it manually and check the standard
output for finding the cause of the error.
+ SetMode Command
Syntax:
SetMode [PathAliases] [BinarySearch]
With SetMode you enable following features:
Switch Feature
----------------------------------------------
PathAliases create path aliases
AnyCase create index for case-insensitive search
BinarySearch create offset file for binary filename search
With PathAliases enabled mfreq-index creates automatically aliases for paths
in the index data file and writes those aliases into the index alias file.
That way the size of the index data file is decreased hugely. The drawback
is that the request processing might take a little bit longer. This feature
is supported just for regular files, not magics.
The AnyCase switch causes the index to be sorted differently for supporting
case-insensitive filename search by the frequest processor.
If you have a large filebase with tons of files you should enable the binary
search feature to speed up filename searching for simple requests (no wildcard
as first character). Enable this feature for the request processor too. The
speed gain is achieved by creating an additional index file (offset) and using
the well known binary search algorithm.
Hint: When you enable AnyCase and/or BinarySearch please do the same for
mfreq-srif and vice versa.
+ Reset Command
Syntax:
Reset [SetMode]
The Reset command does what you would expect :-) It resets several things
back to their defaults:
Keyword Action
-----------------------------------------------------
SetMode resets all SetMode switches
Excludes clears the list of file excludes
+ Magic Command
Syntax:
Magic <name> File <filepath> [PW <password>]
The Magic command defines a frequest magic and its corresponding file. Add a
magic command for each magic you want to serve. If you need to connect a
single magic to several files add the same magic for each file.
A password may be specified optionally to limit access.
+ SmartMagic Command
Syntax:
SmartMagic <name> Path <path> [Pattern <pattern>] [Latest]
[PW <password>]
This command allows you to create magics which select specific files within a
directory based on given criteria. Following are supported:
Keyword Selection
---------------------------------------------------------------
Pattern <pattern> files matching the name pattern
Latest the latest file (modification time)
You may combine the conditions and set a password optionally to limit access.
A pattern supports following wildcards:
- ? for matching a single character
- * for matching any number of characters (including zero)
Both wildcards may be used multiple times in a single pattern.
+ MagicPath Command
Syntax:
MagicPath <path>
The MagicPath command specifies a directory containing special magic files.
Such a magic file is a simple text file containing filepaths (one filepath
per line). The name of the magic file is used as name for the magic itself.
This method is used by ifcico for example. You may use this command multiple
times. If any file excludes are defined they'll be considered for the magic
files, not for the filepaths in the magic files.
+ Exclude Command
Syntax:
Exclude <name or pattern>
To exclude specific files from being indexed use the Exclude command and
specify a name or a name pattern. A pattern supports following wildcards:
- ? for matching a single character
- * for matching any number of characters (including zero)
Both wildcards may be used multiple times in a single pattern.
Each Exclude command will add the given name or pattern to a list, which
is consulted when the MagicPath or AreaDir command is executed.
+ FileArea Command
Syntax:
FileArea <path> [PW <password>] [Depth <level>] [AutoMagic]
With the FileArea command the files inside the given directory will be added
to the internal file index (stored in RAM). Use this command for each of your
file areas/echos. If any file excludes are defined they'll be considered.
A password may be specified optionally to limit access.
The Depth argument enables directory recursion with a limit of the
given level. The level value should be in the range of 1 up to 10.
The AutoMagic switch will create a magic for each file with the file's
extension dropped off. For example:
- myfile.zip -> myfile
+ SharedFileArea Command
Syntax:
SharedFileArea Path <path> [PW <password>] [Depth <levels>] [AutoMagic]
[switches and options from mfreq-list]
This is basically the same command like FileArea, but with a slightly
changed syntax to share the command with mfreq-list. The mfreq-list specific
switches and options are ignored. The idea is that you may put all your
fileareas into an additional configuration file and share it by the Include
command with mfreq-list.
+ Include Command
Syntax:
Include [Config <filepath>]
If you like to spread your configuration over several files you may include
those additional files with the Include command. Nesting is limited to 2
levels (main configuration is the first level).
+ Index Command
Syntax:
Index <filepath>
The Index command writes all files in the internal file index (stored in RAM)
to the specified filepath. Following files will be written (based on SetMode):
- <filepath>.data
- <filepath>.lookup
- <filepath>.alias
- <filepath>.offset
After writing the index the internal file index buffer is emptied. Any new
files are added to file index buffer again, until another Index command will
write those files to a new index and so on. This might come in handy if you
have memory contraints or if you need different file indexes for whatever
reason.
Hint: The number of files per index are limited to 1000000. If you have more
files, please create multiple indexes.
* ToDo / Feature Requests
Some stuff which needs to be fixed or would be nice to have:
- Verbose logging (including cfg switch)?
------------------------------------------------------------------------------
mfreq-list
------------------------------------------------------------------------------
* About
The mfreq-list tool creates filelists and cleans up description files if
requested.
* Hints
Symbolic file links are not supported for file areas . They will be not
followed.
* Description Files
Brief overview of file description files and their syntax. All files may have
lines ending with a CR (carriage return / 13).
+ simple files.bbs
Plain ASCII file containing one or more lines for each file. Lines should not
exceed a length of 78 characters.
Format:
<name 8.3> [<counter>] <description>
[ <more description>]
Values:
- name 8.3: DOS style filename (<8 chars name>.<3 chars extension>)
- counter: download counter (usually [<number>])
+ extended files.bbs
Plain ASCII file containing one or more lines for each file. Lines should not
exceed a length of 78 characters
Format:
<name 8.3> <size> <date> [<counter>] <description>
[ <more description>]
Values:
- name 8.3: DOS style filename (<8 chars name>.<3 chars extension>)
- size: in bytes without commas
- date: file date (usually MM-DD-YY)
- counter: download counter (usually [<number>])
+ dir.bbs
Plain ASCII file containing one line with the description of the directory.
Format:
<directory/filearea description>
+ filearea.bbs
This is a new file used by mfreq-list to set the filearea name for sub
directories in case of directory recursion. It's a plain ASCII file with
just the filearea name.
Format:
<filearea name>
+ descript.ion
Plain ASCII file containing one line for each file.
Format:
<name> <description>
Long filenames are supported. Filenames with space(s) are enclosed in
quotations marks.
Hint: Not supported by mfreq-list yet.
* Usage
The command line usage is:
mfreq-list [-h/-?] [-c <cfg filepath>] [-l <log filepath>]
-h/-? prints usage information (optional)
-c configuration filepath (optional)
-l log filepath (optional)
Whithout the -c option the default filepath "/etc/fido/mfreq/list.cfg" will
be used as configuration file. The -l option overrides the LogFile command of
the configuration file. If neither the -l option nor the LogFile command are
given, nothing will be logged.
* Configuration
The configuration file is more like a list of commands, which are processed
by mfreq-list to create filelists. It's a simple ASCII text file. For a quick
setup you'll find an example configuration "list.cfg" in the sample-cfg
directory.
+ Basic Syntax
Empty lines and lines starting with a "#" are treated as comments. Any other
lines should contain a valid command. Commands mostly have additional arguments
and options. Arguments with spaces, like a filepath, should be enclosed in
quotation marks, for example "/fido/my files".
The command parser also supports following quoted special characters:
- \" for a literal "
- \\ for a literal \
Outside quotations you may also use commas instead of whitespaces to separate
options.
+ LogFile Command
Syntax:
LogFile <log filepath>
The LogFile command specifies a filepath to be used as log file. If the -l
option of the command line is used, it will overwrite the LogFile command. This
command may be used only once. The best practice is to place LogFile as
first command in the configuration.
To prevent running several instances of mfreq-list writing the same
filelist(s) at the same time the logfile will be locked.
mfreq-list logs when it's started or ended. If you see a log entry that the
program ended with errors, please run it manually and check the standard
output for finding the cause of the error.
+ Exclude Command
Syntax:
Exclude <name or pattern>
To exclude specific files from being listed use the Exclude command and
specify a name or a name pattern. A pattern supports following wildcards:
- ? for matching a single character
- * for matching any number of characters (including zero)
Both wildcards may be used multiple times in a single pattern.
Each Exclude command will add the given name or pattern to a list, which
is consulted when the FileArea command is executed.
+ Filelist Command
Syntax:
Filelist <filepath>
The Filelist command starts a new filelist and any list output is written to
that file until a new filelist is defined or mfreq-list ends. If the given
file already exists it will be overwritten.
+ AddText Command
Syntax:
AddText <text>
This command allows you to add some custom text to the current filelist. If
the text includes any spaces enclose it with quotation marks, for example:
AddText "This is my custom text."
For an empty line use:
AddText ""
+ Define files.bbs Command
Syntax:
Define files.bbs NameFormat <format> [NameWidth <width>]
[SizePos <pos> SizeFormat <format>]
[DatePos <pos> DateFormat <format>]
[CounterPos <pos> CounterFormat <format>]
DescPos <pos>
The command above defines the format of the files.bbs description file. It
tells mfreq-list which data fields are used. Each call will reset all settings
of the last call. The format definition is used for reading and writing.
For all arguments the <pos> value is the position of the data field, starting
with 1 for the first character (valid range: 1-120). A position of 40 means
that the data field starts at character position 40.
Arguments:
* NameFormat <format>
Defines file name format.
format description
--------------------------------------------------
DOS 8.3 DOS style
Long full name (you need to set NameWidth too!)
* NameWidth <width>
Defines the maximum length of the filename. If <width> is exceeded, the
filename will be truncated with an asterisk ("*"). The valid range of
<width> is 12 up to 60.
* SizePos <pos> SizeFormat <format>
Enables file size field. Defines start position and format.
format description examples
----------------------------------------------------------
Bytes-8 bytes without unit, max. 8 digits 1234
Unit-8 bytes with unit, max. 8 chars 12kB, 12KiB
Short-8 bytes with short unit, max. 8 chars 12k
The size field is right-justified! So take care when defining the position!
Leading zeros are omitted. When reading a files.bbs file mfreq-list accepts
any valid format, not just the one you've set.
* DatePos <pos> DateFormat <format>
Enables file date field. Defines start position and format.
format description examples
-----------------------------------
US MM-DD-YY 04-20-13
ISO YYYY-MM-DD 2013-04-20
* CounterPos <pos> CounterFormat <format>
Enables download counter field. Defines start position and format.
format description examples
----------------------------------
Square-2 [nn] [12], [7]
Square-3 [nnn] [345]
Square-4 [nnnn] [6789]
The counter field is right-justified! So take care when defining the
position! Leading zeros are omitted.
* DescPos <pos>
Sets the start position of file description.
+ Define filelist Command
Syntax:
Define filelist [NamePos <line-pos>] NameFormat <format> [NameWidth <width>]
[SizePos <line-pos> SizeWidth <width> SizeFormat <format>]
[DatePos <line-pos> DateFormat <format>]
[CounterPos <line-pos> CounterFormat <format>]
DescPos <line-pos> DescWidth <width>
This command defines the output format of the filelist. It's similar to the
"Define files.bbs" command. To support multiline output some data field
positions may have a line number included using following syntax:
<line>-<pos> or <line>.<pos>
When omitting the line number, mfreq will assume the line number being 1. For
example:
- 1.10 means position 10 in line 1
- 1-10 same as above
- 10 same as above
- 3-40 means position 40 in line 3
The maximum line number supported is 5. To add empty lines skip line numbers.
If you set NamePos to 2-<pos> an empty line is added before the file name.
* [NamePos <line-pos>] NameFormat <format> [NameWidth <width>]
Position (range: 1 - 120), width (range: 12 - 60) and format of file name:
format description
---------------------------------------------------
DOS 8.3 DOS style
Long full name (you need to set NameWidth too!)
* SizePos <line-pos> SizeWith <width> SizeFormat <format>
Position (range: 1 - 120), width (range: 4 - 12) and format of file size:
format description examples
--------------------------------------------
Bytes bytes without unit 1234
Unit bytes with unit 12kB, 12KiB
Short bytes with short unit 12k
The size field is right-justified! So take care when defining the position!
Leading zeros are omitted.
* DatePos <line-pos> DateFormat <format>
Position (range: 1 - 120) and format of file date:
format description examples
-----------------------------------
US MM-DD-YY 04-20-13
ISO YYYY-MM-DD 2013-04-20
* CounterPos <line-pos> CounterFormat <format>
Position (range: 1 - 120) and format of download counter:
format description examples
----------------------------------
Square-2 [nn] [12], [7]
Square-3 [nnn] [345]
Square-4 [nnnn] [6789]
The counter field is right-justified! So take care when defining the
position! Leading zeros are omitted.
* DescPos <line-pos> DescWidth <width>
Position (range: 1 - 120) and width (range: 18-80) of description field.
+ InfoMode Command
Syntax:
InfoMode [dir.bbs] [files.bbs] [Update] [Strict] [Skips] [Relax] [SI-Units]
Switch Feature
-------------------------------------------------------
dir.bbs enable use of dir.bbs/DIR.BBS
files.bbs enable use of files.bbs/FILES.BBS
Update enable update of file description file
Strict enable strict position checking for data fields
Skips allow missing data fields behind filename
Relax don't end processing of file description file if any
syntax errors are detected
AnyCase match file names case-insensitive
SI-Units enable SI byte units
IEC-Units enable IEC byte units output
With InfoMode you set several switches for file description files and select
sources for file descriptions. When you enable files.bbs, you have also to
define it's format with the "Define files.bbs" command. In case the dir.bbs
switch is set, mfreq-list reads the area description from that file if
available.
If you want mfreq-list to update the description file, e.g. removing deleted
files, please set the Update switch.
For strict position checking set the Strict switch, i.e. the start and end
positions of the defined data fields must match exactly. The Skips switch
allows missing data fields after the filename (premature end of line). With
Relax set mfreq-list ignores syntax/format errors in file description files
and keeps processing. So you'll get a filelist in any case. But be warned that
the Relax switch may cause a lot of warnings being logged. If you set Relax
and Update you can convert file descriptions files into the desired format.
When you have issues with the case-sensitivity of filenames on disk and in the
file description file, you can enable AnyCase to match the filenames case-
insensitive. For example, if the filenames on disk are lower case and the
filenames in the files.bbs are upper case. Make sure that you don't have any
filename doubles when case-insensitive matching is applied. For double
filenames on disk the first one found will get the file description. Any other
double is treated as a new file not in the file description file yet. If you
have doubles in the file description file, all descriptions of all doubles will
be added to the first matching filename found on disk.
The SI-Units switch enables metric unit prefixes for any input and output, i.e.
1 kB = 1000 Bytes. By default the binary prefix system is used. The IEC-Units
switch enables output of the IEC prefix recommendations (1024 Bytes = 1 KiB)
and overrides the SI-Units switch for output.
+ Reset Command
Syntax:
Reset [SetMode]
As expected this command resets several things back to their defaults:
Keyword Action
-----------------------------------------------------
InfoMode resets all InfoMode switches
Excludes clears the list of file excludes
+ Include Command
Syntax:
Include [Config <filepath>]
If you like to spread your configuration over several files you may include
those additional files with the Include command. Nesting is limited to 2
levels (main configuration is the first level).
+ FileArea Command
Syntax:
FileArea <name> Path <path> [Info <description>] [Depth <level>]
The FileArea command scans a directory and writes a sorted list of files to
the current filelist. Specify the file echo's name and path. The Info argument
overrides any other source of the filearea's description.
The Depth argument enables directory recursion with a limit of the given
level. The level value should be in the range of 1 up to 10. For sub
directories the filearea name and description are taken from filearea.bbs
and dir.bbs. Therefore please enable dir.bbs (see InfoMode). When no
filearea.bbs is found the sub directory's name will be used instead. If
you set Info mfreq-list will ignore any dir.bbs files and use the given
filearea description also for sub directories.
+ SharedFileArea Command
Syntax:
SharedFileArea Name <name> Path <path> [Info <description>]
[Depth <level>] [switches and options from mfreq-index]
This is basically the same command like FileArea, but with a slightly
changed syntax to share the command with mfreq-index. The mfreq-index specific
switches and options are ignored. The idea is that you may put all your
fileareas into an additional configuration file and share it by the Include
command with mfreq-index.
* ToDo / Feature Requests
Some stuff which needs to be fixed or would be nice to have:
- Support special formatting of additional description lines in files.bbs?
("<spaces>+ <desc>" / "<spaces>| <desc>")
- Support comment lines in files.bbs?
(" <comment>" / "--- <comment>")
- Support of descript.ion?
- Support file_id.diz? Try to extract?
- Ignore a missing directory and keep processing?
- Verbose logging (including cfg switch)?
- Auto-wrapping for file description when exceeding DescWidth?
------------------------------------------------------------------------------
mfreq-srif
------------------------------------------------------------------------------
* About
This is the SRIF frequest handler. It reads the mailers SRIF file, processes
the file request while checking for any limits, writes a response list and
creates a response netmail or textmail if configured. mfreq-srif requires an
file index created by mfreq-index.
* Usage
The command line usage is:
mfreq-srif [-h/-?] [-c <cfg filepath>] [-l <log filepath>] -s <SRIF filepath>
-h/-? prints usage information (optional)
-c configuration filepath (optional)
-l log filepath (optional)
-s SRIF filepath (required)
Whithout the -c option the default filepath "/etc/fido/mfreq/srif.cfg" will
be used as configuration file. The -l option overrides the LogFile command of
the configuration file. If neither the -l option nor the LogFile command are
given, nothing will be logged.
If you are running binkd you would add following to your binkd.cfg:
exec "/path-to/mfreq-srif -s *S" *.req
For qico-xe please add following to qico.conf:
srifrp /path-to/mfreq-srif -s
* Hints
Symbolic file links are not supported for file areas or magic files. They
will be not followed.
All FTS addresses (AKAs) will be normalized into following format:
<zone>:<net>/<node>.<point>[@<domain>]
The <domain> part is optional and nodes get point number 0.
* Requests
Requests with the following format are supported:
<filename pattern> [!<password>]
Each line should contain a single filename or pattern with an optional
password separated by a space. Due to internal token processing the
password may also be separated by comma or whitespaces. A filename or pattern
with spaces needs to be enclosed in quotation marks, e.g. "my file.lha".
Wildcards:
- ? for matching a single character
- * for matching any number of characters (including zero)
Both wildcards may be used multiple times in a pattern.
* NetMail/TextMail
The frequest handler creates a response netmail or textmail for the requestor
and adds the netmail packet or textmail file to the response list (with the
delete-me-after-sent indicator).
A "result" textblock is generated for each requested file/pattern:
<empty line>
<file/pattern requested>
- <file found or other feedback>
[- <file found or other feedback>]
The "totals" textblock lists the number of files found and their byte sum.
It also gives hints about exeeded file, byte or frequest limits.
The message is formatted like this:
[MailHeader]
<Result>
[Result]
...
[Result]
<Totals>
[MailFooter]
Password errors are reported as "nothing found". By omitting any hint about
password problems the requestor will be discouraged from guessing passwords.
* Configuration
It's a simple ASCII text file. For a quick setup you'll find an example
configuration "srif.cfg" in the sample-cfg directory.
+ Basic Syntax
Empty lines and lines starting with a "#" are treated as comments. Any other
lines should contain a valid setting. Settings mostly have additional arguments
and options. Arguments with spaces, like a filepath, should be enclosed in
quotation marks, for example "/fido/my files".
The command parser also supports following quoted special characters:
- \" for a literal "
- \\ for a literal \
Outside quotations you may also use commas instead of whitespaces to separate
options.
+ LogFile Setting
Syntax:
LogFile <log filepath>
The LogFile setting specifies a filepath to be used as log file. If the -l
option of the command line is used, it will overwrite the LogFile command. This
setting may be used only once. The best practice is to place LogFile as
first setting in the configuration.
mfreq-srif logs when it's started or ended. If you see a log entry that the
program ended with errors, please run it manually within a test environment
and check the standard output for finding the cause of the error. For the
test environment simply create a pair of fake SRIF and request files.
+ SetMode Setting
Syntax:
SetMode [NetMail] [NetMail+] [TextMail] [RemoveReq] [AnyCase]
[BinarySearch] [LogRequest] [SI-Units] [IEC-Units]
With SetMode you enable following features:
Switch Feature
----------------------------------------
NetMail send response netmail (type-2 packet, FTS-0001)
NetMail+ send response netmail (type-2+ packet, FSC-0048)
TextMail send response textmail (plain ASCII file)
RemoveReq delete request file after processing
AnyCase match file names case-insensitive
BinarySearch enable binary filename search
LogRequest log file requests in more detail
SI-Units enable SI byte units
IEC-Units enable IEC byte units output
When netmail response is enabled, but the SRIF lacks the sysop name, the
setting is automatically changed into textmail.
Please set the RemoveReq switch if your mailer doesn't delete the request file
after calling the frequest handler.
The AnyCase switch enables case-insensitive filename matching and requires a
specifically sorted index, i.e. AnyCase has be enbled for mfreq-index too.
If you set BinarySearch the program uses a binary search algorithm to speed
up the processing of file requests. Also enable BinarySearch for mfreq-index
to create an additional index file (offset) which is needed for this feature.
With LogRequest set mfreq-srif logs which files are requested and which are
going to be sent.
The SI-Units switch enables metric unit prefixes for any input and output, i.e.
1 kB = 1000 Bytes. By default the binary prefix system is used. The IEC-Units
switch enables output of the IEC prefix recommendations (1024 Bytes = 1 KiB)
and overrides the SI-Units switch for output.
Hint: When you enable AnyCase and/or BinarySearch please do the same for
mfreq-index and vice versa.
+ Address Setting
Syntax:
Address <zone>:<net>/<node>[.<point>][@<domain>]
This defines your FTS addresses (AKAs). At least you should set your main AKA.
Add an Address setting for each AKA.
+ MailDir setting
Syntax:
MailDir <path>
This setting is optional and specifies the path for response netmails or
textmails. A good choice would be your outbound directory or /tmp. Used only
once in the configuration. If not set, the default path "/var/tmp" will be
used.
Example:
MailDir /tmp
+ MailHeader/MailFooter setting
Syntax:
MailHeader <text>
MailFooter <text>
Both settings allow you to add some custom text to the netmail or textmail
response. MailHeader adds text at the top of the mail and MailFooter at the
bottom. In between mfreq-srif will report any results of the request. The text
is written to the mail in the same order as in the configuration.
If the text includes any spaces enclose it with quotation marks, for example:
MailHeader "This is my custom text."
For an empty line use:
MailHeader ""
Some message readers won't display empty lines at the beginning of a netmail.
To circumvent that just add a space, like:
MailHeader " "
MailHeader "bla bla"
+ Limit Setting
Syntax:
Limit <FTS address pattern> [Files <number>] [Bytes <bytes>]
[BadPWs <number>] [Freqs <number>] [IfListed]
This settings limits what a requester may retrieve. Actually it's a list of
rules linked to a specfic FTS address pattern. The first matching rule will be
used.
The FTS address pattern is based on the normalized format (see hints)