}
}
}
- die "package '$pkgname' version '$param->{version}' is not avalable\n" if !$ver;
+ die "package '$pkgname' version '$param->{version}' is not available\n" if !$ver;
} else {
$ver = $policy->candidate($p) || die "no installation candidate for package '$pkgname'\n";
}
path => 'nodes',
method => 'GET',
description => "Cluster node index.",
- # alway read local file
+ # always read local file
parameters => {
additionalProperties => 0,
properties => {},
path => 'status',
method => 'GET',
description => "Cluster node status.",
- # alway read local file
+ # always read local file
parameters => {
additionalProperties => 0,
properties => {
path => 'create',
method => 'POST',
description => "Create initial cluster config with current node as master.",
- # alway read local file
+ # always read local file
parameters => {
additionalProperties => 0,
properties => {},
path => 'join',
method => 'POST',
description => "Join local node to an existing cluster.",
- # alway read local file
+ # always read local file
protected => 1,
parameters => {
additionalProperties => 0,
starttime => get_standard_option('pmg-starttime'),
endtime => get_standard_option('pmg-endtime'),
id => {
- description => "Mail ID (as returend by the list API).",
+ description => "Mail ID (as returned by the list API).",
type => 'string',
minLength => 3,
maxLength => 64,
optional => 1,
},
bridge_ports => {
- description => "Specify the iterfaces you want to add to your bridge.",
+ description => "Specify the interfaces you want to add to your bridge.",
optional => 1,
type => 'string', format => 'pve-iface-list',
},
ovs_ports => {
- description => "Specify the iterfaces you want to add to your bridge.",
+ description => "Specify the interfaces you want to add to your bridge.",
optional => 1,
type => 'string', format => 'pve-iface-list',
},
my $pmail;
if ($role eq 'quser') {
$pmail = $extract_pmail->($authuser, $role);
- raise_param_exc({ pmail => "parameter not allwed with role '$role'"})
+ raise_param_exc({ pmail => "parameter not allowed with role '$role'"})
if defined($pmail_param) && ($pmail ne $pmail_param);
} else {
raise_param_exc({ pmail => "parameter required with role '$role'"})
};
my $pmail_param_type = get_standard_option('pmg-email-address', {
- description => "List entries for the user with this primary email address. Quarantine users cannot speficy this parameter, but it is required for all other roles.",
+ description => "List entries for the user with this primary email address. Quarantine users cannot specify this parameter, but it is required for all other roles.",
optional => 1,
});
path => 'quarusers',
method => 'GET',
permissions => { check => [ 'admin', 'qmanager', 'audit'] },
- description => "Get a list of users with whitelist/blacklist setttings.",
+ description => "Get a list of users with whitelist/blacklist settings.",
parameters => {
additionalProperties => 0,
properties => {
additionalProperties => 0,
properties => {
id => {
- description => 'Unique IDs, seperate with ;',
+ description => 'Unique IDs, separate with ;',
type => 'string',
pattern => 'C\d+R\d+T\d+(;C\d+R\d+T\d+)*',
},
Data => $text,
);
- # we use an empty envelope sender (we dont want to receive NDRs)
+ # we use an empty envelope sender (we don't want to receive NDRs)
PMG::Utils::reinject_mail ($mail, '', [$receiver], undef, $fqdn);
}
maximum => 100,
},
direction => {
- description => "Rule direction. Value `0` matches incomming mails, value `1` matches outgoing mails, and value `2` matches both directions.",
+ description => "Rule direction. Value `0` matches incoming mails, value `1` matches outgoing mails, and value `2` matches both directions.",
type => 'integer',
minimum => 0,
maximum => 2,
optional => 1,
},
direction => {
- description => "Rule direction. Value `0` matches incomming mails, value `1` matches outgoing mails, and value `2` matches both directions.",
+ description => "Rule direction. Value `0` matches incoming mails, value `1` matches outgoing mails, and value `2` matches both directions.",
type => 'integer',
minimum => 0,
maximum => 2,
my $realcmd = sub {
my $upid = shift;
- syslog('info', "stoping service $param->{service}: $upid\n");
+ syslog('info', "stopping service $param->{service}: $upid\n");
PMG::Utils::service_cmd($param->{service}, 'stop');
PMG::Config::postmap_pmg_transport();
};
- PMG::Config::lock_config($code, "delete transport map extry failed");
+ PMG::Config::lock_config($code, "delete transport map entry failed");
return undef;
}});
}
sub DESTROY {
- # dont close atomatically (explicit close required to commit changes)
+ # don't close automatically (explicit close required to commit changes)
}
1;
# dump the database first
my $fh = PMG::AtomicFile->open("$dirname/$dbfn", "w") ||
- die "cant open '$dirname/$dbfn' - $! :ERROR";
+ die "can't open '$dirname/$dbfn' - $! :ERROR";
dumpdb($fh);
if ($include_statistics) {
# dump the statistic db
my $sfh = PMG::AtomicFile->open("$dirname/$statfn", "w") ||
- die "cant open '$dirname/$statfn' - $! :ERROR";
+ die "can't open '$dirname/$statfn' - $! :ERROR";
dumpstatdb($sfh);
my $release = PMG::pmgcfg::release();
my $vfh = PMG::AtomicFile->open ("$dirname/$verfn", "w") ||
- die "cant open '$dirname/$verfn' - $! :ERROR";
+ die "can't open '$dirname/$verfn' - $! :ERROR";
$time = time;
my $now = localtime;
my $cfg = PMG::Config->new();
my $email = $cfg->get ('admin', 'email');
if (!$email) {
- warn "not sending notifcation: no admin email configured\n";
+ warn "not sending notification: no admin email configured\n";
return;
}
name => 'sync',
path => 'sync',
method => 'POST',
- description => "Syncronize Proxmox Mail Gateway configurations with system configuration.",
+ description => "Synchronize Proxmox Mail Gateway configurations with system configuration.",
parameters => {
additionalProperties => 0,
properties => {
name => 'ldapsync',
path => 'ldapsync',
method => 'POST',
- description => "Syncronize the LDAP database.",
+ description => "Synchronize the LDAP database.",
parameters => {
additionalProperties => 0,
properties => {},
my ($param) = @_;
my $dbh = PMG::DBTools::open_ruledb("Proxmox_ruledb");
- print "Updateing Proxmox Statistic Databases... ";
+ print "Updating Proxmox Statistic Databases... ";
my $cinfo = PVE::INotify::read_file("cluster.conf");
PMG::Statistic::update_stats($dbh, $cinfo);
print "done\n";
default => 0,
},
auto => {
- description => "Auto mode. Use setting from system configuration (set when invoked fron cron).",
+ description => "Auto mode. Use setting from system configuration (set when invoked from cron).",
type => 'boolean',
optional => 1,
default => 0,
__EOD
# user preferences (black an whitelists, ...)
-# Name: perference name ('BL' -> blacklist, 'WL' -> whitelist)
+# Name: preference name ('BL' -> blacklist, 'WL' -> whitelist)
# Data: arbitrary data
my $userprefs_ctablecmd = <<__EOD;
CREATE TABLE UserPrefs
Another example is when you have receiver specific content filters,
for example you don't want to get .exe files for a specific user, but
-allow it for everone else:
+allow it for everyone else:
Rule1: user1@domain1.com && .exe attachments --> remove attachments
Rule1: .*@domain2.com && .exe attachments --> accept
my_modify_entity ($entity, $targets);
}
-That way we seemlessly hide the fact that mails are delivered to more
-than one receipient, without the requirement to make a copy for each
-receipient (which would lead to many unnecessays notification
+That way we seamlessly hide the fact that mails are delivered to more
+than one recipient, without the requirement to make a copy for each
+recipient (which would lead to many unnecessays notification
mail). Insead we only make a minimum number of copies for specific
target groups.
=head3 $ruledb->save_object ($obj)
Save or update an object. This can be used to add new objects
-to the database (although group_add_object() is the prefered way):
+to the database (although group_add_object() is the preferred way):
$obj = PMG::RuleDB::EMail->new ('.*@mydomain.com');
# we need to set the object group manually
Counter Object
-=head2 Attribues
+=head2 Attributes
=head3 count
return undef if !$fh;
- # in memory (we cant modify the file, because
+ # in memory (we can't modify the file, because
# a.) that would modify all entities (see ModGroup)
# b.) bad performance
my $body = new MIME::Body::InCore || return undef;
A WHO object to check email domains.
-=head2 Attribues
+=head2 Attributes
=head3 address
A WHO object to check email addresses.
-=head2 Attribues
+=head2 Attributes
=head3 address
A WHO object to check sender IP addresses.
-=head2 Attribues
+=head2 Attributes
=head3 address
A WHO object to check sender IP addresses.
-=head2 Attribues
+=head2 Attributes
=head3 address
A WHO object to check LDAP groups
-=head2 Attribues
+=head2 Attributes
=head3 ldapgroup
A WHO object to check LDAP users
-=head2 Attribues
+=head2 Attributes
=head3 ldapuser
print $fh "notify content:\n";
if ($self->{attach} eq 'O') {
- # make result reproducable for regression testing
+ # make result reproducible for regression testing
$top->head->replace('content-type',
'multipart/mixed; boundary="---=_1234567"');
}
=head3 $obj->id
-Returns the unique database ID of the object. undef means the object is not jet stored in the databse.
+Returns the unique database ID of the object. undef means the object is not jet stored in the database.
=head3 $obj->final()
A WHEN object to check for a specific daytime.
-=head2 Attribues
+=head2 Attributes
=head3 start
=head1 PMG::RuleDB::WhoRegex
-A WHO object to check email addresses with regular expresssions.
+A WHO object to check email addresses with regular expressions.
-=head2 Attribues
+=head2 Attributes
=head3 address
my $start_time = [ gettimeofday() ];
- syslog ('info', "starting cluster syncronization");
+ syslog ('info', "starting cluster synchronization");
my $master_ip = $cinfo->{master}->{ip};
my $master_name = $cinfo->{master}->{name};
my $dbtime = $cptime - $rsynctime - $csynctime;
- syslog('info', sprintf("cluster syncronization finished (%d errors, %.2f seconds " .
+ syslog('info', sprintf("cluster synchronization finished (%d errors, %.2f seconds " .
"(files %.2f, database %.2f, config %.2f))",
$errcount, $cptime, $rsynctime, $dbtime, $csynctime));
my $pmg_api_cert_fn = "$basedir/pmg-api.pem";
-# this is just a secret accessable by all API servers
+# this is just a secret accessible by all API servers
# and is used for CSRF prevention
my $pmg_csrf_key_fn = "$basedir/pmg-csrf.key";
$inputfilename = '/dev/null' if !$inputfilename;
- # same algorythm as used inside SA
+ # same algorithm as used inside SA
my $fd = fileno (STDIN);
close STDIN;
$self->{mime} = {};
$self->{filenames} = {};
- $self->{ufid} = 0; # counter to creat unique file names
- $self->{udid} = 0; # counter to creat unique dir names
- $self->{ulid} = 0; # counter to creat unique link names
+ $self->{ufid} = 0; # counter to create unique file names
+ $self->{udid} = 0; # counter to create unique dir names
+ $self->{ulid} = 0; # counter to create unique link names
$self->{todo} = [];
my $ratio = $usize/$compsize;
- die "compresion ratio too large (> $self->{maxratio})"
+ die "compression ratio too large (> $self->{maxratio})"
if $ratio > $self->{maxratio};
}
my $sizediff = $csize ? $size - $csize : $size;
- die "compresion ratio too large (> $self->{maxratio})"
+ die "compression ratio too large (> $self->{maxratio})"
if $self->{maxratio} && (($self->{size} + $sizediff) > $self->{ratioquota});
die "archive too large (> $self->{quota})"
# content types (detected by magic numbers and file extension)
# Extracted files are stored inside 'tempdir'.
#
-# returns: true if file is archive, undef otherwhise
+# returns: true if file is archive, undef otherwise
sub unpack_archive {
my ($self, $filename, $ct) = @_;
optional => 1,
},
role => {
- description => "User role. Role 'root' is reseved for the Unix Superuser.",
+ description => "User role. Role 'root' is reserved for the Unix Superuser.",
type => 'string',
enum => ['root', 'admin', 'helpdesk', 'qmanager', 'audit'],
},
my $header;
my $fh = IO::File->new("<$dbfile");
if (!$fh) {
- warn "cant open ClamAV Database $dbname ($dbfile) - $!\n";
+ warn "can't open ClamAV Database $dbname ($dbfile) - $!\n";
return;
}
$fh->read($header, 512);
$top->print();
return;
}
- # we use an empty envelope sender (we dont want to receive NDRs)
+ # we use an empty envelope sender (we don't want to receive NDRs)
PMG::Utils::reinject_mail ($top, '', [$receiver], undef, $data->{fqdn});
}
return '@REPOID@';
}
-# this is diplayed on the GUI
+# this is displayed on the GUI
sub version_text {
return '@VERSION@/@REPOID@';
}
}
# check for available updates
-# We assume that users with subscriptions want informations
+# We assume that users with subscriptions want information
# about new packages.
my $info = PVE::INotify::read_file('subscription');
my $notify = ($info && $info->{status} eq 'Active') ? 1 : 0;
syslog('err', "$@") if $@;
PMG::Utils::service_cmd('pmg-smtp-filter', 'restart') if $restart_filter;
-# run bayes database maintainance
+# run bayes database maintenance
system('sa-learn --force-expire >/dev/null 2>&1');
eval {
# reloading server configuration
if (defined $prop->{children}) {
foreach my $pid (keys %{$prop->{children}}) {
- kill (10, $pid); # SIGUSR1 childs
+ kill (10, $pid); # SIGUSR1 children
}
}
}
my $err;
- # do database maintainance here
+ # do database maintenance here
# this is called every 30 secends
eval {
$last_dequeue_time = $ctime;
- $self->log (2, "starting database maintainance");
+ $self->log (2, "starting database maintenance");
my ($csec, $usec) = gettimeofday ();
if ($err) {
$self->log (0, $err);
} else {
- $self->log (2, "end database maintainance ($ptime ms)");
+ $self->log (2, "end database maintenance ($ptime ms)");
}
$dbh->disconnect() if $dbh;
if (defined $prop->{children}) {
foreach my $pid (keys %{$prop->{children}}) {
- kill (1, $pid); # HUP childs
+ kill (1, $pid); # HUP children
}
}
- # nicely shutdown childs (give them max 30 seconds to shut down)
+ # nicely shutdown children (give them max 30 seconds to shut down)
my $previous_alarm = alarm(30);
eval {
local $SIG{ALRM} = sub { die "Timed Out!\n" };
my $in_ct = detect_container();
die $err if !$in_ct;
warn "ignore failure to get local IP of $nodename, we're in a container ($in_ct)\n";
- $localip = '<uknown>';
+ $localip = '<unknown>';
}
my $xline = '-' x 78;
sub run_dequeue {
my $self = shift;
- $self->log(2, "starting policy database maintainance (greylist, rbl)");
+ $self->log(2, "starting policy database maintenance (greylist, rbl)");
my $cinfo = PMG::ClusterConfig->new();
my $lcid = $cinfo->{local}->{cid};
$self->log(0, "greylist database update error: $err");
}
- $self->log(2, "end policy database maintainance ($rbltime ms, $ptime ms)");
+ $self->log(2, "end policy database maintenance ($rbltime ms, $ptime ms)");
$dbh->disconnect() if $dbh;
}
# reloading server configuration
if (defined $prop->{children}) {
foreach my $pid (keys %{$prop->{children}}) {
- kill(10, $pid); # SIGUSR1 childs
+ kill(10, $pid); # SIGUSR1 children
}
}
};
my $auth_expl;
# we only use helo tests when we have no sender,
- # helo is sometimes empty, so we cant use SPF helo tests
+ # helo is sometimes empty, so we can't use SPF helo tests
# in that case - strange
if ($helo && !$sender) {
my $query;
$self->{cache}->{$dkey}->{status} = 1;
my @mxa = grep { $_->type eq 'MX' } $mx->answer;
my @mxl = sort { $a->preference <=> $b->preference } @mxa;
- # shift @mxl; # optionaly skip primary MX ?
+ # shift @mxl; # optionally skip primary MX ?
foreach my $rr (@mxl) {
my $a = $resolver->send ($rr->exchange, 'A');
if ($a) {
if (defined ($user) && defined ($domain)) {
# see http://cr.yp.to/proto/verp.txt
$user =~ s/\+.*//; # strip extensions (mailing-list VERP)
- $user =~ s/\b\d+\b/#/g; #replace nubmers in VERP address
+ $user =~ s/\b\d+\b/#/g; #replace numbers in VERP address
$sender = "$user\@$domain";
}
eval {
- # we dont use alarm here, because it does not work with DBI
+ # we don't use alarm here, because it does not work with DBI
$dbh->begin_work;
if (defined $prop->{children}) {
foreach my $pid (keys %{$prop->{children}}) {
- kill(1, $pid); # HUP childs
+ kill(1, $pid); # HUP children
}
}
- # nicely shutdown childs (give them max 30 seconds to shut down)
+ # nicely shutdown children (give them max 30 seconds to shut down)
my $previous_alarm = alarm(30);
eval {
local $SIG{ALRM} = sub { die "Timed Out!\n" };
# subroutine to start up a specified number of children.
# We need to block signals until handlers are set up correctly.
# Else its possible that HUP occurs after fork, which triggers
-# singal TERM at childs and calls server_close() instead of
+# signal TERM at children and calls server_close() instead of
# simply exit the child.
# Note: on server startup signals are setup to trigger
# asynchronously for a short period of time (in PreForkSimple]::loop,
-# dont use things by default
+# don't use things by default
use_bayes 0
bayes_auto_expire 0
bayes_learn_to_journal 1
# in the main.cf configuration file). See individual command man pages
# for specific command-line options, if any.
#
-# In order to use the "uucp" message tranport below, set up entries
+# In order to use the "uucp" message transport below, set up entries
# in the transport table.
#
# In order to use the "cyrus" message transport below, configure it
# in the main.cf configuration file). See individual command man pages
# for specific command-line options, if any.
#
-# In order to use the "uucp" message tranport below, set up entries
+# In order to use the "uucp" message transport below, set up entries
# in the transport table.
#
# In order to use the "cyrus" message transport below, configure it
recipient=testspf\@maurer-it.com
_EOD
-# we currently hav no backup mx, so we cant test this
+# we currently hav no backup mx, so we can't test this
#gltest ($data_ok, $testtime, 'dunno'); # mail from backup mx
$testdomain = "openspf.org"; # rejects everything