]> git.proxmox.com Git - pmg-api.git/log
pmg-api.git
6 years agoPMG/HTTPServer.pm - pass $format to $rpcenv
Dietmar Maurer [Thu, 10 Aug 2017 06:55:18 +0000 (08:55 +0200)]
PMG/HTTPServer.pm - pass $format to $rpcenv

6 years agoPMG::HTMLMail - new class to parse and sanitize html mails
Dietmar Maurer [Thu, 10 Aug 2017 06:27:07 +0000 (08:27 +0200)]
PMG::HTMLMail - new class to parse and sanitize html mails

6 years agodepend on libhtml-tree-perl and libhtml-scrubber-perl
Dietmar Maurer [Thu, 10 Aug 2017 06:26:00 +0000 (08:26 +0200)]
depend on libhtml-tree-perl and libhtml-scrubber-perl

6 years agoadd /quarantine/content API
Dietmar Maurer [Tue, 8 Aug 2017 11:13:54 +0000 (13:13 +0200)]
add /quarantine/content API

6 years agoPMG/DBTools.pm - new helper load_mail_data()
Dietmar Maurer [Tue, 8 Aug 2017 11:13:21 +0000 (13:13 +0200)]
PMG/DBTools.pm - new helper load_mail_data()

6 years agoimprove spamlist API
Dietmar Maurer [Tue, 8 Aug 2017 07:47:01 +0000 (09:47 +0200)]
improve spamlist API

6 years agoPMG::Utils::decode_rfc1522 - new helper
Dietmar Maurer [Tue, 8 Aug 2017 07:46:19 +0000 (09:46 +0200)]
PMG::Utils::decode_rfc1522 - new helper

6 years agopmgsh: correctly setup RESTEnvironment (set user/role)
Dietmar Maurer [Tue, 8 Aug 2017 06:32:31 +0000 (08:32 +0200)]
pmgsh: correctly setup RESTEnvironment (set user/role)

6 years agoimplement spamlist api
Dietmar Maurer [Tue, 8 Aug 2017 06:31:57 +0000 (08:31 +0200)]
implement spamlist api

6 years agocode cleanup - use defined()
Dietmar Maurer [Tue, 8 Aug 2017 05:36:20 +0000 (07:36 +0200)]
code cleanup - use defined()

6 years agopmgmirror: update lastync in clusterinfo table
Dietmar Maurer [Fri, 4 Aug 2017 10:51:05 +0000 (12:51 +0200)]
pmgmirror: update lastync in clusterinfo table

7 years agopmgqm send: use better urls (add action)
Dietmar Maurer [Sun, 30 Apr 2017 06:56:52 +0000 (08:56 +0200)]
pmgqm send: use better urls (add action)

7 years agouse global template toolkit to improve performance.
Dietmar Maurer [Sat, 29 Apr 2017 16:41:05 +0000 (18:41 +0200)]
use global template toolkit to improve performance.

7 years agoPMG/RESTEnvironment.pm: use PVE::Exception
Dietmar Maurer [Sat, 29 Apr 2017 16:22:09 +0000 (18:22 +0200)]
PMG/RESTEnvironment.pm: use PVE::Exception

7 years agoPMG/Service/pmgproxy.pm: register /quarantine page
Dietmar Maurer [Sat, 29 Apr 2017 16:18:09 +0000 (18:18 +0200)]
PMG/Service/pmgproxy.pm: register /quarantine page

And create CSRF tocken for quarantine tickets.

7 years agoPMG/API2/AccessControl.pm: enable login with quanantine tickets
Dietmar Maurer [Sat, 29 Apr 2017 16:15:43 +0000 (18:15 +0200)]
PMG/API2/AccessControl.pm: enable login with quanantine tickets

We do not issue new tickets - instead just return the same ticket.

7 years agoPMG/CLI/pmgqm.pm: uri_esacpe ticket
Dietmar Maurer [Sat, 29 Apr 2017 16:10:58 +0000 (18:10 +0200)]
PMG/CLI/pmgqm.pm: uri_esacpe ticket

7 years agoPMG::Ticket::verify_quarantine_ticket - read lifetime from configuration
Dietmar Maurer [Sat, 29 Apr 2017 16:09:47 +0000 (18:09 +0200)]
PMG::Ticket::verify_quarantine_ticket - read lifetime from configuration

7 years agopmgqm: use better quarantine url /quarantine
Dietmar Maurer [Sat, 29 Apr 2017 13:47:18 +0000 (15:47 +0200)]
pmgqm: use better quarantine url /quarantine

7 years agopostinst: call pmgdb init before config sync
Dietmar Maurer [Sat, 29 Apr 2017 07:23:24 +0000 (09:23 +0200)]
postinst: call pmgdb init before config sync

This is now required, befause config sync use the database.

7 years agoPMG::RESTEnvironment::check_api2_permissions - allow empty username
Dietmar Maurer [Sat, 29 Apr 2017 06:31:32 +0000 (08:31 +0200)]
PMG::RESTEnvironment::check_api2_permissions - allow empty username

7 years agostart quarantine API
Dietmar Maurer [Fri, 28 Apr 2017 09:16:26 +0000 (11:16 +0200)]
start quarantine API

7 years agoPMG/RESTEnvironment.pm: store role
Dietmar Maurer [Fri, 28 Apr 2017 09:15:04 +0000 (11:15 +0200)]
PMG/RESTEnvironment.pm: store role

And allow quarantine users to acces the API.

7 years agoMakefile: pmgspamreport is just a timer unit (no script)
Dietmar Maurer [Fri, 28 Apr 2017 05:51:08 +0000 (07:51 +0200)]
Makefile: pmgspamreport is just a timer unit (no script)

7 years agorename pmgspamreport to pmgqm
Dietmar Maurer [Fri, 28 Apr 2017 05:36:15 +0000 (07:36 +0200)]
rename pmgspamreport to pmgqm

7 years agoPMG/CLI/pmgcm.pm: pass undefined $rulecache to rewrite_config()
Dietmar Maurer [Fri, 28 Apr 2017 05:14:24 +0000 (07:14 +0200)]
PMG/CLI/pmgcm.pm: pass undefined $rulecache to rewrite_config()

There is no need to call $rewrite_config_whitelist->() in
that case.

7 years agoPMG/API2/Config.pm: pass undefined $rulecache to rewrite_config()
Dietmar Maurer [Fri, 28 Apr 2017 05:01:03 +0000 (07:01 +0200)]
PMG/API2/Config.pm: pass undefined $rulecache to rewrite_config()

There is no need to call $rewrite_config_whitelist->() in that case.

7 years agopmgspamreport: fix expire expression
Dietmar Maurer [Fri, 28 Apr 2017 04:52:50 +0000 (06:52 +0200)]
pmgspamreport: fix expire expression

7 years agopmgspamreport: use File::stat
Dietmar Maurer [Fri, 28 Apr 2017 04:41:56 +0000 (06:41 +0200)]
pmgspamreport: use File::stat

7 years agoremove unused ticketid from database
Dietmar Maurer [Fri, 28 Apr 2017 04:26:41 +0000 (06:26 +0200)]
remove unused ticketid from database

7 years agopmgspamreport: only generate one ticket per spam report
Dietmar Maurer [Fri, 28 Apr 2017 04:19:23 +0000 (06:19 +0200)]
pmgspamreport: only generate one ticket per spam report

7 years agopmgspamreport: remove unused check method
Dietmar Maurer [Thu, 27 Apr 2017 11:53:36 +0000 (13:53 +0200)]
pmgspamreport: remove unused check method

7 years agopmgspamreport: use File::find, add --check flag to purge
Dietmar Maurer [Thu, 27 Apr 2017 11:50:06 +0000 (13:50 +0200)]
pmgspamreport: use File::find, add --check flag to purge

7 years agopmgspamreport purge: correctly find all directories
Dietmar Maurer [Thu, 27 Apr 2017 10:43:33 +0000 (12:43 +0200)]
pmgspamreport purge: correctly find all directories

7 years agopmgspamreport.timer: new timer to send daily spam reports
Dietmar Maurer [Thu, 27 Apr 2017 10:04:27 +0000 (12:04 +0200)]
pmgspamreport.timer: new timer to send daily spam reports

7 years agospamreport-short.tt: new spamreport template
Dietmar Maurer [Thu, 27 Apr 2017 09:45:25 +0000 (11:45 +0200)]
spamreport-short.tt: new spamreport template

7 years agoremove spamreport style outlook
Dietmar Maurer [Thu, 27 Apr 2017 09:12:25 +0000 (11:12 +0200)]
remove spamreport style outlook

This style is now called 'verbose' and is the default.

7 years agospamreport-verbose: new style - do not use forms
Dietmar Maurer [Thu, 27 Apr 2017 09:09:06 +0000 (11:09 +0200)]
spamreport-verbose: new style -  do not use forms

Because they do not work in most cases.

7 years agopmgspamreport: create quarantine tickets
Dietmar Maurer [Thu, 27 Apr 2017 07:42:46 +0000 (09:42 +0200)]
pmgspamreport: create quarantine tickets

7 years agoadd newline to errors returned by template toolkit
Dietmar Maurer [Thu, 27 Apr 2017 07:14:02 +0000 (09:14 +0200)]
add newline to errors returned by template toolkit

7 years agouse extemsion .tt for spamreport templates
Dietmar Maurer [Thu, 27 Apr 2017 06:29:55 +0000 (08:29 +0200)]
use extemsion .tt for spamreport templates

tt => Template Toolkit

7 years agopmgspamreport: fix error condition
Dietmar Maurer [Thu, 27 Apr 2017 06:27:43 +0000 (08:27 +0200)]
pmgspamreport: fix error condition

7 years agoPMG::Cluster::sync_config_from_master - also sync /etc/pmg/templates
Dietmar Maurer [Thu, 27 Apr 2017 05:52:07 +0000 (07:52 +0200)]
PMG::Cluster::sync_config_from_master - also sync /etc/pmg/templates

Onyl files and symlinks - not recursive.

7 years agouse one global template toolkit object
Dietmar Maurer [Thu, 27 Apr 2017 04:58:28 +0000 (06:58 +0200)]
use one global template toolkit object

The user can now overwrite all templates in /etc/pmg/templates/

7 years agopmgspamreport: pass filenames to template toolkit
Dietmar Maurer [Thu, 27 Apr 2017 04:28:22 +0000 (06:28 +0200)]
pmgspamreport: pass filenames to template toolkit

So that TT correctly cache the template. Also make it possible
to overwrite all templates in /etc/pmg/templates.

7 years agospamreport-verbose.tmpl: use button tag to get correct button text.
Dietmar Maurer [Wed, 26 Apr 2017 16:29:24 +0000 (18:29 +0200)]
spamreport-verbose.tmpl: use button tag to get correct button text.

7 years agopmgspamreport: do not escape character in tooltip - does not work with most browsers
Dietmar Maurer [Wed, 26 Apr 2017 16:05:02 +0000 (18:05 +0200)]
pmgspamreport: do not escape character in tooltip -  does not work with most browsers

Use template toolkit filter for hrefs.

7 years agospamreport-verbose.tmpl: s/item.data/item.date/
Dietmar Maurer [Wed, 26 Apr 2017 15:30:27 +0000 (17:30 +0200)]
spamreport-verbose.tmpl: s/item.data/item.date/

7 years agopmgspamreport/get_item_data() use uri_escape for tooltip (title)
Dietmar Maurer [Wed, 26 Apr 2017 15:26:48 +0000 (17:26 +0200)]
pmgspamreport/get_item_data() use uri_escape for tooltip (title)

7 years agopmgspamreport: use default stype from configuration, add debug option
Dietmar Maurer [Wed, 26 Apr 2017 15:12:11 +0000 (17:12 +0200)]
pmgspamreport: use default stype from configuration, add debug option

7 years agoPMG/Utils.pm: new helper bencode_header()
Dietmar Maurer [Wed, 26 Apr 2017 11:35:09 +0000 (13:35 +0200)]
PMG/Utils.pm: new helper bencode_header()

7 years agopmgspamreport: tool to send spam reports per email
Dietmar Maurer [Wed, 26 Apr 2017 11:22:54 +0000 (13:22 +0200)]
pmgspamreport: tool to send spam reports per email

7 years agopmgpolicy: use PMG::ClusterConfig->new()
Dietmar Maurer [Wed, 26 Apr 2017 06:22:12 +0000 (08:22 +0200)]
pmgpolicy: use PMG::ClusterConfig->new()

7 years agopmgpolicy: use new PVE::Tools::get_fqdn()
Dietmar Maurer [Wed, 26 Apr 2017 06:20:43 +0000 (08:20 +0200)]
pmgpolicy: use new PVE::Tools::get_fqdn()

7 years agoPMG::DBTools::purge_quarantine_database - return number of removed files
Dietmar Maurer [Wed, 26 Apr 2017 06:19:47 +0000 (08:19 +0200)]
PMG::DBTools::purge_quarantine_database - return number of removed files

7 years agopmgcm: replace $cfg => $cinfo
Dietmar Maurer [Wed, 26 Apr 2017 05:40:42 +0000 (07:40 +0200)]
pmgcm: replace $cfg => $cinfo

7 years agopmgcm: use PMG::ClusterConfig->new()
Dietmar Maurer [Wed, 26 Apr 2017 05:39:25 +0000 (07:39 +0200)]
pmgcm: use PMG::ClusterConfig->new()

7 years agoPMG/DBTools.pm: new helper purge_quarantine_database()
Dietmar Maurer [Wed, 26 Apr 2017 04:43:42 +0000 (06:43 +0200)]
PMG/DBTools.pm: new helper purge_quarantine_database()

7 years agomove cleanup_stats() to PMG::DBTools::purge_statistic_database()
Dietmar Maurer [Wed, 26 Apr 2017 04:36:19 +0000 (06:36 +0200)]
move cleanup_stats() to PMG::DBTools::purge_statistic_database()

7 years agomove code to correct cron scripts
Dietmar Maurer [Tue, 25 Apr 2017 09:06:45 +0000 (11:06 +0200)]
move code to correct cron scripts

run database cleanup and razor logrotate in pmg-daily.

7 years agopmg-hourly: rotate razor log file
Dietmar Maurer [Tue, 25 Apr 2017 08:59:26 +0000 (10:59 +0200)]
pmg-hourly: rotate razor log file

7 years agopmg-hourly: cleanup statistic database
Dietmar Maurer [Tue, 25 Apr 2017 08:47:50 +0000 (10:47 +0200)]
pmg-hourly: cleanup statistic database

7 years agopmg-smtp-filter: corretly run dequeue task all 2 minutes
Dietmar Maurer [Tue, 25 Apr 2017 08:46:49 +0000 (10:46 +0200)]
pmg-smtp-filter: corretly run dequeue task all 2 minutes

7 years agopmgconfig sync: call rewrite_config with $ruelcache
Dietmar Maurer [Tue, 25 Apr 2017 06:18:23 +0000 (08:18 +0200)]
pmgconfig sync: call rewrite_config with $ruelcache

7 years agopmgcm: rewrite config after sync
Dietmar Maurer [Tue, 25 Apr 2017 06:16:49 +0000 (08:16 +0200)]
pmgcm: rewrite config after sync

And rename $cfg to $cinfo

7 years agoPMG::API2::Cluster - rewrite config after join
Dietmar Maurer [Tue, 25 Apr 2017 06:14:40 +0000 (08:14 +0200)]
PMG::API2::Cluster - rewrite config after join

And rename $cfg to $cinfo (for ClusterConfig).

7 years agopmgmirror: rewrite config after sync from master
Dietmar Maurer [Tue, 25 Apr 2017 06:13:40 +0000 (08:13 +0200)]
pmgmirror: rewrite config after sync from master

7 years agoPMG::Config::rewrite_config - pass $rulecache and rewrite smtp whitelist
Dietmar Maurer [Tue, 25 Apr 2017 06:10:43 +0000 (08:10 +0200)]
PMG::Config::rewrite_config - pass $rulecache and rewrite smtp whitelist

7 years agoPMG::Cluster::sync_config_from_master - do not call rewrite_config
Dietmar Maurer [Tue, 25 Apr 2017 06:09:17 +0000 (08:09 +0200)]
PMG::Cluster::sync_config_from_master - do not call rewrite_config

7 years agodebend on ${misc:Depends}
Dietmar Maurer [Tue, 25 Apr 2017 05:57:10 +0000 (07:57 +0200)]
debend on ${misc:Depends}

7 years agoPMG::Utils::quote_regex - new helper to quote all regex operators
Dietmar Maurer [Tue, 25 Apr 2017 04:48:50 +0000 (06:48 +0200)]
PMG::Utils::quote_regex - new helper to quote all regex operators

7 years agopmg-smtp-filter: code cleanups
Dietmar Maurer [Mon, 24 Apr 2017 10:41:11 +0000 (12:41 +0200)]
pmg-smtp-filter: code cleanups

7 years agopmg-smtp-filter: fix memory usage test, correctly create spool dirs
Dietmar Maurer [Mon, 24 Apr 2017 08:32:38 +0000 (10:32 +0200)]
pmg-smtp-filter: fix memory usage test, correctly create spool dirs

7 years agoClusterConfig: remove unused dbport
Dietmar Maurer [Mon, 24 Apr 2017 07:39:15 +0000 (09:39 +0200)]
ClusterConfig: remove unused dbport

We only use unix sockets, so we do not longer need a port number.

7 years agoPMG::Cluster::sync_statistic_db - return count
Dietmar Maurer [Mon, 24 Apr 2017 06:55:55 +0000 (08:55 +0200)]
PMG::Cluster::sync_statistic_db - return count

7 years agoPMG/DBTools.pm: remove unused code
Dietmar Maurer [Mon, 24 Apr 2017 06:41:26 +0000 (08:41 +0200)]
PMG/DBTools.pm: remove unused code

We do not support upgrading from very old versions ...

7 years agoPMG::Cluster::sync_generic_mtime_db - correctly start/commit transaction
Dietmar Maurer [Sat, 22 Apr 2017 15:50:43 +0000 (17:50 +0200)]
PMG::Cluster::sync_generic_mtime_db - correctly start/commit transaction

No need to start transaction if there is no data

7 years agoPMG::DBTools::$cgreylist_merge_sql - use exact column names
Dietmar Maurer [Sat, 22 Apr 2017 15:41:53 +0000 (17:41 +0200)]
PMG::DBTools::$cgreylist_merge_sql - use exact column names

Postgres complians without

7 years agoPMG::Cluster::sync_userprefs_db - fix sql statement
Dietmar Maurer [Sat, 22 Apr 2017 15:36:44 +0000 (17:36 +0200)]
PMG::Cluster::sync_userprefs_db - fix sql statement

7 years agoremove plpgsql code
Dietmar Maurer [Sat, 22 Apr 2017 15:15:47 +0000 (17:15 +0200)]
remove plpgsql code

No longer required, because new postgres "ON CONFLICT" can do the same.

7 years agoPMG::Cluster - simplify code
Dietmar Maurer [Sat, 22 Apr 2017 14:32:23 +0000 (16:32 +0200)]
PMG::Cluster - simplify code

7 years agoPMG::Cluster::sync_virusinfo_db - use single sql statement with ON CONFLICT
Dietmar Maurer [Sat, 22 Apr 2017 14:25:57 +0000 (16:25 +0200)]
PMG::Cluster::sync_virusinfo_db - use single sql statement with ON CONFLICT

7 years agoPMG::Cluster::sync_userprefs_db - fix syntax
Dietmar Maurer [Sat, 22 Apr 2017 14:10:34 +0000 (16:10 +0200)]
PMG::Cluster::sync_userprefs_db - fix syntax

7 years agoPMG::Cluster::sync_dailystat_db - correctly use $merge_sth
Dietmar Maurer [Sat, 22 Apr 2017 14:06:16 +0000 (16:06 +0200)]
PMG::Cluster::sync_dailystat_db - correctly use $merge_sth

7 years agoPMG::Cluster::sync_userprefs_db - use normal place holders
Dietmar Maurer [Sat, 22 Apr 2017 14:04:37 +0000 (16:04 +0200)]
PMG::Cluster::sync_userprefs_db - use normal place holders

Only modify values if excluded.MTime >= UserPrefs.MTime

7 years agoPMG::Cluster::sync_dailystat_db - use singlw sql statement with ON CONFLICT
Dietmar Maurer [Sat, 22 Apr 2017 13:56:00 +0000 (15:56 +0200)]
PMG::Cluster::sync_dailystat_db - use singlw sql statement with ON CONFLICT

7 years agoPMG::Cluster::sync_domainstat_db - use single sql statement with ON CONFLICT
Dietmar Maurer [Sat, 22 Apr 2017 13:44:35 +0000 (15:44 +0200)]
PMG::Cluster::sync_domainstat_db - use single sql statement with ON CONFLICT

7 years agoPMG::Cluster::sync_userprefs_db - rename $update_sth to $merge_sth
Dietmar Maurer [Sat, 22 Apr 2017 09:53:43 +0000 (11:53 +0200)]
PMG::Cluster::sync_userprefs_db - rename $update_sth to $merge_sth

7 years agoPMG::Cluster::sync_greylist_db - prepare outside loop
Dietmar Maurer [Sat, 22 Apr 2017 09:47:20 +0000 (11:47 +0200)]
PMG::Cluster::sync_greylist_db - prepare outside loop

To speedup updates

7 years agoPMG::Cluster::sync_generic_mtime_db - do not cache data in $data
Dietmar Maurer [Sat, 22 Apr 2017 09:42:39 +0000 (11:42 +0200)]
PMG::Cluster::sync_generic_mtime_db - do not cache data in $data

7 years agoPMG::Cluster::sync_userprefs_db - prepare outside loop, use ON CONFLICT
Dietmar Maurer [Sat, 22 Apr 2017 09:31:17 +0000 (11:31 +0200)]
PMG::Cluster::sync_userprefs_db - prepare outside loop, use ON CONFLICT

7 years agoPMG::Cluster::sync_deleted_nodes_from_master - fix $cinfo access
Dietmar Maurer [Fri, 21 Apr 2017 09:52:45 +0000 (11:52 +0200)]
PMG::Cluster::sync_deleted_nodes_from_master - fix $cinfo access

7 years agopmgmirror: implement dartabase syncronization
Dietmar Maurer [Fri, 21 Apr 2017 09:41:55 +0000 (11:41 +0200)]
pmgmirror: implement dartabase syncronization

7 years agoPMG::DBTools::copy_selected_data - correctly substitute $table
Dietmar Maurer [Fri, 21 Apr 2017 09:35:40 +0000 (11:35 +0200)]
PMG::DBTools::copy_selected_data - correctly substitute $table

7 years agoPMG/MailQueue.pm: fix create_spooldirs
Dietmar Maurer [Fri, 21 Apr 2017 07:44:04 +0000 (09:44 +0200)]
PMG/MailQueue.pm: fix create_spooldirs

7 years agoPMG/DBTools.pm: new helper copy_selected_data()
Dietmar Maurer [Fri, 21 Apr 2017 05:36:38 +0000 (07:36 +0200)]
PMG/DBTools.pm: new helper copy_selected_data()

7 years agoPMG/DBTools.pm: add helpers to manipulate clusterinfo table
Dietmar Maurer [Thu, 20 Apr 2017 15:17:53 +0000 (17:17 +0200)]
PMG/DBTools.pm: add helpers to manipulate clusterinfo table

7 years agoPMG::Cluster::sync_master_quar - do not pass $cinfo - not required
Dietmar Maurer [Thu, 20 Apr 2017 07:34:46 +0000 (09:34 +0200)]
PMG::Cluster::sync_master_quar - do not pass $cinfo - not required

7 years agoPMG/API2/Cluster.pm: on join, sync all quarantine files from master
Dietmar Maurer [Thu, 20 Apr 2017 05:20:48 +0000 (07:20 +0200)]
PMG/API2/Cluster.pm: on join, sync all quarantine files from master

7 years agoPMG/Cluster.pm: add rsync helpers to sync quarantine files
Dietmar Maurer [Thu, 20 Apr 2017 05:17:29 +0000 (07:17 +0200)]
PMG/Cluster.pm: add rsync helpers to sync quarantine files