~ubuntu-branches/ubuntu/dapper/sendmail/dapper-security

« back to all changes in this revision

Viewing changes to debian/local/update_db.in

  • Committer: Bazaar Package Importer
  • Author(s): Richard A Nelson (Rick)
  • Date: 2004-12-15 19:30:00 UTC
  • Revision ID: james.westby@ubuntu.com-20041215193000-3v70qonkis3occ36
Tags: 8.13.2-1
* New upstream release
  - DB termination before exit (vacation, mail.local)
  - threading for milter
  - DNS for IPv6 and SASL
  - Cyrus IMAP LMTP and AUTH
  - see Changelog for the details
* Refresh FAQ

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#-----------------------------------------------------------------------------
 
3
#
 
4
# $Sendmail: update_db,v @sm_version@ @sm_date@ @sm_time@ cowboy Exp $
 
5
#
 
6
# Update Sendmail databases for Debian
 
7
#
 
8
# Copyright (c) 1998-@SM_CPYRT@ Richard Nelson.  All Rights Reserved.
 
9
#
 
10
# Notes (to all):
 
11
#       * assumes makemap dbtype /etc/mail/database < /etc/mail/database
 
12
#
 
13
# Notes (to self):
 
14
#       * changes made herein *must* be reflected in
 
15
#               parse_mc,update_mk,update_db,debian.m4
 
16
#       * multiple db options not supported
 
17
#       * userdb can also have multiple databases and then a forward!
 
18
#       * need sendmail stop/start
 
19
#
 
20
#-----------------------------------------------------------------------------
 
21
set -e;
 
22
 
 
23
# List of db files/features/etc
 
24
db_files="databases Makefile crontab QUEUE_GROUP sendmail.cf submit.cf \
 
25
                confCR_FILE confCT_FILE confCW_FILE confUSERDB_SPEC \
 
26
                access_db authinfo bitdomain domaintable \
 
27
                genericstable mailertable uucpdomain \
 
28
                use_cw_file use_ct_file virtusertable ALIAS_FILE";
 
29
 
 
30
# Path to other sendmail helpers
 
31
if [ -x ./update_sendmail ]; then
 
32
        sm_path='.';
 
33
elif [ -x $(dirname $0)/update_sendmail ]; then
 
34
        sm_path=$(dirname $0);
 
35
else
 
36
        sm_path=@datadir@/sendmail;
 
37
        fi;
 
38
# Bring in sendmail.conf for the network definitions
 
39
if [ ! -f @sysconfdir@/mail/sendmail.conf ]; then
 
40
        if [ -x $sm_path/update_conf ]; then
 
41
                $sm_path/update_conf;
 
42
                fi;
 
43
        fi; 
 
44
if [ -f @sysconfdir@/mail/sendmail.conf ]; then
 
45
        . @sysconfdir@/mail/sendmail.conf;
 
46
        fi;
 
47
if [ "$HANDS_OFF" != 'No' ]; then
 
48
        exit 0;
 
49
        fi;
 
50
 
 
51
# control amount of output
 
52
verbosity=0;
 
53
 
 
54
# flag used to ensure only one newaliases command is run
 
55
newaliases_run=0;
 
56
 
 
57
# flag used to indicate a dataset has been moved, may need another update
 
58
changed=0;
 
59
 
 
60
# max return code
 
61
max_rc=0;
 
62
missing_rqd=0;
 
63
missing_opt=0;
 
64
missing_cre=0;
 
65
m4_errors=0;
 
66
 
 
67
#-------------------------------------------------------------
 
68
# Initial update of sendmail.mc/databases
 
69
#-------------------------------------------------------------
 
70
initial () {
 
71
        if [ $verbosity -gt 1 ]; then
 
72
                echo "initial()";
 
73
                fi;
 
74
        # Sigh... I wish this was in Perl...
 
75
        $sm_path/parse_mc || true;
 
76
        };
 
77
 
 
78
#-------------------------------------------------------------
 
79
# Handle found databases
 
80
#-------------------------------------------------------------
 
81
is_found () {
 
82
        if [ $verbosity -gt 1 ]; then
 
83
                echo "is_found: $dbfeat - $dbname";
 
84
                fi;
 
85
        process=1;
 
86
 
 
87
        case "$dbfeat" in
 
88
                ALIAS_FILE)
 
89
                        if [ -f @sysconfdir@/mail/aliases ] & [ ! -f /etc/aliases ]; then
 
90
                                echo "Moving @sysconfdir@/mail/aliases to /etc/aliases";
 
91
                                mv @sysconfdir@/mail/aliases /etc/aliases;
 
92
                                ln -sf ../aliases @sysconfdir@/mail/aliases;
 
93
                                fi;
 
94
                        ;;
 
95
                submit.cf)
 
96
                        if [ ! -f @datadir@/sendmail/cf/feature/msp.m4 ]; then
 
97
                                rm -f @sysconfdir@/mail/submit.cf 2>/dev/null;
 
98
                                rm -f @sysconfdir@/mail/submit.cf.errors 2>/dev/null;
 
99
                                process=0;
 
100
                                fi;
 
101
                        ;;
 
102
                *)
 
103
                        ;;
 
104
                esac;
 
105
        };
 
106
 
 
107
#-------------------------------------------------------------
 
108
# Handle missing databases:
 
109
#        moving  /etc/xxx to /etc/mail/xxx
 
110
#        rename  /etc/mail/xxx to /etc/mail/yyy
 
111
#-------------------------------------------------------------
 
112
move_file () {
 
113
        if [ -f $1 ]; then
 
114
                if [ ! -L $1 ]; then
 
115
                        echo "Moving $1 to $dbname.";
 
116
                        mv $1 $dbname;
 
117
                        chown root:smmsp $dbname;
 
118
                        chmod 0644 $dbname;
 
119
                        if [ -f $1.db ]; then
 
120
                                mv -f /etc/$1.db  $dbname.db;
 
121
                                fi;
 
122
                        if [ -f $1.pag ]; then
 
123
                                mv -f /etc/$1.pag $dbname.pag;
 
124
                                fi;
 
125
                        if [ -f $1.dir ]; then
 
126
                                mv -f /etc/$1.dir $dbname.dir;
 
127
                                fi;
 
128
                        changed=1;
 
129
                        process=1;
 
130
                else
 
131
                        echo "$1 is a link, move it to $dbname";
 
132
                        if [ "$dbopts" = "-o" ]; then
 
133
                                missing_opt=`expr $missing_opt + 1`;
 
134
                        else
 
135
                                missing_rqd=`expr $missing_rqd + 1`;
 
136
                                fi;
 
137
                        fi;
 
138
                true;
 
139
        else
 
140
                false;
 
141
                fi;
 
142
        };
 
143
 
 
144
rename_file () {
 
145
        if [ -f @sysconfdir@/mail/$1 ]; then
 
146
                echo "Renaming @sysconfdir@/mail/$1 to $dbname.";
 
147
                mv @sysconfdir@/mail/$1 $dbname;
 
148
                chown root:smmsp $dbname;
 
149
                chmod 0644 $dbname;
 
150
                changed=1;
 
151
                process=1;
 
152
                true;
 
153
        else
 
154
                false;
 
155
                fi;
 
156
        };
 
157
 
 
158
is_not_found () {
 
159
        if [ $verbosity -gt 1 ]; then
 
160
                echo "is_not_found: $dbfeat - $dbname";
 
161
                fi;
 
162
 
 
163
        case "$dbfeat" in
 
164
                databases|Makefile)
 
165
                        :;
 
166
                        ;;
 
167
                use_cw_file|confCW_FILE)
 
168
                        if move_file /etc/local-host-names; then
 
169
                                :;
 
170
                        elif rename_file sendmail.cw; then
 
171
                                :;
 
172
                        elif move_file /etc/sendmail.cw; then
 
173
                                :;
 
174
                        else
 
175
                                missing_cre=`expr $missing_cre + 1`;
 
176
                                echo "Warning: $dbfeat source" \
 
177
                                        "file not found: $dbname";
 
178
                                echo " it was created";
 
179
                                echo "localhost" > $dbname;
 
180
                                echo `hostname -f` >> $dbname;
 
181
                                chown root:smmsp $dbname;
 
182
                                chmod 0644 $dbname;
 
183
                                fi;
 
184
                        ;;
 
185
                use_ct_file|confCT_FILE)
 
186
                        if move_file /etc/trusted-users; then
 
187
                                :;
 
188
                        elif rename_file sendmail.ct; then
 
189
                                :;
 
190
                        elif move_file /etc/sendmail.ct; then
 
191
                                :;
 
192
                        else
 
193
                                missing_cre=`expr $missing_cre + 1`;
 
194
                                echo "Warning: $dbfeat source" \
 
195
                                        "file not found: $dbname";
 
196
                                echo " it was created";
 
197
                                touch $dbname;
 
198
                                chown root:smmsp $dbname;
 
199
                                chmod 0644 $dbname;
 
200
                                fi;
 
201
                        ;;
 
202
                HELP_FILE)
 
203
                        if move_file /etc/sendmail.hf; then
 
204
                                :;
 
205
                        elif rename_file sendmail.hf; then
 
206
                                :;
 
207
                        else
 
208
                                echo "Error: $dbfeat source file not found: $dbname";
 
209
                                missing_rqd=`expr $missing_rqd + 1`;
 
210
                                process=0;
 
211
                                fi;
 
212
                        ;;
 
213
                ALIAS_FILE)
 
214
                        if [ -e /etc/$dbsname ]; then
 
215
                                echo "Linking /etc/$dbsname to $dbname";
 
216
                                ln -sf ../$dbsname $dbname;
 
217
                                if [ -f /etc/$dbsname.db ]; then
 
218
                                        mv /etc/$dbsname.db @sysconfdir@/mail;
 
219
                                        fi;
 
220
                                if [ -f /etc/$dbsname.pag ]; then
 
221
                                        mv /etc/$dbsname.pag @sysconfdir@/mail;
 
222
                                        fi;
 
223
                                if [ -f /etc/$dbsname.dir ]; then
 
224
                                        mv /etc/$dbsname.dir @sysconfdir@/mail;
 
225
                                        fi;
 
226
                        elif [ "$dbopts" = "-o" ]; then
 
227
                                echo "Informational: $dbfeat source" \
 
228
                                        "file not found: $dbname";
 
229
                                missing_opt=`expr $missing_opt + 1`;
 
230
                                process=0;
 
231
                        else
 
232
                                echo "Error: $dbfeat source file not found: $dbname";
 
233
                                missing_rqd=`expr $missing_rqd + 1`;
 
234
                                process=0;
 
235
                                fi;
 
236
                        ;;
 
237
                *.cf)
 
238
                        mcfile=$(echo "$dbsname" | sed -e 's/\..*//')
 
239
                        if move_file /etc/$dbsname; then
 
240
                                  if [ -f @sysconfdir@/${mcfile}.cf ]; then
 
241
                                          mv -f @sysconfdir@/${mcfile}.cf  @sysconfdir@/mail/;
 
242
                                          fi;
 
243
                        elif [ "$mcfile" = "sendmail" ]; then
 
244
                                cp @datadir@/sendmail/cf/debian/sendmail.mc \
 
245
                                        $dbname;
 
246
                                chown root:smmsp $dbname;
 
247
                                chmod 0644 $dbname;
 
248
                        elif [ "$mcfile" = "submit" ]; then
 
249
                                cp @datadir@/sendmail/cf/debian/submit.mc \
 
250
                                        $dbname;
 
251
                                chown root:smmsp $dbname;
 
252
                                chmod 0644 $dbname;
 
253
                        elif [ "$dbopts" = "-o" ]; then
 
254
                                echo "Informational: $dbfeat source" \
 
255
                                        "file not found: $dbname";
 
256
                                missing_opt=`expr $missing_opt + 1`;
 
257
                                process=0;
 
258
                        else
 
259
                                echo "Error: $dbfeat source file not found: $dbname";
 
260
                                missing_rqd=`expr $missing_rqd + 1`;
 
261
                                process=0;
 
262
                                fi;
 
263
                        ;;
 
264
                QUEUE_GROUP)
 
265
                        echo "Warning: $dbfeat source" \
 
266
                                        "file not found: $dbname";
 
267
                                echo " it was created";
 
268
                        mkdir -p $dbname;
 
269
                        chown root:smmsp $dbname;
 
270
                        chmod 02750 $dbname;
 
271
                        ;;
 
272
                crontab)
 
273
                        if [ -x $sm_path/update_conf ]; then
 
274
                                $sm_path/update_conf;
 
275
                                fi;
 
276
                        ;;
 
277
                access_db)
 
278
                        missing_cre=`expr $missing_cre + 1`;
 
279
                        echo "Warning: $dbfeat source" \
 
280
                                "file not found: $dbname";
 
281
                        echo " it was created";
 
282
                        cp @datadir@/sendmail/examples/db/access \
 
283
                                @sysconfdir@/mail/;
 
284
                        chown root:root $dbname;
 
285
                        chmod 0644 $dbname;
 
286
                        ;;
 
287
                *)
 
288
                        if move_file /etc/$dbsname; then
 
289
                                :;
 
290
                        elif [ "$dbopts" = "-o" ]; then
 
291
                                :;
 
292
                        else
 
293
                                missing_cre=`expr $missing_cre + 1`;
 
294
                                echo "Warning: $dbfeat source" \
 
295
                                        "file not found: $dbname";
 
296
                                echo " it was created";
 
297
                                touch $dbname;
 
298
                                chown root:smmsp $dbname;
 
299
                                chmod 0644 $dbname;
 
300
                                fi;
 
301
                        ;;
 
302
                esac;
 
303
        };
 
304
 
 
305
#-------------------------------------------------------------
 
306
# Handle empty databases
 
307
#-------------------------------------------------------------
 
308
is_empty () {
 
309
        if [ $verbosity -gt 1 ]; then
 
310
                echo "is_empty: $dbfeat - $dbname";
 
311
                fi;
 
312
        if [ $process -eq 1 ]; then
 
313
                if [ "$dbtype" != "-" ]; then
 
314
                        rm -f $dbname.db;
 
315
                        rm -f $dbname.pag;
 
316
                        rm -f $dbname.dir;
 
317
                        fi;
 
318
                case "$dbfeat" in
 
319
                        databases|Makefile)
 
320
                                :;
 
321
                                ;;
 
322
                        access_db)
 
323
                                cp @datadir@/sendmail/examples/db/access \
 
324
                                        @sysconfdir@/mail/;
 
325
                                chown root:root $dbname;
 
326
                                chmod 0644 $dbname;
 
327
                                ;;
 
328
                        *)
 
329
                                echo "Informational: $dbfeat file empty: $dbname";
 
330
                                if [ "$dbopts" = "-o" ]; then
 
331
                                        process=0;
 
332
                                        fi;
 
333
                                ;;
 
334
                        esac;
 
335
                fi;
 
336
        };
 
337
 
 
338
#-------------------------------------------------------------
 
339
# Handle no data (exists, but is only comments) databases
 
340
#-------------------------------------------------------------
 
341
is_comments () {
 
342
        if [ $verbosity -gt 1 ]; then
 
343
                echo "is_comments: $dbfeat - $dbname";
 
344
                fi;
 
345
        if [ $process -eq 1 ] && [ -s "$dbname" ]; then
 
346
                if [ "$dbtype" != "-" ]; then
 
347
                        rm -f $dbname.db;
 
348
                        rm -f $dbname.pag;
 
349
                        rm -f $dbname.dir;
 
350
                        fi;
 
351
                case "$dbfeat" in
 
352
                        databases|Makefile)
 
353
                                :;
 
354
                                ;;
 
355
                        *)
 
356
                                echo "Informational: $dbfeat no data: $dbname";
 
357
                                if [ "$dbopts" = "-o" ]; then
 
358
                                        process=0;
 
359
                                        fi;
 
360
                                ;;
 
361
                        esac;
 
362
                fi;
 
363
        };
 
364
 
 
365
#-------------------------------------------------------------
 
366
# Handle normal databases (exists, has data)
 
367
#-------------------------------------------------------------
 
368
is_normal () {
 
369
        if [ $verbosity -gt 1 ]; then
 
370
                echo "is_normal: $dbfeat - $dbname";
 
371
                fi;
 
372
 
 
373
        # Make sure sensitive databases are *not* generally readable
 
374
        if [ "$dbsname" = "authinfo" ] \
 
375
        || [ "$dbsname" = "access" ]; then
 
376
                chmod go-rwx $dbname;
 
377
                fi;
 
378
 
 
379
        if [ $process -eq 1 ] && [ $max_rc -eq 0 ]; then
 
380
                case "$dbtype" in
 
381
                        '-'|text|ldap)
 
382
                                :;
 
383
                                ;;
 
384
                        parse_mc)
 
385
                                $sm_path/parse_mc || true;
 
386
                                ;;
 
387
                        update_conf)
 
388
                                $sm_path/update_conf || true;
 
389
                                ;;
 
390
                        update_mk)
 
391
                                $sm_path/update_mk || true;
 
392
                                ;;
 
393
                        btree)
 
394
                                echo "Updating $dbname...";
 
395
                                @sbindir@/makemap -d $dbtype $dbname.new.db < $dbname;
 
396
                                chown root:smmsp $dbname.new.db;
 
397
                                chmod 0644 $dbname.new.db;
 
398
                                mv -f $dbname.new.db $dbname.db;
 
399
                                ;;
 
400
                        dbm | btree | hash)
 
401
                                echo "Updating $dbname...";
 
402
                                @sbindir@/makemap $dbtype $dbname.new.db < $dbname;
 
403
                                if [ "$dbsname" = "authinfo" ] \
 
404
                                || [ "$dbsname" = "access" ]; then
 
405
                                        chown smmta:smmsp $dbname.new.db;
 
406
                                        chmod 0640 $dbname.new.db;
 
407
                                else
 
408
                                        chown root:smmsp $dbname.new.db;
 
409
                                        chmod 0640 $dbname.new.db;
 
410
                                        fi;
 
411
                                mv -f $dbname.new.db $dbname.db;
 
412
                                ;;
 
413
                        newaliases)
 
414
                                echo "Updating $dbname...";
 
415
                                if [ $newaliases_run -eq 0 ]; then
 
416
                                        newaliases_run=1;
 
417
                                        @libexecdir@/newaliases || true;
 
418
                                        fi;
 
419
                                if [ -f $dbname.db ]; then
 
420
                                        chown smmta:smmsp $dbname.db;
 
421
                                        chmod 0640 $dbname.db;
 
422
                                        fi;
 
423
                                ;;
 
424
                        m4)
 
425
                                mcfile=$(echo "$dbsname" | sed -e 's/\..*//');
 
426
                                echo "Creating @sysconfdir@/mail/${mcfile}.cf...";
 
427
                                rm -f @sysconfdir@/mail/${mcfile}.cf.errors;
 
428
                                m4 @sysconfdir@/mail/${mcfile}.mc \
 
429
                                   > @sysconfdir@/mail/${mcfile}.cf.new \
 
430
                                   2> @sysconfdir@/mail/${mcfile}.cf.errors || true;
 
431
                                echo "### @sysconfdir@/mail/${mcfile}.mc ###" \
 
432
                                        >> @sysconfdir@/mail/${mcfile}.cf.new;
 
433
                                sed -e 's/^/# /' @sysconfdir@/mail/${mcfile}.mc \
 
434
                                        >> @sysconfdir@/mail/${mcfile}.cf.new;
 
435
                                chown root:smmsp @sysconfdir@/mail/${mcfile}.cf.new;
 
436
                                chmod 0644 @sysconfdir@/mail/${mcfile}.cf.new;
 
437
                                if [ ! -s @sysconfdir@/mail/${mcfile}.cf.errors ]; then
 
438
                                        rm -f @sysconfdir@/mail/${mcfile}.cf.errors;
 
439
                                else
 
440
                                        chown root:smmsp @sysconfdir@/mail/${mcfile}.cf.errors;
 
441
                                        cat @sysconfdir@/mail/${mcfile}.cf.errors;
 
442
                                        echo " ";
 
443
                                        m4_errors=1;
 
444
                                        fi;
 
445
                                # Can't tell if the errors are fatal or not ;-{
 
446
                                mv -f @sysconfdir@/mail/${mcfile}.cf.new \
 
447
                                        @sysconfdir@/mail/${mcfile}.cf;
 
448
                                ;;
 
449
                        *)
 
450
                                echo "$dbtype map not done herein";
 
451
                                ;;
 
452
                        esac;
 
453
                fi;
 
454
        };
 
455
 
 
456
#-------------------------------------------------------------
 
457
# Handle completion
 
458
#-------------------------------------------------------------
 
459
final () {
 
460
        if [ $verbosity -gt 1 ]; then
 
461
                echo "final()";
 
462
                fi;
 
463
        };
 
464
 
 
465
 
 
466
# status report if not for single database
 
467
if [ -z "$1" ]; then
 
468
        echo "Checking {sendmail,submit}.mc and related databases...";
 
469
else
 
470
        db_files="$1";
 
471
        fi;
 
472
 
 
473
initial;
 
474
 
 
475
for file in $db_files; do \
 
476
        line=$(grep -Ee "^[[:space:]]*$file" \
 
477
                @sysconfdir@/mail/databases || true);
 
478
        while ([ "$line" != "" ]); do
 
479
                str=$(echo "$line" | cut -d "
 
480
" -f 1);
 
481
                line=$(echo "$line" | cut -d "
 
482
" -f 2-);
 
483
 
 
484
                # Strip line back into four pieces: feature, type, opts, name
 
485
                dbfeat=$(echo "$str" | cut -d ":" -f 1);
 
486
                dbtype=$(echo "$str" | cut -d ":" -f 2);
 
487
                dbopts=$(echo "$str" | cut -d ":" -f 3);
 
488
                dbname=$(echo "$str" | cut -d ":" -f 4);
 
489
                dbregx=$(echo "$str" | cut -d ":" -f 5);
 
490
                if [ $(dirname "$dbname") = "@sysconfdir@/mail" ]; then
 
491
                        dbsname=$(basename "$dbname");
 
492
                elif [ $(dirname "$dbname") = "@sysconfdir@" ]; then
 
493
                        dbsname=$(basename "$dbname");
 
494
                else
 
495
                        dbsname="$dbname";
 
496
                        fi;
 
497
                if [ "$dbopts" = "-" ]; then
 
498
                        dbopts="";
 
499
                        fi;
 
500
                if [ "$dbregx" = "-" ]; then
 
501
                        dbregx="";
 
502
                        fi;
 
503
 
 
504
                # Check to see if we're doing one, or all
 
505
                if [ ! -z "$1" ]; then
 
506
                        if [ "$1" = "$dbfeat" ] \
 
507
                        || [ "$1" = "$dbname" ] \
 
508
                        || [ "$1" = "$dbsname" ]; then
 
509
                                :;
 
510
                        else
 
511
                                continue;
 
512
                                fi;
 
513
                        fi;
 
514
 
 
515
                # Check for special database types
 
516
                case "$dbtype" in
 
517
                        ldap)
 
518
                                if [ $verbosity -gt 0 ]; then
 
519
                                        echo "Skipping $dbname...";
 
520
                                        fi;
 
521
                                continue
 
522
                                ;;
 
523
                        dbm | btree | hash)
 
524
                                if [ ! -x @libexecdir@/makemap ]; then
 
525
                                        echo "Delaying $dbname...";
 
526
                                        continue;
 
527
                                        fi;
 
528
                                ;;
 
529
                        newaliases)
 
530
                                if [ ! -x @libexecdir@/newaliases ]; then
 
531
                                        echo "Delaying $dbname...";
 
532
                                        continue;
 
533
                                        fi;
 
534
                                ;;
 
535
                        *)
 
536
                                ;;
 
537
                        esac;
 
538
 
 
539
                # Kluge for aliases...
 
540
                if [ "$dbname" = "ldap" ]; then
 
541
                        continue;
 
542
                        fi;
 
543
 
 
544
                process=1;
 
545
                if [ $verbosity -gt 0 ]; then
 
546
                        echo "Processing $dbname...";
 
547
                        fi;
 
548
 
 
549
                # Check for database existance
 
550
                if [ -f "$dbname" ] || [ -d "$dbname" ]; then
 
551
                        is_found;
 
552
                else
 
553
                        is_not_found;
 
554
                        fi;
 
555
 
 
556
                # Skip the rest for directories
 
557
                if [ ! -d "$dbname" ]; then
 
558
 
 
559
                        # Check for something in database
 
560
                        if [ ! -s "$dbname" ]; then
 
561
                                is_empty;
 
562
                                fi;
 
563
 
 
564
                        # Check for real data (not just comments)
 
565
                        if [ $process -eq 1 ]; then
 
566
                                if ! grep -qEe "^[[:space:]]*[^$\#]" $dbname; then
 
567
                                        is_comments;
 
568
                                        fi;
 
569
                                fi;
 
570
 
 
571
                        # Finally, assume a normal file...
 
572
                        is_normal;
 
573
                        fi;
 
574
 
 
575
                done;
 
576
        done;
 
577
 
 
578
final;
 
579
 
 
580
# Final notices...
 
581
if [ $changed -ne 0 ]; then
 
582
        echo " ";
 
583
        echo "Informational: Some changes were made to file locations";
 
584
        echo "  Make sure sendmail.cf is rebuilt";
 
585
        if [ $max_rc -lt 1 ]; then
 
586
                max_rc=1;
 
587
                fi;
 
588
        fi;
 
589
if [ $missing_opt -ne 0 ]; then
 
590
        echo " ";
 
591
        echo "Informational: $missing_opt optional database(s) sources";
 
592
        echo "  were not found, please investigate.";  
 
593
        fi;
 
594
if [ $missing_cre -ne 0 ]; then
 
595
        echo " ";
 
596
        echo "Warning: $missing_cre database(s) sources";
 
597
        echo "  were not found, (but were created)";
 
598
        echo "  please investigate.";
 
599
        fi;
 
600
if [ $missing_rqd -ne 0 ]; then
 
601
        echo " ";
 
602
        echo "Error: $missing_rqd required database(s) sources";
 
603
        echo "  were not found, correct this before starting sendmail!";
 
604
        if [ $max_rc -lt 2 ]; then
 
605
                max_rc=2;
 
606
                fi;
 
607
        fi;
 
608
if [ $missing_opt -ne 0 ] || [ $missing_rqd -ne 0 ]; then
 
609
        echo " ";
 
610
        echo "$0 assumes that databases, and their source datasets";
 
611
        echo "have the same base name (not counting the .db).  If this is not";
 
612
        echo "true, $0 can not rebuild your databases to make sure";
 
613
        echo "they will work with the newer sendmail.  You will have to do this";
 
614
        echo "yourself - before starting sendmail.";
 
615
        echo " ";
 
616
        fi;
 
617
if [ $m4_errors -ne 0 ]; then
 
618
        echo " ";
 
619
        echo "Warning: These messages were issued while creating sendmail.cf";
 
620
        echo "  make sure they are benign before starting sendmail!";
 
621
        echo " ";
 
622
        if [ -f @sysconfdir@/mail/sendmail.cf.errors ]; then
 
623
                echo "Errors in generating sendmail.cf";
 
624
                cat @sysconfdir@/mail/sendmail.cf.errors;
 
625
                fi;
 
626
        if [ -f @sysconfdir@/mail/submit.cf.errors ]; then
 
627
                echo "Errors in generating submit.cf";
 
628
                cat @sysconfdir@/mail/submit.cf.errors;
 
629
                fi;
 
630
        echo " "
 
631
        if [ $max_rc -lt 2 ]; then
 
632
                max_rc=2;
 
633
                fi;
 
634
        fi;
 
635
exit $max_rc;
 
636