Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th August 2013, 02:56
electronico_nc electronico_nc is offline
Member
 
Join Date: Oct 2012
Posts: 30
Thanks: 6
Thanked 1 Time in 1 Post
Default email global content filters insert into MySQL

(3.0.5.3 stable installed from tar.gz)
Hi all,

I need to insert a lot of efficient rules to postfix header/body/mime checks.
I just would like to know if I can SAFELY run a script to insert them into MySQL (so there won't be anything wrong with future ISPConfig updates).

On my other (than ISPConfig) servers I have files like :
header_checks.cf
Code:
...
/^Subject:(.*)beast/   REJECT   X-Rated Subject Line
/^Subject:(.*)bitch/   REJECT   X-Rated Subject Line
/^Subject:(.*)bodies/   REJECT   X-Rated Subject Line
/^Subject:(.*)breast/   REJECT   X-Rated Subject Line
/^Subject:(.*)fuck/   REJECT   X-Rated Subject Line
/^Subject:(.*)galore/   REJECT   X-Rated Subject Line
/^Subject:(.*)gay/   REJECT   X-Rated Subject Line
/^Subject:(.*)porn/   REJECT   X-Rated Subject Line
...
So I would like to parse file and proceed to :
Code:
#!/bin/bash
`/usr/bin/mysql $SQL_ARGS INSERT INTO mail_content_filter
 (sys_userid,sys_groupid,sys_perm_user,sys_perm_group,server_id,type,pattern,data,action,active) 
VALUES 
('1','1','riud','riud','1','header',\"$pattern\",\"$data\",\"$action\",'y')";"`
I'm not asking anything about the above script but about the method to insert rules in ISPConfig (as I have hundreds to add).
Thanks in advance for your time.
Reply With Quote
Sponsored Links
  #2  
Old 29th August 2013, 08:43
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,242 Times in 4,108 Posts
 
Default

The rules will show up in the interface but get ignored. ISPConfig wont write the rules to the config files if you dont create a valid ispconfig tranaction in sys_datalog for them.

If you want to write data correctly to the ispconfig database, use the datalogInsert() function from the ispconfig mysql class to insert the data into the ispconfig database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
email filter content

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Error Nolan Installation/Configuration 12 16th February 2011 02:15
Squirrelmail login failure Cracklefish Installation/Configuration 9 30th June 2010 20:38
using mysql with postfix - adding/deleting email to an mailalias zaag HOWTO-Related Questions 1 20th October 2006 16:08
Multiple MySQL Queries - with Postfix-mysql, courier-authmysql, maildrop-mysql... snowfly HOWTO-Related Questions 4 7th July 2006 04:19
email forwarding locally consumes all resources rdells General 20 1st May 2006 19:43


All times are GMT +2. The time now is 08:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.