]> git.proxmox.com Git - pmg-api.git/log
pmg-api.git
4 years agod/control: add missing build-dependency
Fabian Grünbichler [Mon, 29 Jul 2019 12:45:08 +0000 (14:45 +0200)]
d/control: add missing build-dependency

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopostinst: make service reload/restart more robust
Fabian Grünbichler [Mon, 29 Jul 2019 09:24:53 +0000 (11:24 +0200)]
postinst: make service reload/restart more robust

like debhelper would do when generating such snippets.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agorestart postfix after first installing pmg-api
Dominik Csapak [Fri, 26 Jul 2019 09:23:34 +0000 (11:23 +0200)]
restart postfix after first installing pmg-api

when installing on debian, restarting postfix is necessary for it
to change the bind address (default is 127.0.0.1)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoupdate our sources .list to buster
Thomas Lamprecht [Wed, 24 Jul 2019 19:22:12 +0000 (21:22 +0200)]
update our sources .list to buster

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-1+1
Thomas Lamprecht [Wed, 24 Jul 2019 19:21:55 +0000 (21:21 +0200)]
bump version to 6.0-1+1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobetter postgres 11 compat in config/pidfile path references
Thomas Lamprecht [Wed, 24 Jul 2019 19:10:41 +0000 (21:10 +0200)]
better postgres 11 compat in config/pidfile path references

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agore-bump version to 6.0-1
Thomas Lamprecht [Wed, 24 Jul 2019 18:49:14 +0000 (20:49 +0200)]
re-bump version to 6.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-1
Thomas Lamprecht [Wed, 24 Jul 2019 14:38:28 +0000 (16:38 +0200)]
bump version to 6.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadapt to new pmgcfg version/release semantic
Thomas Lamprecht [Wed, 24 Jul 2019 18:39:34 +0000 (20:39 +0200)]
adapt to new pmgcfg version/release semantic

similar like we've done in PVE[0]

[0]: https://git.proxmox.com/?p=pve-manager.git;a=commitdiff;h=b597d23d354665ddea247c3ad54ece1b84921768

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoallow to pass port to pmgpolicy and use it in test
Thomas Lamprecht [Wed, 24 Jul 2019 08:21:27 +0000 (10:21 +0200)]
allow to pass port to pmgpolicy and use it in test

instead of the, rather rough, "stop the live daemon and take it's
port" hack

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agotest: create db: drop all active connections before dropping DB
Thomas Lamprecht [Wed, 24 Jul 2019 08:20:20 +0000 (10:20 +0200)]
test: create db: drop all active connections before dropping DB

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodrop now unused repoid.pl
Thomas Lamprecht [Tue, 23 Jul 2019 19:32:20 +0000 (21:32 +0200)]
drop now unused repoid.pl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: fix and add missing build dependencies
Thomas Lamprecht [Tue, 23 Jul 2019 19:31:29 +0000 (21:31 +0200)]
d/control: fix and add missing build dependencies

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agosplit source and packaging, and clean latter a bit up
Thomas Lamprecht [Tue, 23 Jul 2019 19:30:57 +0000 (21:30 +0200)]
split source and packaging, and clean latter a bit up

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 5.2-6
Thomas Lamprecht [Fri, 12 Jul 2019 15:05:37 +0000 (17:05 +0200)]
bump version to 5.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2276: restore line format for pmg-log-tracker
Dominik Csapak [Fri, 12 Jul 2019 13:49:05 +0000 (15:49 +0200)]
fix #2276: restore line format for pmg-log-tracker

pmg-log-tracker requires a specific format of the output of the
smtp-filter to correctly detect and recognize emails and message ids

commit 365d5b9549d25a910c82cd37034f05e1c906565a
changed the format of some lines (by including the rule name)
so that pmg-log-tacker did not correctly parse it anymore

this patch changes the format in a way that the log-tracker
can parse and still display the new information

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofix subscription url
Thomas Lamprecht [Thu, 4 Jul 2019 15:59:23 +0000 (17:59 +0200)]
fix subscription url

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 5.2-5
Thomas Lamprecht [Mon, 1 Jul 2019 15:53:52 +0000 (17:53 +0200)]
bump version to 5.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoavast: change 'scan' invocation
Stoiko Ivanov [Fri, 17 May 2019 12:45:45 +0000 (14:45 +0200)]
avast: change 'scan' invocation

Change the invocation of avast's 'scan' executable from a hardcoded '/bin/scan'
to 'scan', so that it checks for the executable in the PATH.

The hardcoded path became apparent, while testing the new upstream release
of avast (3.0.1), where 'scan' got moved from '/bin/scan' to '/usr/bin/scan'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agofix use of uninitialized value
Mira Limbeck [Tue, 18 Jun 2019 09:26:03 +0000 (11:26 +0200)]
fix use of uninitialized value

Return early if $info is not defined.

When moving a mail directly to quarantine without running any checks
there's no spaminfo available. As a result the value $info is
undefined.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agofall back to hostname only if no domain defined
Mira Limbeck [Tue, 11 Jun 2019 13:27:28 +0000 (15:27 +0200)]
fall back to hostname only if no domain defined

fall back to hostname only if no domain is defined in /etc/resolv.conf.
this removes the 'Use of uninitialized value' warning for
'$msginfo->{domain}'.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
4 years agofollouwp indentation fixup
Thomas Lamprecht [Fri, 7 Jun 2019 09:53:26 +0000 (11:53 +0200)]
follouwp indentation fixup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoextended fix #1974: traffic_stat_graph: go through all entries
Alexander Plank [Thu, 6 Jun 2019 12:54:56 +0000 (14:54 +0200)]
extended fix #1974: traffic_stat_graph: go through all entries

Extends a fix for #1974.
The commit cb609ca098823734dde590fcf42164f72bbfbf37 fixed the graph
for postscreen_stat_graph.  The code from the above commit was
adopted to fix the same error for traffic_stat_graph.

Signed-off-by: Alexander Plank <alexander.plank@siconnex.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agowrap and sort + debhelper 10 buildep
Thomas Lamprecht [Thu, 6 Jun 2019 12:24:36 +0000 (14:24 +0200)]
wrap and sort + debhelper 10 buildep

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 5.2-4
Thomas Lamprecht [Thu, 6 Jun 2019 12:02:29 +0000 (14:02 +0200)]
bump version to 5.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi apt/versions: add some missing packages
Thomas Lamprecht [Thu, 6 Jun 2019 12:20:45 +0000 (14:20 +0200)]
api apt/versions: add some missing packages

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmg config: fix avast scan executable path documentation
Thomas Lamprecht [Thu, 6 Jun 2019 11:59:19 +0000 (13:59 +0200)]
pmg config: fix avast scan executable path documentation

as it changed in newer releases

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAdd default rulename of 'unknown' to Actions
Stoiko Ivanov [Thu, 6 Jun 2019 09:26:38 +0000 (11:26 +0200)]
Add default rulename of 'unknown' to Actions

To provide a better experience while logging - set the name to 'unknown' in
case it's not defined. Related to #2232

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agofix #2232: set rulename for default accept
Stoiko Ivanov [Thu, 6 Jun 2019 09:26:37 +0000 (11:26 +0200)]
fix #2232: set rulename for default accept

Logging the rulename along with the action taken introduced in
365d5b9549d25a910c82cd37034f05e1c906565a, introduced a regression, for the
default action (accept), since the accept-rule is instantiated directly it
did not set a name, resulting in an 'Use of uninitialized value' being written
to the mail.log for every mail not triggering any explicit rule.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agoDrop sa-awl output from pmg-system-report
Stoiko Ivanov [Tue, 28 May 2019 10:32:57 +0000 (12:32 +0200)]
Drop sa-awl output from pmg-system-report

After gathering some initial experience with `pmg-system-report` it seems
that the output of `sa-awl` is not too helpful in narrowing down problems.

Additionally the output tends to be quite large (multiple MiB) on larger/
longer-running installations, leading to timeouts or problems when sending
the report to the support.

Should the AWL checks skew the SA-results in a negative way this already shows
in the logs (which log the score for each rule).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agolimit precision of bayes-score in log
Stoiko Ivanov [Wed, 22 May 2019 15:31:52 +0000 (17:31 +0200)]
limit precision of bayes-score in log

Spamassassin's bayes_score is a float, and is written to the log during
filtering. Limiting the precision for the log to 2 decimal places keeps
logs a bit shorter and also prevents misreadings of values like:
5.55111571207834e-17

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 years agobump version to 5.2-3
Thomas Lamprecht [Thu, 16 May 2019 11:31:04 +0000 (13:31 +0200)]
bump version to 5.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode: journal: minor code cleanup
Thomas Lamprecht [Thu, 16 May 2019 11:06:01 +0000 (13:06 +0200)]
node: journal: minor code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode: journal: improve parameter schema
Thomas Lamprecht [Thu, 16 May 2019 11:05:34 +0000 (13:05 +0200)]
node: journal: improve parameter schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode: add journal api to index too
Thomas Lamprecht [Thu, 16 May 2019 11:04:55 +0000 (13:04 +0200)]
node: add journal api to index too

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode: add journal api
Dominik Csapak [Wed, 15 May 2019 09:38:19 +0000 (11:38 +0200)]
node: add journal api

this uses the new journalreader instead of journalctl, which is a bit
faster and can read from/to cursor and returns a start/end cursor

also you can give an unix epoch as time parameters

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoadd new parameters cidr(6) to the network api
Dominik Csapak [Fri, 3 May 2019 07:28:53 +0000 (09:28 +0200)]
add new parameters cidr(6) to the network api

to also allow to set it directly and not only via address/netmask

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoAdd rule name to RuleAction logging
Stoiko Ivanov [Thu, 18 Apr 2019 15:04:32 +0000 (17:04 +0200)]
Add rule name to RuleAction logging

With complicated rulesets knowing which rule is responsible for the action
applied to a mail can become complex. Since relevant actions [0] do log a line
when being executed adding the rule's name to this logline should simplify
understanding and debugging complex rules.

Additionally the mix of string interpolation and formatstrings in Quarantine.pm
got unified to formatstrings.

[0] Attach is covered via Notify, Disclaimer and ModField could result in too
verbose logging (i.e. users adding many headers to a mail) without any gain

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.2-2
Thomas Lamprecht [Thu, 18 Apr 2019 11:53:33 +0000 (13:53 +0200)]
bump version to 5.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump verison dependency to pve-common
Thomas Lamprecht [Thu, 18 Apr 2019 11:46:58 +0000 (13:46 +0200)]
d/control: bump verison dependency to pve-common

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix setresuid to 'postgres' error handling
Stoiko Ivanov [Wed, 17 Apr 2019 08:55:43 +0000 (10:55 +0200)]
Fix setresuid to 'postgres' error handling

PMG::DBTools::postgres_admin_cmd switches the euid to postgres. The error
handling expected that the setresuid (2) call failed if $! was != 0, without
explicitly setting it to 0 beforehand. This lead to a false positive if errno
was set from a previous library call.

This patch changes the code to explicitly call the setresuid syscall (exposed
via a separate patch to pve-common) and check for an error.

Steps to reproduce:
* install nscd on a system
* try installing pmg-api (the postinst script invokes `pmgdb init`)

The issue was further discussed in [0].

[0] https://pve.proxmox.com/pipermail/pmg-devel/2019-April/000362.html

Reported-By: Patrick Fogarty <patrick.fogarty@patanne.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agorewrite config log followup: move common log message out in closure
Thomas Lamprecht [Fri, 12 Apr 2019 08:01:09 +0000 (10:01 +0200)]
rewrite config log followup: move common log message out in closure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #2153: allow "'" in quarantine email addresses
Mira Limbeck [Wed, 10 Apr 2019 10:54:37 +0000 (12:54 +0200)]
fix #2153: allow "'" in quarantine email addresses

use the more relaxed standard option 'pmg-email-address' defined in
PMG/Utils.pm instead of the 'email' format defined in pve-common

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 years agolog before restarting services on rewrite_config
Stoiko Ivanov [Thu, 11 Apr 2019 16:48:58 +0000 (18:48 +0200)]
log before restarting services on rewrite_config

PMG::Config::rewrite_config is called from various places (e.g.
pmgmirror for clustered setups, pmgconfig sync --restart for CLI
operations) for rendering the config-templates and conditionally
restarting services.  This patch adds a syslog call for each service
that gets restarted.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agofix #2172: sort mynetworks template var to make postfix config rewrite stable
Stoiko Ivanov [Thu, 11 Apr 2019 16:48:57 +0000 (18:48 +0200)]
fix #2172: sort mynetworks template var to make postfix config rewrite stable

The mynetworks template_var is written to postfix/main.cf, causing a
postfix restart on every change. Since mynetworks is a hash the order
of the networks potentially changes with every invocation. This shows
quite readily in clustered setups where pmgmirror writes the configs
and checks for changes once every 2 minutes.

fixes #2172

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoreload postfix instead of restart on config change
Stoiko Ivanov [Tue, 9 Apr 2019 16:13:17 +0000 (18:13 +0200)]
reload postfix instead of restart on config change

From `man 1 postfix`:
```
Note: in order to refresh the Postfix mail system after a
configuration change, do not use the start and stop commands in
succession. Use the reload command instead.
```

Additionally restarting postfix, while a mail has been passed to
pmg-smtp-filter but has not beed fed back to postfix again, causes it
to get passed a second time to pmg-smtp-filter (by qmgr) and this
results in duplicate maildelivery

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agopackage versions: code cleanup: remove unused variable
Thomas Lamprecht [Fri, 12 Apr 2019 07:37:16 +0000 (09:37 +0200)]
package versions: code cleanup: remove unused variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.2-1
Dietmar Maurer [Wed, 20 Mar 2019 05:59:48 +0000 (06:59 +0100)]
bump version to 5.2-1

5 years agobump version toö 5.1-7
Dietmar Maurer [Wed, 20 Mar 2019 05:51:53 +0000 (06:51 +0100)]
bump version toö 5.1-7

5 years agopmgversion: be compatible with minimized container installation
Thomas Lamprecht [Tue, 19 Mar 2019 07:04:08 +0000 (08:04 +0100)]
pmgversion: be compatible with minimized container installation

One can now install PMG in a CT envrionment through the new
proxmox-mailgateway-container meta package, but this wasn't correctly
checked by the API PMG versions code.

Add the new meta package as optional one, and if it is installed
replace the bare-metal meta packge info with it, both can never be
installed at the same time. Also move pve-firmware to the optional
package list.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agopmgversion: sort packages
Thomas Lamprecht [Tue, 19 Mar 2019 07:04:07 +0000 (08:04 +0100)]
pmgversion: sort packages

Similar adaptions as PVE got, initally list the most important
packages, pmg-api and pmg-gui, then the kernels sorted by real
version order, then the rest of intresting packages in alphabetical
order.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobetter error handling for ldap connect
Dominik Csapak [Mon, 18 Mar 2019 13:58:32 +0000 (14:58 +0100)]
better error handling for ldap connect

even though we create the ldap connection with 'onerror' => 'die',
it returns undef and sets $@ on error during connect, so we want to use
that instead of $!

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.1-6
Dietmar Maurer [Mon, 18 Mar 2019 06:01:31 +0000 (07:01 +0100)]
bump version to 5.1-6

5 years agofix #2129: allow (some) filters for dnsbl-entry
Stoiko Ivanov [Thu, 14 Mar 2019 17:20:45 +0000 (18:20 +0100)]
fix #2129: allow (some) filters for dnsbl-entry

currently we only handle dnsbl-sites with optional <WEIGHT>, but postfix also
allows for an optional <FILTER> (which dns-answers to interpret as hit) [0].

The regex is extended to also allow for a filter with singular answers, as
well as ranges ([0..255])for each octet. Filters relying on 'lists' of numbers
split by ';' break the use of JSONSchema's '-list' format matching (it
uses split_list, which splits on ';') and were thus excluded.

[0] http://www.postfix.org/postconf.5.html#postscreen_dnsbl_sites

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agofix #1947: implement starttls for ldap
Dominik Csapak [Wed, 13 Mar 2019 14:17:08 +0000 (15:17 +0100)]
fix #1947: implement starttls for ldap

adds a new mode 'ldap+starttls' that enables the start_tls after
connection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1946: add verify and cafile options for ldap
Dominik Csapak [Wed, 13 Mar 2019 14:17:07 +0000 (15:17 +0100)]
fix #1946: add verify and cafile options for ldap

so that users can force the verification, either with the system
installed certificates or with a single explicit file

this also fixes #1944, since the option was 'scheme' not 'schema'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoshow all errors when we get an ldap connection error
Dominik Csapak [Wed, 13 Mar 2019 14:17:06 +0000 (15:17 +0100)]
show all errors when we get an ldap connection error

LDAP->new can also set $@

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agointegrate custom_check
Stoiko Ivanov [Wed, 13 Mar 2019 20:39:42 +0000 (21:39 +0100)]
integrate custom_check

for virus and spam detection and records its time spend in the Statistics DB
and the log

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd custom_check handling
Stoiko Ivanov [Wed, 13 Mar 2019 20:39:41 +0000 (21:39 +0100)]
add custom_check handling

This patch enables users to create their own script for analyzing mails.
The 'custom_check' needs to be enabled via pmg.conf (optionally the check's
executable path ('custom_check_path') can be set, defaulting to
'/usr/local/bin/pmg-custom-check').

'pmg-smtp-filter' calls the check before analyze_virus (which in turn calls
clamav or avast). The custom_check 'api' is kept simple:
* Input: the check gets 2 arguments:
  * the 'api-version' (currently 'v1') - for potential future change of the
    invocation
  * the 'queue-file-name' - a filename, which contains the complete e-mail as
    rfc822/eml file
* Output: the check needs to return 2 lines on STDOUT:
  * the 'api-version' (currently 'v1') - see above
  * one of the following 3 results:
    * 'OK' - mail is ok
    * 'VIRUS: <virusdescription>' - mail is treated as if it contained a virus
      (the virusdescription is logged and added to the mail's headers)
    * 'SCORE: <number>' - <number> is added (negative numbers are also possible)
      to the mail's spamscore
* The check will be killed after a 5 minute timeout - and the mail is
  treated as OK
* All output written to STDERR by the check is written to the journal/mail.log
  (with priority 'err')

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agopmg-system-report: check for existing sa-awl db
Stoiko Ivanov [Tue, 26 Feb 2019 14:02:30 +0000 (15:02 +0100)]
pmg-system-report: check for existing sa-awl db

When run via pmgdaemon the pmg-system-report threw an error, while running
`sa-awl` (it relies on the environment variable HOME being set, for the default
location of the awl database).

This patch checks for the existance of /root/.spamassassin/auto-whitelist and
conditionally runs sa-awl with the file as argument.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.1-5
Dietmar Maurer [Tue, 26 Feb 2019 12:03:17 +0000 (13:03 +0100)]
bump version to 5.1-5

5 years agofix #2093 pmgproxy: read in /etc/default/pmgproxy
Stoiko Ivanov [Tue, 26 Feb 2019 11:14:09 +0000 (12:14 +0100)]
fix #2093 pmgproxy: read in /etc/default/pmgproxy

and use the same configuration parameters as pveproxy

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd dependency on pve-http-server (>= 2.0.12)
Stoiko Ivanov [Tue, 26 Feb 2019 11:14:08 +0000 (12:14 +0100)]
add dependency on pve-http-server (>= 2.0.12)

needed for the use of common_init_proxy in PVE::APIServer::Utils

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd pmg report api call for the gui
Dominik Csapak [Tue, 26 Feb 2019 10:27:34 +0000 (11:27 +0100)]
add pmg report api call for the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd optional list parameter to quarusers api call
Dominik Csapak [Tue, 26 Feb 2019 08:12:36 +0000 (09:12 +0100)]
add optional list parameter to quarusers api call

so that we can get the list of users of white or blacklist only

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoclose #2075: do not insert empty WL/BL
Dominik Csapak [Tue, 26 Feb 2019 08:12:35 +0000 (09:12 +0100)]
close #2075: do not insert empty WL/BL

so that they do not appear in the list of users

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agouser white/blacklist: allow multiple entries for adding/deleting
Dominik Csapak [Tue, 26 Feb 2019 08:12:34 +0000 (09:12 +0100)]
user white/blacklist: allow multiple entries for adding/deleting

and reallow globs (like previously) like *.com
entries are seperated by ','

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoQuarantine: reuse raw parameter for non htmlmail formatter
Dominik Csapak [Mon, 25 Feb 2019 09:52:22 +0000 (10:52 +0100)]
Quarantine: reuse raw parameter for non htmlmail formatter

when we download a mail, we want the raw, unmodified header
and content in full size, so we reuse the raw parameter for
json/extjs formatter to get the full email, not only the first 4k

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoload mobile ui on mobile user agent on /quarantine
Dominik Csapak [Mon, 18 Feb 2019 12:50:49 +0000 (13:50 +0100)]
load mobile ui on mobile user agent on /quarantine

and add framework7 directories

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoimprove pmg-email-address regex
Dominik Csapak [Mon, 18 Feb 2019 16:12:10 +0000 (17:12 +0100)]
improve pmg-email-address regex

the '|' is not necessary since the first option is empty (mitigated by
the minLength of 3) and add the '\' to forbidden characters since
they make problems with browser requests (browsers convert '\' to '/')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobsys: add pmg-system-report + manpage to Makefile
Stoiko Ivanov [Mon, 11 Feb 2019 14:43:08 +0000 (15:43 +0100)]
bsys: add pmg-system-report + manpage to Makefile

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoextend `pmgdb dump`
Stoiko Ivanov [Mon, 11 Feb 2019 14:43:07 +0000 (15:43 +0100)]
extend `pmgdb dump`

add priority, direction and an active flag to `pmgdb dump` output.

pmgdb dump provides the complete ruleset including all rules and related
objects. The information whether a rule is active and in which direction it
works is necessary to get an overview about the setup for pmg-smtp-filter.

Additionally the priority was explicitly added to the output for easier matching
with the GUI.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoclose #1917: add pmg-system-report command
Stoiko Ivanov [Mon, 11 Feb 2019 14:43:06 +0000 (15:43 +0100)]
close #1917: add pmg-system-report command

pmg-system-report gathers information about a PMG installation, like
pvereport does for PVE.

The name was chosen because pmgreport is already taken (for the daily
reportmails).

The DNS resolution check uses SpamAssassin's internal DnsResolver, since
SpamAssassin has a few pecularities, e.g. only using the first entry in
/etc/resolv.conf - see [0] and Mail::SpamAssassin::DnsResolver and
spam-detection is abysmal if SpamAssassin cannot resolve RBL-entries.
The SpamAssassin initialization is taken from pmg-smtp-filter (except that
local_tests_only is unconditionally disabled (otherwise it would not do DNS
Resolution).

[0] https://wiki.apache.org/spamassassin/DnsBlocklists

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd rule's score to pmg-smtp-filter logline
Stoiko Ivanov [Fri, 8 Feb 2019 10:11:49 +0000 (11:11 +0100)]
add rule's score to pmg-smtp-filter logline

We already log which Spamassassin rules apply to a mail. Given that the scores
depend on configuration and setup (e.g. AWL) writing them in the log provides
a quick overview of Spamassassin performance, and spares admins and support from
having to gather the complete mail just for assessing Spamassessin.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.1-4
Dietmar Maurer [Tue, 18 Dec 2018 09:25:18 +0000 (10:25 +0100)]
bump version to 5.1-4

5 years agofix bug #2035 cluster sync issues with ipv6
Oguz Bektas [Mon, 17 Dec 2018 12:56:59 +0000 (13:56 +0100)]
fix bug #2035 cluster sync issues with ipv6

rsync needs ipv6 addresses to be in brackets, otherwise issues arise
when joining/syncing cluster

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agofix #1974: postscreen_stat_graph: go through all entries
Wolfgang Bumiller [Thu, 15 Nov 2018 09:28:01 +0000 (10:28 +0100)]
fix #1974: postscreen_stat_graph: go through all entries

When the GUI requests the values for a whole month
containing a DST switch it will request a range a little
longer or shorter than a month, eg. 31.04166 days for
October 2018 in CET.

Since we use integer math to calculate the number of entries
we expect, the database then returns one more value than
expected, and we forget to fill in the last time value.

For example, requesting Oct. 2018 from CET causes the
equivalent of this query:

  # pmgsh get /statistics/rejectcount --starttime=1538344800 --endtime=$[1541026800] --timespan=86400
  400 Result verification failed
  [31].time: property is missing and it is not optional

Note that:

  $ echo $[(1541026800-1538344800) / (60*60*24.)]
  31.041666666666668

This also happens when for example taking the working range
for the month and simply subtracting 1 second from the
end-time. Our division will then round down by a day while
the database timestamps still cause that day to be included
in the result.

5 years agostyle fixup
Wolfgang Bumiller [Thu, 15 Nov 2018 09:28:00 +0000 (10:28 +0100)]
style fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agofixed some typos in PMG/Config.pm
Oguz Bektas [Wed, 21 Nov 2018 11:31:38 +0000 (12:31 +0100)]
fixed some typos in PMG/Config.pm

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
5 years agobump version to 5.1-3
Dietmar Maurer [Thu, 8 Nov 2018 08:54:09 +0000 (09:54 +0100)]
bump version to 5.1-3

5 years agofix #1978: always give encoding/collate explicitly when creating db
Dominik Csapak [Wed, 7 Nov 2018 14:47:56 +0000 (15:47 +0100)]
fix #1978: always give encoding/collate explicitly when creating db

already existing clusters still have the wrong encoding,
so if a user has a problem with it, they have to either recreate
the slave db with pmgdb delete && pmgdb init,
or remove the slave and add it again after this patch

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix typo
David Limbeck [Tue, 30 Oct 2018 09:44:29 +0000 (10:44 +0100)]
fix typo

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
5 years agobump version to 5.1-2
Dietmar Maurer [Wed, 3 Oct 2018 10:14:39 +0000 (12:14 +0200)]
bump version to 5.1-2

5 years agodo not use 'last' inside do/while
Dietmar Maurer [Wed, 3 Oct 2018 10:12:29 +0000 (12:12 +0200)]
do not use 'last' inside do/while

Because this raises an exception.

5 years agobump version toö 5.1-1
Dietmar Maurer [Fri, 28 Sep 2018 04:51:56 +0000 (06:51 +0200)]
bump version toö 5.1-1

5 years agoregister new format 'tls-policy-strict'
Dietmar Maurer [Fri, 28 Sep 2018 04:26:07 +0000 (06:26 +0200)]
register new format 'tls-policy-strict'

5 years agoadd pmg_verify_tls_policy_strict and use it in API
Stoiko Ivanov [Thu, 27 Sep 2018 16:38:13 +0000 (18:38 +0200)]
add pmg_verify_tls_policy_strict and use it in API

This patch splits the parsing of tls_policies in 2 parts:
While reading we just require a line to start with one of the valid tls_policies,
while writing we only accept one of the policies w/o any attributes.
This should help users, who already have a manually crafted file in place, to
use API-calls for adding/modifying entries.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agouse 'die' instead of 'warn' if we cannot parse the tls_policy file
Dietmar Maurer [Mon, 24 Sep 2018 07:08:15 +0000 (09:08 +0200)]
use 'die' instead of 'warn' if we cannot parse the tls_policy file

5 years agopmg_verify_tls_policy: improve regex
Dietmar Maurer [Mon, 24 Sep 2018 07:06:46 +0000 (09:06 +0200)]
pmg_verify_tls_policy: improve regex

5 years agoadd PMG::API2::DestinationTLSPolicy
Stoiko Ivanov [Fri, 21 Sep 2018 13:51:42 +0000 (15:51 +0200)]
add PMG::API2::DestinationTLSPolicy

to handle /etc/pmg/tls_policy via API, using PMG::API2::Transport
as base/inspiration.

This enables PMG to enforce TLS on a per-domain basis.
See http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps and
http://www.postfix.org/TLS_README.html#client_tls_policy for reference.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoclose #1887: register tls_policy file with reader/writer
Stoiko Ivanov [Fri, 21 Sep 2018 13:51:41 +0000 (15:51 +0200)]
close #1887: register tls_policy file with reader/writer

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.0-79
Dietmar Maurer [Mon, 17 Sep 2018 07:31:21 +0000 (09:31 +0200)]
bump version to 5.0-79

5 years agofix schema definition
Dietmar Maurer [Mon, 17 Sep 2018 07:36:13 +0000 (09:36 +0200)]
fix schema definition

5 years agofix #1876: allow node status for admin/manager/auditors
Dominik Csapak [Fri, 14 Sep 2018 12:40:40 +0000 (14:40 +0200)]
fix #1876: allow node status for admin/manager/auditors

users can already see the status for the local host
via /config/cluster/status or rrddata on all nodes
so allow them to directly get the status via /nodes/nodename/status

this fixes the permission error on the dashboard in clustered setups

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1881: increase limit for ids in spam quarantine
Dominik Csapak [Fri, 14 Sep 2018 12:13:20 +0000 (14:13 +0200)]
fix #1881: increase limit for ids in spam quarantine

removing the maxLength, now the limiting factor is the http
post size (64k atm), should be enough for a while

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-78
Dietmar Maurer [Wed, 12 Sep 2018 04:47:12 +0000 (06:47 +0200)]
bump version to 5.0-78

5 years agofix bug #1701: implement smarthostport setting
Dietmar Maurer [Tue, 11 Sep 2018 06:29:22 +0000 (08:29 +0200)]
fix bug #1701: implement smarthostport setting

5 years agofix bug #1649: Allow TLS also on internal SMTP port
Dietmar Maurer [Tue, 11 Sep 2018 05:15:29 +0000 (07:15 +0200)]
fix bug #1649: Allow TLS also on internal SMTP port

5 years agofix bug #1727: hide details if hide_received is active
Dietmar Maurer [Tue, 11 Sep 2018 04:58:20 +0000 (06:58 +0200)]
fix bug #1727: hide details if hide_received is active

5 years agouse 'dailyreport' config
Dominik Csapak [Thu, 6 Sep 2018 13:33:12 +0000 (15:33 +0200)]
use 'dailyreport' config

the user could enable/disable the dailyreport via the config/webui
but the report did not honor/check this setting

so check it, and do not send a report if this is off

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>