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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
|
SHELL = /bin/sh
SRCS = postconf.c postconf_builtin.c postconf_edit.c postconf_main.c \
postconf_master.c postconf_misc.c postconf_node.c postconf_other.c \
postconf_service.c postconf_unused.c postconf_user.c postconf_dbms.c \
postconf_lookup.c postconf_match.c postconf_print.c
OBJS = postconf.o postconf_builtin.o postconf_edit.o postconf_main.o \
postconf_master.o postconf_misc.o postconf_node.o postconf_other.o \
postconf_service.o postconf_unused.o postconf_user.o postconf_dbms.o \
postconf_lookup.o postconf_match.o postconf_print.o
HDRS = postconf.h
TESTSRC =
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) -DLEGACY_DBMS_SUPPORT
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
TESTPROG=
MAKES = bool_table.h bool_vars.h int_table.h int_vars.h str_table.h \
str_vars.h time_table.h time_vars.h raw_table.h raw_vars.h \
nint_table.h nint_vars.h nbool_table.h nbool_vars.h long_table.h \
long_vars.h str_fn_table.h str_fn_vars.h
DB_MAKES= pcf_ldap_suffixes.h pcf_memcache_suffixes.h pcf_mysql_suffixes.h \
pcf_pgsql_suffixes.h pcf_sqlite_suffixes.h
TEST_TMP= main.cf master.cf test*.tmp
DUMMIES = makes_dummy # for "make -j"
PROG = postconf
SAMPLES = ../../conf/main.cf.default
INC_DIR = ../../include
LIBS = ../../lib/libxsasl.a \
../../lib/lib$(LIB_PREFIX)tls$(LIB_SUFFIX) \
../../lib/lib$(LIB_PREFIX)dns$(LIB_SUFFIX) \
../../lib/lib$(LIB_PREFIX)global$(LIB_SUFFIX) \
../../lib/lib$(LIB_PREFIX)util$(LIB_SUFFIX)
HTABLE_FIX = NORANDOMIZE=1
.c.o:; $(CC) $(CFLAGS) -c $*.c
$(PROG): $(OBJS) $(LIBS)
$(CC) $(CFLAGS) $(SHLIB_RPATH) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
../../conf/main.cf.default: $(PROG) Makefile
rm -f $@
(echo "# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE"; \
echo "# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX."; \
echo "#"; $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -d -c ../../conf) | \
egrep -v '^(myhostname|mydomain|mynetworks|process_name|process_id) ' >$@
$(OBJS): ../../conf/makedefs.out
Makefile: Makefile.in
cat ../../conf/makedefs.out $? >$@
test: $(TESTPROG)
tests: test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \
test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 \
test22 test23 test24 test25 test26 test27 test28 test29 test30 test4b \
test31 test32 test33 test34 test35 test36 test37 test39 test40 test41 \
test42 test43 test44 test45 test46 test47 test48 test49 test50 test51 \
test52 test53 test54 test55 test56 test57 test58 test59 test60 test61 \
test62 test63 test64 test65 test66 test67 test68 test69 test70
root_tests:
update: ../../bin/$(PROG) $(SAMPLES)
../../bin/$(PROG): $(PROG)
cp $(PROG) ../../bin
$(MAKES): makes_dummy
makes_dummy: $(INC_DIR)/mail_params.h ../global/mail_params.c extract.awk Makefile.in
$(AWK) -f extract.awk ../*/*.c | $(SHELL)
touch makes_dummy
$(DB_MAKES): extract_cfg.sh Makefile.in
pcf_ldap_suffixes.h: ../global/dict_ldap.c
sh extract_cfg.sh -d ../global/dict_ldap.c > $@
pcf_memcache_suffixes.h: ../global/dict_memcache.c
sh extract_cfg.sh -d ../global/dict_memcache.c > $@
pcf_mysql_suffixes.h: ../global/dict_mysql.c
sh extract_cfg.sh -d -s ../global/dict_mysql.c > $@
pcf_pgsql_suffixes.h: ../global/dict_pgsql.c
sh extract_cfg.sh -d -s ../global/dict_pgsql.c > $@
pcf_sqlite_suffixes.h: ../global/dict_sqlite.c
sh extract_cfg.sh -d -s ../global/dict_sqlite.c > $@
# Define two parameters with smtpd_restriction_classes. One will be ignored.
test1: $(PROG) test1.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo smtpd_restriction_classes = foo bar >> main.cf
echo foo = yes >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test1.tmp 2>&1
diff test1.ref test1.tmp
rm -f main.cf master.cf test1.tmp
# Define two unused parameters. Expect two warnings.
test2: $(PROG) test2.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo restriction_classes = foo bar >> main.cf
echo foo = yes >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test2.tmp 2>&1
diff test2.ref test2.tmp
rm -f main.cf master.cf test2.tmp
# Define one parameter in main.cf, validate it with main.cf.
test3: $(PROG) test3.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo = yes >> main.cf
echo 'bar = $$foo' >> main.cf
echo 'always_bcc = $$bar' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test3.tmp 2>&1
diff test3.ref test3.tmp
rm -f main.cf master.cf test3.tmp
# Define one parameter in main.cf, validate it with master.cf.
test4: $(PROG) test4.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo = yes >> main.cf
echo 'bar = $$foo' >> main.cf
echo smtpd unix - n n - 0 smtpd >> master.cf
echo ' -o always_bcc=$$bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test4.tmp 2>&1
diff test4.ref test4.tmp
rm -f main.cf master.cf test4.tmp
# Define one parameter in master.cf, validate it with main.cf.
test4b: $(PROG) test4b.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'always_bcc = $$foo' >> main.cf
echo 'biff = $$bar' >> main.cf
echo 'bar = aaa' >> main.cf
echo smtpd1 unix - n n - 0 smtpd >> master.cf
echo ' -o foo=xxx -o bar=yyy -o baz=zzz' >> master.cf
echo '#smtpd2 unix - n n - 0 smtpd' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test4b.tmp 2>&1
diff test4b.ref test4b.tmp
rm -f main.cf master.cf test4b.tmp
# Define one user-defined parameter with name=value in master.cf,
# validate it with known_parameter=$$name in master.cf.
test5: $(PROG) test5.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo smtpd unix - n n - 0 smtpd >> master.cf
echo ' -o bar=yes -o always_bcc=$$bar -o' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test5.tmp 2>&1
diff test5.ref test5.tmp
rm -f main.cf master.cf test5.tmp
# Basic functionality test: service parameters for delivery agents.
test6: $(PROG) test6.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 pipe >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . 2>&1 | grep whatevershebrings >test6.tmp
diff test6.ref test6.tmp
rm -f main.cf master.cf test6.tmp
# Basic functionality test: service parameters for spawn programs.
test7: $(PROG) test7.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 spawn >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . 2>&1 | grep whatevershebrings >test7.tmp
diff test7.ref test7.tmp
rm -f main.cf master.cf test7.tmp
test8: $(PROG) test8.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings inet - n n - 0 spawn >> master.cf
echo whatevershebrings_time_limit=1 >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . 2>&1 | grep whatevershebrings >test8.tmp
diff test8.ref test8.tmp
rm -f main.cf master.cf test8.tmp
test9: $(PROG) test9.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -M '*'/inet >test9.tmp 2>&1
diff test9.ref test9.tmp
rm -f main.cf master.cf test9.tmp
test10: $(PROG) test10.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -M bar/inet foo/unix >test10.tmp 2>&1
diff test10.ref test10.tmp
rm -f main.cf master.cf test10.tmp
test11: $(PROG) test11.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo bar unix - n n - 0 spawn >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -M >test11.tmp 2>&1
diff test11.ref test11.tmp
rm -f main.cf master.cf test11.tmp
# Duplicate service entry.
test12: $(PROG) test12.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo bar=yes >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o always_bcc=$$bar -o' >> master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o always_bcc=$$bar -o' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -M >test12.tmp 2>&1
diff test12.ref test12.tmp
rm -f main.cf master.cf test12.tmp
# Define parameter with restriction_classes in master.cf, validate in main.cf.
test13: $(PROG) test13.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo bar=yes >> main.cf
echo baz=xx >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o smtpd_restriction_classes=bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test13.tmp 2>&1
diff test13.ref test13.tmp
rm -f main.cf master.cf test13.tmp
# Define parameter with restriction_classes in main.cf, validate in master.cf.
test14: $(PROG) test14.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo smtpd_restriction_classes=bar >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o bar=yes -o baz=xx' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test14.tmp 2>&1
diff test14.ref test14.tmp
rm -f main.cf master.cf test14.tmp
# Define two parameters, one is hidden by master.cf.
test15: $(PROG) test15.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo bar=xx >> main.cf
echo baz=yy >> main.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o bar=yes -o always_bcc=$$bar$$baz' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test15.tmp 2>&1
diff test15.ref test15.tmp
rm -f main.cf master.cf test15.tmp
# Test graceful degradation if master.cf is unavailable.
test16: $(PROG) test16.ref
rm -f main.cf master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test16.tmp 2>&1
diff test16.ref test16.tmp
rm -f main.cf master.cf test16.tmp
test17: $(PROG) test17.ref
rm -f main.cf master.cf
touch -t 197101010000 main.cf
-$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mc . >test17.tmp 2>&1; exit 0
diff test17.ref test17.tmp
rm -f main.cf master.cf test17.tmp
# Test legacy $name in built-in defaults.
test18: $(PROG) test18.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo virtual_maps=xxx >> main.cf
echo smtpd_client_connection_limit_exceptions=yyy >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test18.tmp 2>&1
diff test18.ref test18.tmp
rm -f main.cf master.cf test18.tmp
# Test $name in "raw" parameters.
test19: $(PROG) test19.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo forward_path='$$'aaaa >> main.cf
echo default_rbl_reply='$$'bbbb >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test19.tmp 2>&1
diff test19.ref test19.tmp
rm -f main.cf master.cf test19.tmp
# Test master.cf line folding.
test20: $(PROG) test20.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo inet - n n - 0 spawn >> master.cf
echo ' -o always_bcc=$$bar$$baz' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc . >test20.tmp 2>&1
diff test20.ref test20.tmp
rm -f main.cf master.cf test20.tmp
# Test main.cf line folding.
test21: $(PROG) test21.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo forward_path = xxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxxx \
xxxxxxxxxxxxx xxxxxxxxxxxxxx >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nfc . >test21.tmp 2>&1
diff test21.ref test21.tmp
rm -f main.cf master.cf test21.tmp
# Like test6, but using a delivery agent that has no _time_limit magic.
test22: $(PROG) test22.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . 2>&1 | grep whatevershebrings >test22.tmp
diff test22.ref test22.tmp
rm -f main.cf master.cf test22.tmp
# Test the -C flag for each category.
test23: $(PROG) test23.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo always_bcc = yes >> main.cf
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -nC builtin >test23.tmp 2>&1
diff test23.ref test23.tmp
rm -f main.cf master.cf test23.tmp
test24: $(PROG) test24.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo always_bcc = yes >> main.cf
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -nC user >test24.tmp 2>&1
diff test24.ref test24.tmp
rm -f main.cf master.cf test24.tmp
test25: $(PROG) test25.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo always_bcc = yes >> main.cf
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -C service 2>&1 | grep whatevershebrings >test25.tmp
diff test25.ref test25.tmp
rm -f main.cf master.cf test25.tmp
# Test completeness of "-C all".
test26: $(PROG) test26.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo always_bcc = yes >> main.cf
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . -C all >test26.tmp 2>&1
diff test26.ref test26.tmp
rm -f main.cf master.cf test26.tmp
test27: $(PROG) test27.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo always_bcc = yes >> main.cf
echo name = value >> main.cf
echo whatevershebrings unix - n n - 0 smtp >> master.cf
echo ' -o always_bcc=$$name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c . -C all 2>&1 | grep whatevershebrings >test27.tmp
diff test27.ref test27.tmp
rm -f main.cf master.cf test27.tmp
# Test macro expansion, type:table parsing and scoping.
test28: $(PROG) test28.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'xx = proxy:ldap:foo' >> main.cf
echo 'foo_domain = bar' >> main.cf
echo 'header_checks = ldap:hh' >> main.cf
echo 'hh_domain = whatever' >> main.cf
echo 'zz = $$yy' >> main.cf
echo 'yy = aap' >> main.cf
echo 'db = memcache' >> main.cf
echo whatevershebrings unix - n n - 0 other >> master.cf
echo ' -o body_checks=$$db:$$zz' >> master.cf
echo 'aap_domain = whatever' >> main.cf
echo 'aa_domain = whatever' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test28.tmp 2>&1
diff test28.ref test28.tmp
rm -f main.cf master.cf test28.tmp
# Test the handling of known and unknown database-defined suffixes.
test29: $(PROG) test29.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'ldapxx = proxy:ldap:ldapfoo' >> main.cf
echo 'ldapfoo_domain = bar' >> main.cf
echo 'ldapfoo_domainx = bar' >> main.cf
echo 'mysqlxx = proxy:mysql:mysqlfoo' >> main.cf
echo 'mysqlfoo_domain = bar' >> main.cf
echo 'mysqlfoo_domainx = bar' >> main.cf
echo 'pgsqlxx = proxy:pgsql:pgsqlfoo' >> main.cf
echo 'pgsqlfoo_domain = bar' >> main.cf
echo 'pgsqlfoo_domainx = bar' >> main.cf
echo 'sqlitexx = proxy:sqlite:sqlitefoo' >> main.cf
echo 'sqlitefoo_domain = bar' >> main.cf
echo 'sqlitefoo_domainx = bar' >> main.cf
echo 'memcachexx = proxy:memcache:memcachefoo' >> main.cf
echo 'memcachefoo_domain = bar' >> main.cf
echo 'memcachefoo_domainx = bar' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test29.tmp 2>&1
diff test29.ref test29.tmp
rm -f main.cf master.cf test29.tmp
test30: $(PROG) test30.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo p1=xx >> main.cf
echo p2=xx >> main.cf
echo p3=xx >> main.cf
echo p4=xx >> main.cf
echo whatevershebrings unix - n n - 0 other >> master.cf
echo ' -o body_checks=$$p1' >> master.cf
echo ' -o bodyx_checks=$$p2' >> master.cf
echo ' -oheader_checks=$$p3' >> master.cf
echo ' -oheaderx_checks=$$p4' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test30.tmp 2>&1
diff test30.ref test30.tmp
rm -f main.cf master.cf test30.tmp
# Does a non-default setting propagate to a non-default value?
test31: $(PROG) test31.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'smtpd_helo_restrictions=whatever' >> main.cf
echo 'smtpd_sender_restrictions=$$smtpd_helo_restrictions' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nxc . >test31.tmp 2>&1
diff test31.ref test31.tmp
rm -f main.cf master.cf test31.tmp
# Does a non-default setting propagate to a default value?
test32: $(PROG) test32.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'relay_domains=whatever' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -xc . fast_flush_domains >test32.tmp 2>&1
diff test32.ref test32.tmp
rm -f main.cf master.cf test32.tmp
# Does a default setting propagate to a non-default value?
test33: $(PROG) test33.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'mydestination=whatever' >> main.cf
echo 'always_bcc=$$relay_domains' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -xc . always_bcc >test33.tmp 2>&1
diff test33.ref test33.tmp
rm -f main.cf master.cf test33.tmp
test34: $(PROG) test34.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'mydestination=whatever' >> main.cf
echo 'process_name=xxx' >> main.cf
echo 'process_id=yyy' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -xc . mydestination process_name >test34.tmp 2>&1
diff test34.ref test34.tmp
rm -f main.cf master.cf test34.tmp
test35: $(PROG) test35.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 other >> master.cf
echo ' -o body_checks=whatever' >> master.cf
echo ' -o process_name=aaa' >> master.cf
echo ' -o process_id=bbb' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -xc . process_name >test35.tmp 2>&1
diff test35.ref test35.tmp
rm -f main.cf master.cf test35.tmp
test36: $(PROG) test36.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'mydestination=$$virtual_mapx' >> main.cf
echo 'virtual_alias_maps=$$virtual_maps' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nxc . >test36.tmp 2>&1
diff test36.ref test36.tmp
rm -f main.cf master.cf test36.tmp
test37: $(PROG) test37.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'xxx=yyy' >> main.cf
echo 'aaa=bbb' >> main.cf
echo whatever unix - n n - 0 other >> master.cf
echo ' -o mydestination=$$xxx' >> master.cf
echo ' -o always_bcc=$$aaa' >> master.cf
echo ' -o aaa=ccc' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfxc . >test37.tmp 2>&1
diff test37.ref test37.tmp
rm -f main.cf master.cf test37.tmp
test39: $(PROG) test39.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc . '*'/unix >test39.tmp 2>&1
diff test39.ref test39.tmp
rm -f main.cf master.cf test39.tmp
test40: $(PROG) test40.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -voaaa=bbb' >> master.cf
echo ' -vo ccc=$$aaa' >> master.cf
echo ' -v -oddd=$$ccc' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfxc . '*'/unix >test40.tmp 2>&1
diff test40.ref test40.tmp
rm -f main.cf master.cf test40.tmp
test41: $(PROG) test41.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Pc . bar/unix/xxx=yyy bar/unix/aaa=bbb >test41.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test41.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Pc . bar/unix/xxx=YYY bar/unix/aaa=BBB >>test41.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test41.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Pc . >>test41.tmp 2>&1
diff test41.ref test41.tmp
rm -f main.cf master.cf test41.tmp
test42: $(PROG) test42.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Pc . bar/unix/xxx=yyy bar/unix/aaa=bbb >test42.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test42.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Pc . >>test42.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -PXc. bar/unix/xxx bar/unix/aaa >>test42.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test42.tmp 2>&1
diff test42.ref test42.tmp
rm -f main.cf master.cf test42.tmp
test43: $(PROG) test43.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Fc . bar/unix/chroot=y bar/unix/command='aa -stuffobb=cc dd' >test43.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test43.tmp 2>&1
diff test43.ref test43.tmp
rm -f main.cf master.cf test43.tmp
test44: $(PROG) test44.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar unix - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mc . bar/unix='xx inet - n n - 0 aa -stuffobb=cc dd' >test44.tmp 2>&1
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >>test44.tmp 2>&1
diff test44.ref test44.tmp
rm -f main.cf master.cf test44.tmp
test45: $(PROG) test45.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar xxxx - n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test45.tmp 2>&1 || true
diff test45.ref test45.tmp
rm -f main.cf master.cf test45.tmp
test46: $(PROG) test46.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet X n n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test46.tmp 2>&1 || true
diff test46.ref test46.tmp
rm -f main.cf master.cf test46.tmp
test47: $(PROG) test47.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - X n - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test47.tmp 2>&1 || true
diff test47.ref test47.tmp
rm -f main.cf master.cf test47.tmp
test48: $(PROG) test48.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n X - 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test48.tmp 2>&1 || true
diff test48.ref test48.tmp
rm -f main.cf master.cf test48.tmp
test49: $(PROG) test49.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n X 0 other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test49.tmp 2>&1 || true
diff test49.ref test49.tmp
rm -f main.cf master.cf test49.tmp
test50: $(PROG) test50.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n - X other >> master.cf
echo baz unix - n n - 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test50.tmp 2>&1 || true
diff test50.ref test50.tmp
rm -f main.cf master.cf test50.tmp
test51: $(PROG) test51.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n -? 0 other >> master.cf
echo bar inet - n n X? 0 other >> master.cf
echo baz unix - n n 0? 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test51.tmp 2>&1 || true
diff test51.ref test51.tmp
rm -f main.cf master.cf test51.tmp
test52: $(PROG) test52.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -MXc. bar/inet foo/unix xxx/yyy
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test52.tmp 2>&1 || true
diff test52.ref test52.tmp
rm -f main.cf master.cf test52.tmp
test53: $(PROG) test53.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -M#c. bar/inet xxx/yyy
diff test53.ref master.cf
rm -f main.cf master.cf test53.tmp
test54: $(PROG) test54.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -M#c. bar/inet foo/unix
diff test54.ref master.cf
rm -f main.cf master.cf test54.tmp
test55: $(PROG) test55.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -M#c. bar/inet baz/unix
diff test55.ref master.cf
rm -f main.cf master.cf test55.tmp
test56: $(PROG) test56.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo " -o first" >> master.cf
echo " -o second" >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -M#c. bar/inet xxx/yyy
diff test56.ref master.cf
rm -f main.cf master.cf test56.tmp
# Many more tests in util/mac_expand.in.
test57: $(PROG) test57.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'x = $${{1} == {2}?{error}:x-value}' >> main.cf
echo 'y = y-value' >> main.cf
echo 'bar = $${x?{$$y}:$$z}' >> main.cf
echo 'baz = $${x?{$$z}:$$y}' >> main.cf
echo 'foo = $$bar$$baz' >> main.cf
echo 't1 = Postfix 2.11 $${{$${x?bug:x}} == {bug}?in}compatible' >> main.cf
echo 't2 = $$t1' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nxc. >test57.tmp 2>&1
diff test57.ref test57.tmp
rm -f main.cf master.cf test57.tmp
test58: $(PROG) test58.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'mydestination = foo bar pipemap:{ldap:xxx, memcache:yy}x randmap:{xx' >> main.cf
echo 'xxx_domain = foo' >> main.cf
echo 'xxx_bogus = foo' >> main.cf
echo 'yy_backup = bbb' >> main.cf
echo 'yy_bogus = bbb' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./postconf -nc. >test58.tmp 2>&1 || true
diff test58.ref test58.tmp
rm -f main.cf master.cf test58.tmp
test59: $(PROG) test59.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo bar inet - n n 0 0 other >> master.cf
echo " -o name1=value1" >> master.cf
echo " -o { name2 = value2a value2b }" >> master.cf
echo " { arg1a arg1b }" >> master.cf
echo " { arg2a arg2b }x" >> master.cf
echo " { arg3a arg3b " >> master.cf
echo baz unix - n n 0 0 other >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Mfc. >test59.tmp 2>&1 || true
diff test59.ref test59.tmp
rm -f main.cf master.cf test59.tmp
test60: $(PROG) test60.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Fhc. >test60.tmp 2>&1 || true
diff test60.ref test60.tmp
rm -f main.cf master.cf test60.tmp
test61: $(PROG) test61.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -Phc. >test61.tmp 2>&1 || true
diff test61.ref test61.tmp
rm -f main.cf master.cf test61.tmp
test62: $(PROG) test62.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -FHc. >test62.tmp 2>&1 || true
diff test62.ref test62.tmp
rm -f main.cf master.cf test62.tmp
test63: $(PROG) test63.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo foo unix - n n - 0 other >> master.cf
echo ' -o always_bcc=bar' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -PHc. >test63.tmp 2>&1 || true
diff test63.ref test63.tmp
rm -f main.cf master.cf test63.tmp
# main.cf overrides built-in default.
test64: $(PROG) test64.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'relayhost = relay-from-main.cf' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c. relayhost >test64.tmp 2>&1
diff test64.ref test64.tmp
rm -f main.cf master.cf test64.tmp
# '-o name=value' overrides main.cf.
test65: $(PROG) test65.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo 'relayhost = relay-from-main.cf' >> main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c. -o relayhost=relay-from-cmd-line relayhost >test65.tmp 2>&1
diff test65.ref test65.tmp
rm -f main.cf master.cf test65.tmp
# unknown parameters in database configuration file (absolute pathname).
test66: $(PROG) test66.ref
rm -f main.cf master.cf
touch master.cf
echo alias_maps = ldap:`pwd`/test66.cf >> main.cf
echo " " mysql:`pwd`/test66.cf >> main.cf
echo " " pgsql:`pwd`/test66.cf >> main.cf
echo " " sqlite:`pwd`/test66.cf >> main.cf
echo " " memcache:`pwd`/test66.cf >> main.cf
echo junk = junk >> test66.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c. 2>test66.tmp >/dev/null
sed "s;PWD;`pwd`;" test66.ref | diff - test66.tmp
rm -f main.cf master.cf test66.tmp test66.cf
# expand process name and service name in master.cf.
test67: $(PROG) test67.ref
rm -f main.cf master.cf
touch master.cf
echo 'smtp inet n - n - - smtpd' >>master.cf
echo ' -o test1_process_name=$$process_name' >> master.cf
echo ' -o test1_service_name=$$service_name' >> master.cf
echo 'smtp unix n - n - - smtp' >>master.cf
echo ' -o test2_process_name=$$process_name' >> master.cf
echo ' -o test2_service_name=$$service_name' >> master.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -xMfc. >test67.tmp 2>&1
diff test67.ref test67.tmp
rm -f main.cf master.cf test67.tmp
test68: $(PROG) test68.ref
rm -f main.cf master.cf
touch master.cf
echo foo = ldap:`pwd` >> main.cf
echo 'alias_maps = $$foo/test68.cf' >> main.cf
echo " " mysql:`pwd`/test68.cf >> main.cf
echo " " pgsql:`pwd`/test68.cf >> main.cf
echo " " sqlite:`pwd`/test68.cf >> main.cf
echo " " memcache:`pwd`/test68.cf >> main.cf
echo junk = junk >> test68.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -c. 2>test68.tmp >/dev/null
sed "s;PWD;`pwd`;" test68.ref | diff - test68.tmp
rm -f main.cf master.cf test68.tmp test68.cf
# See also test28 for user-defined parameters defined in main.cf.
test69: $(PROG) test69.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo whatevershebrings unix - n n - 0 other >> master.cf
echo " -o ldap=ldap:`pwd`" >> master.cf
echo ' -o body_checks=$$ldap/test69.cf' >> master.cf
echo junk = junk >> test69.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test69.tmp 2>&1
sed "s;PWD;`pwd`;" test69.ref | diff - test69.tmp
rm -f main.cf master.cf test69.tmp test69.cf
# Nasty nesting. Prove that the ldap table is detected. If support for
# legacy table syntax is dropped, replace ldap:xyz with ldap:`pwd`/xyz
# and update the good/bad parameter name tests.
test70: $(PROG) test70.ref
rm -f main.cf master.cf
touch main.cf master.cf
echo "smtpd_client_restrictions = check_sender_access {" >>main.cf
echo " pipemap:{ldap:used} { search_order = foo, bar } }" >>main.cf
echo "used_server_host = 127.0.0.1" >>main.cf
echo "unused_server_host = 127.0.0.1" >>main.cf
touch -t 197101010000 main.cf
$(HTABLE_FIX) $(SHLIB_ENV) $(VALGRIND) ./$(PROG) -nc . >test70.tmp 2>&1
diff test70.ref test70.tmp
rm -f main.cf master.cf test70.tmp test70.cf
printfck: $(OBJS) $(PROG)
rm -rf printfck
mkdir printfck
cp *.h printfck
sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
lint:
lint $(DEFS) $(SRCS) $(LINTFIX)
clean:
rm -f *.o *core $(PROG) $(TESTPROG) junk $(MAKES) $(AUTOS) $(DUMMIES) \
$(TEST_TMP) $(DB_MAKES)
rm -rf printfck
tidy: clean
depend: $(MAKES)
(sed '1,/^# do not edit/!d' Makefile.in; \
set -e; for i in [a-z][a-z0-9]*.c; do \
$(CC) -E $(DEFS) $(INCL) $$i | grep -v '[<>]' | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
-e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' \
-e 's/o: \.\//o: /' -e p -e '}' ; \
done | LANG=C sort -u) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
@$(EXPORT) make -f Makefile.in Makefile 1>&2
# do not edit below this line - it is generated by 'make depend'
postconf.o: ../../include/argv.h
postconf.o: ../../include/check_arg.h
postconf.o: ../../include/compat_level.h
postconf.o: ../../include/dict.h
postconf.o: ../../include/htable.h
postconf.o: ../../include/mail_conf.h
postconf.o: ../../include/mail_dict.h
postconf.o: ../../include/mail_params.h
postconf.o: ../../include/mail_run.h
postconf.o: ../../include/mail_version.h
postconf.o: ../../include/msg.h
postconf.o: ../../include/msg_vstream.h
postconf.o: ../../include/myflock.h
postconf.o: ../../include/mymalloc.h
postconf.o: ../../include/name_code.h
postconf.o: ../../include/name_mask.h
postconf.o: ../../include/stringops.h
postconf.o: ../../include/sys_defs.h
postconf.o: ../../include/vbuf.h
postconf.o: ../../include/vstream.h
postconf.o: ../../include/vstring.h
postconf.o: ../../include/warn_stat.h
postconf.o: postconf.c
postconf.o: postconf.h
postconf_builtin.o: ../../include/argv.h
postconf_builtin.o: ../../include/attr.h
postconf_builtin.o: ../../include/check_arg.h
postconf_builtin.o: ../../include/dict.h
postconf_builtin.o: ../../include/get_hostname.h
postconf_builtin.o: ../../include/htable.h
postconf_builtin.o: ../../include/inet_proto.h
postconf_builtin.o: ../../include/iostuff.h
postconf_builtin.o: ../../include/mail_addr.h
postconf_builtin.o: ../../include/mail_conf.h
postconf_builtin.o: ../../include/mail_params.h
postconf_builtin.o: ../../include/mail_proto.h
postconf_builtin.o: ../../include/mail_version.h
postconf_builtin.o: ../../include/msg.h
postconf_builtin.o: ../../include/myflock.h
postconf_builtin.o: ../../include/mymalloc.h
postconf_builtin.o: ../../include/mynetworks.h
postconf_builtin.o: ../../include/name_code.h
postconf_builtin.o: ../../include/nvtable.h
postconf_builtin.o: ../../include/server_acl.h
postconf_builtin.o: ../../include/stringops.h
postconf_builtin.o: ../../include/sys_defs.h
postconf_builtin.o: ../../include/vbuf.h
postconf_builtin.o: ../../include/vstream.h
postconf_builtin.o: ../../include/vstring.h
postconf_builtin.o: bool_table.h
postconf_builtin.o: bool_vars.h
postconf_builtin.o: install_table.h
postconf_builtin.o: install_vars.h
postconf_builtin.o: int_table.h
postconf_builtin.o: int_vars.h
postconf_builtin.o: long_table.h
postconf_builtin.o: long_vars.h
postconf_builtin.o: nbool_table.h
postconf_builtin.o: nbool_vars.h
postconf_builtin.o: nint_table.h
postconf_builtin.o: nint_vars.h
postconf_builtin.o: postconf.h
postconf_builtin.o: postconf_builtin.c
postconf_builtin.o: raw_table.h
postconf_builtin.o: raw_vars.h
postconf_builtin.o: str_fn_table.h
postconf_builtin.o: str_fn_vars.h
postconf_builtin.o: str_table.h
postconf_builtin.o: str_vars.h
postconf_builtin.o: time_table.h
postconf_builtin.o: time_vars.h
postconf_dbms.o: ../../include/argv.h
postconf_dbms.o: ../../include/check_arg.h
postconf_dbms.o: ../../include/dict.h
postconf_dbms.o: ../../include/dict_ht.h
postconf_dbms.o: ../../include/dict_ldap.h
postconf_dbms.o: ../../include/dict_memcache.h
postconf_dbms.o: ../../include/dict_mysql.h
postconf_dbms.o: ../../include/dict_pgsql.h
postconf_dbms.o: ../../include/dict_proxy.h
postconf_dbms.o: ../../include/dict_sqlite.h
postconf_dbms.o: ../../include/htable.h
postconf_dbms.o: ../../include/mac_expand.h
postconf_dbms.o: ../../include/mac_parse.h
postconf_dbms.o: ../../include/mail_conf.h
postconf_dbms.o: ../../include/mail_params.h
postconf_dbms.o: ../../include/msg.h
postconf_dbms.o: ../../include/myflock.h
postconf_dbms.o: ../../include/mymalloc.h
postconf_dbms.o: ../../include/name_code.h
postconf_dbms.o: ../../include/split_at.h
postconf_dbms.o: ../../include/stringops.h
postconf_dbms.o: ../../include/sys_defs.h
postconf_dbms.o: ../../include/vbuf.h
postconf_dbms.o: ../../include/vstream.h
postconf_dbms.o: ../../include/vstring.h
postconf_dbms.o: pcf_ldap_suffixes.h
postconf_dbms.o: pcf_memcache_suffixes.h
postconf_dbms.o: pcf_mysql_suffixes.h
postconf_dbms.o: pcf_pgsql_suffixes.h
postconf_dbms.o: pcf_sqlite_suffixes.h
postconf_dbms.o: postconf.h
postconf_dbms.o: postconf_dbms.c
postconf_edit.o: ../../include/argv.h
postconf_edit.o: ../../include/check_arg.h
postconf_edit.o: ../../include/dict.h
postconf_edit.o: ../../include/edit_file.h
postconf_edit.o: ../../include/htable.h
postconf_edit.o: ../../include/mail_params.h
postconf_edit.o: ../../include/msg.h
postconf_edit.o: ../../include/myflock.h
postconf_edit.o: ../../include/mymalloc.h
postconf_edit.o: ../../include/name_code.h
postconf_edit.o: ../../include/readlline.h
postconf_edit.o: ../../include/split_at.h
postconf_edit.o: ../../include/stringops.h
postconf_edit.o: ../../include/sys_defs.h
postconf_edit.o: ../../include/vbuf.h
postconf_edit.o: ../../include/vstream.h
postconf_edit.o: ../../include/vstring.h
postconf_edit.o: ../../include/vstring_vstream.h
postconf_edit.o: postconf.h
postconf_edit.o: postconf_edit.c
postconf_lookup.o: ../../include/argv.h
postconf_lookup.o: ../../include/check_arg.h
postconf_lookup.o: ../../include/dict.h
postconf_lookup.o: ../../include/htable.h
postconf_lookup.o: ../../include/mac_expand.h
postconf_lookup.o: ../../include/mac_parse.h
postconf_lookup.o: ../../include/mail_conf.h
postconf_lookup.o: ../../include/msg.h
postconf_lookup.o: ../../include/myflock.h
postconf_lookup.o: ../../include/mymalloc.h
postconf_lookup.o: ../../include/name_code.h
postconf_lookup.o: ../../include/stringops.h
postconf_lookup.o: ../../include/sys_defs.h
postconf_lookup.o: ../../include/vbuf.h
postconf_lookup.o: ../../include/vstream.h
postconf_lookup.o: ../../include/vstring.h
postconf_lookup.o: postconf.h
postconf_lookup.o: postconf_lookup.c
postconf_main.o: ../../include/argv.h
postconf_main.o: ../../include/check_arg.h
postconf_main.o: ../../include/dict.h
postconf_main.o: ../../include/htable.h
postconf_main.o: ../../include/mac_expand.h
postconf_main.o: ../../include/mac_parse.h
postconf_main.o: ../../include/mail_conf.h
postconf_main.o: ../../include/mail_params.h
postconf_main.o: ../../include/msg.h
postconf_main.o: ../../include/myflock.h
postconf_main.o: ../../include/mymalloc.h
postconf_main.o: ../../include/name_code.h
postconf_main.o: ../../include/readlline.h
postconf_main.o: ../../include/stringops.h
postconf_main.o: ../../include/sys_defs.h
postconf_main.o: ../../include/vbuf.h
postconf_main.o: ../../include/vstream.h
postconf_main.o: ../../include/vstring.h
postconf_main.o: postconf.h
postconf_main.o: postconf_main.c
postconf_master.o: ../../include/argv.h
postconf_master.o: ../../include/check_arg.h
postconf_master.o: ../../include/dict.h
postconf_master.o: ../../include/htable.h
postconf_master.o: ../../include/mail_params.h
postconf_master.o: ../../include/master_proto.h
postconf_master.o: ../../include/msg.h
postconf_master.o: ../../include/myflock.h
postconf_master.o: ../../include/mymalloc.h
postconf_master.o: ../../include/name_code.h
postconf_master.o: ../../include/readlline.h
postconf_master.o: ../../include/split_at.h
postconf_master.o: ../../include/stringops.h
postconf_master.o: ../../include/sys_defs.h
postconf_master.o: ../../include/vbuf.h
postconf_master.o: ../../include/vstream.h
postconf_master.o: ../../include/vstring.h
postconf_master.o: postconf.h
postconf_master.o: postconf_master.c
postconf_match.o: ../../include/argv.h
postconf_match.o: ../../include/check_arg.h
postconf_match.o: ../../include/dict.h
postconf_match.o: ../../include/htable.h
postconf_match.o: ../../include/msg.h
postconf_match.o: ../../include/myflock.h
postconf_match.o: ../../include/mymalloc.h
postconf_match.o: ../../include/name_code.h
postconf_match.o: ../../include/split_at.h
postconf_match.o: ../../include/sys_defs.h
postconf_match.o: ../../include/vbuf.h
postconf_match.o: ../../include/vstream.h
postconf_match.o: ../../include/vstring.h
postconf_match.o: postconf.h
postconf_match.o: postconf_match.c
postconf_misc.o: ../../include/argv.h
postconf_misc.o: ../../include/check_arg.h
postconf_misc.o: ../../include/dict.h
postconf_misc.o: ../../include/htable.h
postconf_misc.o: ../../include/mail_conf.h
postconf_misc.o: ../../include/mail_params.h
postconf_misc.o: ../../include/myflock.h
postconf_misc.o: ../../include/mymalloc.h
postconf_misc.o: ../../include/name_code.h
postconf_misc.o: ../../include/safe.h
postconf_misc.o: ../../include/sys_defs.h
postconf_misc.o: ../../include/vbuf.h
postconf_misc.o: ../../include/vstream.h
postconf_misc.o: ../../include/vstring.h
postconf_misc.o: postconf.h
postconf_misc.o: postconf_misc.c
postconf_node.o: ../../include/argv.h
postconf_node.o: ../../include/check_arg.h
postconf_node.o: ../../include/dict.h
postconf_node.o: ../../include/htable.h
postconf_node.o: ../../include/msg.h
postconf_node.o: ../../include/myflock.h
postconf_node.o: ../../include/mymalloc.h
postconf_node.o: ../../include/name_code.h
postconf_node.o: ../../include/sys_defs.h
postconf_node.o: ../../include/vbuf.h
postconf_node.o: ../../include/vstream.h
postconf_node.o: ../../include/vstring.h
postconf_node.o: postconf.h
postconf_node.o: postconf_node.c
postconf_other.o: ../../include/argv.h
postconf_other.o: ../../include/check_arg.h
postconf_other.o: ../../include/dict.h
postconf_other.o: ../../include/dns.h
postconf_other.o: ../../include/htable.h
postconf_other.o: ../../include/mbox_conf.h
postconf_other.o: ../../include/msg.h
postconf_other.o: ../../include/myaddrinfo.h
postconf_other.o: ../../include/myflock.h
postconf_other.o: ../../include/name_code.h
postconf_other.o: ../../include/name_mask.h
postconf_other.o: ../../include/sock_addr.h
postconf_other.o: ../../include/sys_defs.h
postconf_other.o: ../../include/tls.h
postconf_other.o: ../../include/vbuf.h
postconf_other.o: ../../include/vstream.h
postconf_other.o: ../../include/vstring.h
postconf_other.o: ../../include/xsasl.h
postconf_other.o: postconf.h
postconf_other.o: postconf_other.c
postconf_print.o: ../../include/argv.h
postconf_print.o: ../../include/check_arg.h
postconf_print.o: ../../include/dict.h
postconf_print.o: ../../include/htable.h
postconf_print.o: ../../include/msg.h
postconf_print.o: ../../include/myflock.h
postconf_print.o: ../../include/name_code.h
postconf_print.o: ../../include/sys_defs.h
postconf_print.o: ../../include/vbuf.h
postconf_print.o: ../../include/vstream.h
postconf_print.o: ../../include/vstring.h
postconf_print.o: postconf.h
postconf_print.o: postconf_print.c
postconf_service.o: ../../include/argv.h
postconf_service.o: ../../include/check_arg.h
postconf_service.o: ../../include/dict.h
postconf_service.o: ../../include/htable.h
postconf_service.o: ../../include/mail_params.h
postconf_service.o: ../../include/msg.h
postconf_service.o: ../../include/myflock.h
postconf_service.o: ../../include/mymalloc.h
postconf_service.o: ../../include/name_code.h
postconf_service.o: ../../include/stringops.h
postconf_service.o: ../../include/sys_defs.h
postconf_service.o: ../../include/vbuf.h
postconf_service.o: ../../include/vstream.h
postconf_service.o: ../../include/vstring.h
postconf_service.o: postconf.h
postconf_service.o: postconf_service.c
postconf_unused.o: ../../include/argv.h
postconf_unused.o: ../../include/check_arg.h
postconf_unused.o: ../../include/dict.h
postconf_unused.o: ../../include/htable.h
postconf_unused.o: ../../include/mail_conf.h
postconf_unused.o: ../../include/mail_params.h
postconf_unused.o: ../../include/msg.h
postconf_unused.o: ../../include/myflock.h
postconf_unused.o: ../../include/name_code.h
postconf_unused.o: ../../include/sys_defs.h
postconf_unused.o: ../../include/vbuf.h
postconf_unused.o: ../../include/vstream.h
postconf_unused.o: ../../include/vstring.h
postconf_unused.o: postconf.h
postconf_unused.o: postconf_unused.c
postconf_user.o: ../../include/argv.h
postconf_user.o: ../../include/check_arg.h
postconf_user.o: ../../include/dict.h
postconf_user.o: ../../include/htable.h
postconf_user.o: ../../include/mac_expand.h
postconf_user.o: ../../include/mac_parse.h
postconf_user.o: ../../include/mail_conf.h
postconf_user.o: ../../include/mail_params.h
postconf_user.o: ../../include/msg.h
postconf_user.o: ../../include/myflock.h
postconf_user.o: ../../include/mymalloc.h
postconf_user.o: ../../include/name_code.h
postconf_user.o: ../../include/stringops.h
postconf_user.o: ../../include/sys_defs.h
postconf_user.o: ../../include/vbuf.h
postconf_user.o: ../../include/vstream.h
postconf_user.o: ../../include/vstring.h
postconf_user.o: postconf.h
postconf_user.o: postconf_user.c
|