
28th May 2010, 22:48
|
|
Senior Member
|
|
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 32 Times in 30 Posts
|
|
The data is being imported with active as a lower case y. If I manually activate it and then deactivate it it turns to an n.
When imported it looks like just a y in phpMyAdmin but neither the green check nor the red x show in ISPConfig3 so it's being seen as something else. Character encoding? Just a thought.
|

28th May 2010, 22:51
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,895
Thanks: 693
Thanked 4,191 Times in 3,208 Posts
|
|
Quote:
|
Character encoding? Just a thought.
|
Very unlikely as the character 'y' is the same in all encodings.
Change the column type of the active column to varchar 1, then import again and check with phpmyadmin which value is in the db.
|

28th May 2010, 22:59
|
|
Senior Member
|
|
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 32 Times in 30 Posts
|
|
Something invisible was sneaking in at the end of the line in the .csv file, a new line or line return maybe. I added a comma at the end so the explode would add the line end to a different unused array element and now they are all active when imported. I'm editing on a Windows machine but the editor is set for Unix format. Who knows? Works well know.
Attached are the 3 working files. Put them all in the same directory, remove the .txt extension, set the .sh file as executable and run it as root.
Thanks again Till.
PS - It takes a minute for the ISPConfig 3 server to write out the postfix check files from the database. So wait a few minutes to test after installing the filters.
Last edited by BorderAmigos; 28th May 2010 at 23:13.
|
|
The Following 2 Users Say Thank You to BorderAmigos For This Useful Post:
|
ajhart (14th February 2011),
till (28th May 2010)
|

29th May 2010, 16:23
|
|
Senior Member
|
|
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 32 Times in 30 Posts
|
|
There are a couple filters in the previous .csv file corrupted with extra double quotes. All or most are fixed in the attached file here.
To get ISPConfig 3 to write the /etc/postfix/*_checks files you first have to erase or rename the existing ones, then thru the ISPConfig interface you need to change and save a filter. Deactivate one, save, activate it again, save... works.
With the above filters and the below added to /etc/postfix/main.cf I am getting no spam. Between 600 to 1000 a day rejected. All non-spam seems to be getting through ok.
Code:
# Some spam blocking measures
disable_vrfy_command = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks,
reject_non_fqdn_hostname,
reject_invalid_hostname,
permit
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf,
reject_unauth_destination,
reject_rbl_client sbl.spamhaus.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dul.dnsbl.sorbs.net,
permit
Last edited by BorderAmigos; 29th May 2010 at 18:51.
|
|
The Following User Says Thank You to BorderAmigos For This Useful Post:
|
ajhart (14th February 2011)
|

9th June 2010, 21:16
|
|
Senior Member
|
|
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 32 Times in 30 Posts
|
|
Follow up... Some of the filters are malformed and should be fixed or deleted. Also, some of them are rejecting valid emails. For example: /^From:.*@.*.lb/ is rejecting mail from domain blalb.com which is valid for me (should be /^From:.*@.*\.lb/ ). Advice is to set them to WARN rather than reject and monitor mail logs to see which ones you need to fix.
Last edited by BorderAmigos; 9th June 2010 at 21:18.
|

18th June 2010, 16:08
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 189
Thanks: 11
Thanked 2 Times in 2 Posts
|
|
Thanks for all the work on this.
I gave it a try by uploading the three files to my /tmp/ dir on my linux server. I set the .sh file to execute, but this is what I got:
Code:
root@web1:/tmp# sh mail_content_filters.sh
PHP Warning: Module 'apc' already loaded in Unknown on line 0
PHP Fatal error: Call to a member function quote() on a non-object in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 280
Last edited by wxman; 27th June 2010 at 01:55.
|

14th February 2011, 14:48
|
|
Junior Member
|
|
Join Date: Jun 2009
Posts: 15
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
PHP Error
Big Thanks to Till and BorderAmigos.
I also get a php error when executing the mail_content_filters.sh file:
Running Fedora14 with ISPConfig 3.0.3.2 stable
[root@server mail_filter_content]# ./mail_content_filters.sh
PHP Fatal error: Call to a member function quote() on a non-object in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 279
Here is my line 279:
Quote:
if($diff_num > 0) {
//print_r($diff_num);
//print_r($diffrec_full);
$diffstr = $app->db->quote(serialize($diffrec_full));
$username = $app->db->quote($_SESSION['s']['user']['username']);
$dbidx = $primary_field.':'.$primary_id;
|
This would rock my world is this works  or I can do 641 entries manually 
Thanks in advance
__________________
SYSTEM FAILURE Resistance is futile
|

24th October 2012, 19:20
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 8 Times in 4 Posts
|
|
Quote:
Originally Posted by till
The ISPConfig mysql library is here:
/usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php
Your php script should look like this (untested, partly pseudo code):
Code:
<?php
include_once('/usr/local/ispconfig/interface/lib/config.inc.php');
include_once('/usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php');
$db = new db;
$tablename = "database_table_name";
$insert_data = "(a,b,c) values ('a','b','c')";
$index_field = "dbtable_index_field_name";
$db->datalogInsert($tablename, $insert_data, $index_field);
?>
The content of the variables has to be changed to match the data and table that you want to modify.
|
If the ISP master server is different from the server hosting the script how is it possible to include those files or use them to manipulate the database ...
Which 3 or more files should i copy to the script server (I know i need to adjust the config with database connection settings ...)
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 14:33.
|
|
Recent comments
5 hours 21 min ago
14 hours 49 min ago
15 hours 38 min ago
19 hours 12 min ago
23 hours 36 min ago
23 hours 58 min ago
1 day 2 hours ago
1 day 12 hours ago
1 day 17 hours ago
1 day 18 hours ago