Handle hostnames with upper-case letters
[webmin.git] / postfix / backup_config.pl
1
2 do 'postfix-lib.pl';
3
4 # backup_config_files()
5 # Returns files and directories that can be backed up
6 sub backup_config_files
7 {
8 local @rv;
9
10 # Add main config file
11 push(@rv, $config{'postfix_config_file'});
12
13 # Add known map files
14 push(@rv, &get_maps_files("alias_maps"));
15 push(@rv, &get_maps_files("alias_database"));
16 push(@rv, &get_maps_files("canonical_maps"));
17 push(@rv, &get_maps_files("recipient_canonical_maps"));
18 push(@rv, &get_maps_files("sender_canonical_maps"));
19 push(@rv, &get_maps_files($virtual_maps));
20 push(@rv, &get_maps_files("transport_maps"));
21 push(@rv, &get_maps_files("relocated_maps"));
22
23 # Add other files in /etc/postfix
24 local $cdir = &guess_config_dir();
25 opendir(DIR, $cdir);
26 foreach $f (readdir(DIR)) {
27         next if ($f eq "." || $f eq ".." || $f =~ /\.(db|dir|pag)$/i);
28         push(@rv, "$cdir/$f");
29         }
30 closedir(DIR);
31
32 return &unique(@rv);
33 }
34
35 # pre_backup(&files)
36 # Called before the files are actually read
37 sub pre_backup
38 {
39 return undef;
40 }
41
42 # post_backup(&files)
43 # Called after the files are actually read
44 sub post_backup
45 {
46 return undef;
47 }
48
49 # pre_restore(&files)
50 # Called before the files are restored from a backup
51 sub pre_restore
52 {
53 return undef;
54 }
55
56 # post_restore(&files)
57 # Called after the files are restored from a backup
58 sub post_restore
59 {
60 if (&is_postfix_running()) {
61         local $out = `$config{'postfix_control_command'} -c $config_dir reload 2>&1`;
62         return "<tt>$out</tt>" if ($?);
63         }
64 return undef;
65 }
66
67 1;
68