]> git.proxmox.com Git - pmg-docs.git/blame - gen-pmg.conf.5-opts.pl
pmgconfig.adoc: document mail-options
[pmg-docs.git] / gen-pmg.conf.5-opts.pl
CommitLineData
f872534d
DM
1#!/usr/bin/perl
2
3use lib '.';
4use strict;
5use warnings;
6use PVE::RESTHandler;
7
8use Data::Dumper;
9
10use PMG::Config;
11
12my $types = PMG::Config::Base->lookup_types;
13
7608b70c
DM
14my $single_section = shift;
15my $found = 0;
16
e09057ab 17my $key_groups = {
e3d778e0
DM
18 'mail-options' => [
19 'mail' , {
20 maxsize => 1,
21 rejectunknown => 1,
22 rejectunknownsender => 1,
23 helotests => 1,
24 dnsbl_sites => 1,
25 verifyreceivers => 1,
26 greylist => 1,
27 spf => 1,
28 hide_received => 1,
29 dwarning => 1,
30 conn_count_limit => 1,
31 conn_rate_limit => 1,
32 message_rate_limit => 1,
33 banner => 1,
34 }],
d9c56b22
DM
35 'mail-ports' => [
36 'mail' , {
37 int_port => 1,
38 ext_port => 1,
39 }],
e09057ab
DM
40 'mail-relaying' => [
41 'mail' , {
42 relay => 1,
43 relaynomx => 1,
44 relayport => 1,
45 smarthost => 1,
46 }],
47};
48
49my $select_keys;
50
51if ($single_section) {
52 if (my $a = $key_groups->{$single_section}) {
53 my ($sec, $hash) = @$a;
54 $single_section = $sec;
55 $select_keys = $hash;
56 }
57}
58
59
f872534d
DM
60foreach my $section (@$types) {
61 my $plugin = PMG::Config::Base->lookup($section);
62 my $schema = $plugin->updateSchema(1);
63 my $properties = $schema->{properties};
7608b70c
DM
64
65 if (defined($single_section)) {
66 next if $section ne $single_section;
67 } else {
68 print ".Section '$section'\n\n";
69 }
70
71 $found = 1;
a18c67c0
DM
72
73 my $filter = sub {
74 my ($key, $phash) = @_;
75 return 1 if $key eq 'digest';
76 return 1 if $key eq 'delete';
e09057ab 77 return 1 if $select_keys && !$select_keys->{$key};
a18c67c0
DM
78 return 0;
79 };
f872534d 80
a18c67c0
DM
81 print PVE::RESTHandler::dump_properties(
82 $properties, 'asciidoc', 'config', $filter);
f872534d 83}
7608b70c
DM
84
85if (defined($single_section)) {
86 die "no such section '$single_section'" if !$found;
87}
f872534d
DM
88
89exit(0);