Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:custom_archiving [2009/02/18 17:48]
david.verdin@cru.fr
dev:custom_archiving [2011/03/15 10:02] (current)
david.verdin@cru.fr
Line 14: Line 14:
  
 ^Field name  ^Data type  ^Field description ​ ^ ^Field name  ^Data type  ^Field description ​ ^
-|message_key ​ |int(11) ​ |the SMTP message identifier ​ |+|message_key ​ |int(11) ​ |an autoincremental numerical key  |
 |message_id ​ |varchar(150) ​ |the SMTP message identifier ​ | |message_id ​ |varchar(150) ​ |the SMTP message identifier ​ |
 |group_id ​ |varchar(150) ​ |the name of the mailing list to which the message was sent  | |group_id ​ |varchar(150) ​ |the name of the mailing list to which the message was sent  |
Line 20: Line 20:
 |subject ​ |varchar(300) ​ |the content of the SMTP Subject field in the orginal message ​ | |subject ​ |varchar(300) ​ |the content of the SMTP Subject field in the orginal message ​ |
 |message ​ |text  |the full SMTP message, including all the headers ​ | |message ​ |text  |the full SMTP message, including all the headers ​ |
-|uid  | |?  ​|+|uid  | varchar(150) ​ ​| ​we have a header X-UID in the message that we want to save here |
  
-<box red|Primary key specification>​ 
-The smtp header ''​message-id:''​ doesn'​t seem to be a good primary key. If a message is sent to two lists, we could have a primary key collision. For this reason, we propose to add an arbitrary numerical primary key. Search by ''​message-id:''​ would still be possible. 
-</​box>​ 
  
  
Line 40: Line 37:
   * **Distribution**. In the Sympa sources, you will find the script in the ''<​sympa_home>/​bin/​etc/​scripts/''​ directory under the name ''​db_archiver.pl''​.   * **Distribution**. In the Sympa sources, you will find the script in the ''<​sympa_home>/​bin/​etc/​scripts/''​ directory under the name ''​db_archiver.pl''​.
   * **Name and path**. We use a parameter named ''​archiver_path''​ that replaces the existing ''​[[https://​www.sympa.org/​manual/​web-interface#​mhonarc|mhonarc]]''​ parameter. This parameter can be defined at the list or virtual level. You can use any script name or path for the script. You can have as much versions of the script as you want. One for each list if you like.   * **Name and path**. We use a parameter named ''​archiver_path''​ that replaces the existing ''​[[https://​www.sympa.org/​manual/​web-interface#​mhonarc|mhonarc]]''​ parameter. This parameter can be defined at the list or virtual level. You can use any script name or path for the script. You can have as much versions of the script as you want. One for each list if you like.
 +
 +====== Here it is ! ======
 +
 +You can download ​ it as a tar file which is version **5.4.6ca** or a patch that can be applied in versions **5.4**
 +  * {{:​dev:​sympa-custom-archiver.tar.gz|}}
 +  * {{:​dev:​custom_archiver_5.4.patch.txt|}}
 +
 +This modification is allready in Sympa 6.0
 +
 +You can use this version just now. As long as you don't modify wwsympa.conf,​ it won't change Sympa'​s behaviour. You will introduce the new archiver engine by changing //​custom_archiver//​ parameter in wwsympa.conf.
 + 
 +The tar include //​custom_archiver.pl//​ a sample archiver that does what you ask for. CAUTION: Note that Sympa always guess that the custom archiver script accepts two variables : "​--list"​ whose value is the full name of the list (including the domain part) and "​--file"​ that will contain the absolute path to the message file that will be archived. Each time the custom archiver is called, it is called with these two parameters with their values filled.
 +
 +To use our sample custom archiver, you need to:
 +
 +  - create the database in which you want to store, with a table having the fields we defined here: [[:​dev:​custom_archiving#​storage_structure]]
 +  - modify the wwsympa.conf to add the following paragraph: ​ <hi #​98fb98>​custom_archiver ​ <​absolute_path_to_custom_archiver.pl></​hi>​
 +  - restart archived.pl (you may check everything using debug mode : "​archived -d"
 +
 +In archived.pl,​ the parameters related to the database are:
 +<​code>​
 +host name: '​localhost'​
 +database type: '​mysql';​
 +database name: '​custom_archive';​
 +table in which data are stored: '​archive';​
 +user name: '​toto';​
 +password: '​tutu';​
 +</​code>​
 +
 +Either you use this values to test or you change them in custom_archiver.pl. ​
 +
 +If you have any problem, please report first by mail with as many details as possible, you can also phone Serge : +33 2 2323 7147 ((often not in my office but ...)), we will pleased to help you. Let us known if this does what you ask for.
 +
 +
 +
 +
  • dev/custom_archiving.1234975719.txt.gz
  • Last modified: 2009/02/18 17:48
  • by david.verdin@cru.fr