kalkun-sms / Kalkun

Open Source Web based SMS Manager
https://kalkun.sourceforge.io/
GNU General Public License v2.0
210 stars 131 forks source link

Blacklist plugin error #488

Closed pjunyent closed 1 year ago

pjunyent commented 1 year ago

Describe the bug Activated the "blacklist number" plugin. The mysql's table "plugin_blacklist_number" wasn't created (it may have something to do with my setup). More importantly, the blacklist plugin says it blocks incoming and outgoing messages. Incoming messages are effectively blocked but outgoing aren't.

To Reproduce Steps to reproduce the behavior:

  1. Go to Plugins
  2. Install "blacklist number" plugin, click on it it's name, add a number to blacklist.
  3. If mysql's table wasn't created an error page appears saying it.
  4. (if the table was created) Send an sms to & from blocked number.
  5. Sms sent from number is blocked, but the sms sent to the numbers passes and is received by the telephone.

Expected behavior Automatic creation of tables. Block outgoing sms from sending.

Browser, kalkun setup, database setup..:

Additional context Kalkun is running in a container with two separate containers, one for mysql (mariadb) and an other for kalkun proper (which is running a top nginx). That might have something to do with the first bug.

pjunyent commented 1 year ago

The database error seems to happen also for the whitelist plugin: "A Database Error Occurred Error Number: 1146 Table 'kalkun.plugin_whitelist_number' doesn't exist SELECT count(*) as count FROM plugin_whitelist_number Filename: plugins/whitelist_number/models/Whitelist_number_model.php Line Number: 44" Captura desde 2023-01-29 11-28-02

I've tried also to use the whitelist plugin & it also doesn't work. When the plugin is set for detecting number '6XXXXXXXX' it allows every sms outgoing to any number.

tenzap commented 1 year ago

Could you check if the username you use for the database has the permissions to create tables? This permissions must be granted.

tenzap commented 1 year ago

Automatic creation of tables.

Fixed in #492

Block outgoing sms from sending.

Can't reproduce when applying the commits of #492 (didn't try without the fix)

For whitelist number, you must set a regex pattern. For example /6.*/ Match pattern as required by PHP's preg_match() https://www.php.net/manual/en/function.preg-match.php

tenzap commented 1 year ago

Could you please check that #492 fixes your issues?