[imp] Problem inserting default signatures into mysql table
horde.horde_prefs
Mark Worsdall
imp at worsdall.demon.co.uk
Sat Apr 26 18:16:43 PDT 2003
Hi All,
I am adapting my old signatures script which was written for IMP2.2.4 to
now work with IMP3.
For each user I am inserting 2 records:-
INSERT INTO $sqlTable
VALUES ('$email', 'horde', 'default_identity', '0')
and
INSERT INTO $sqlTable
VALUES('$email', 'horde', 'identities', '$pref_value')
To determine all this I created with IMP a signature, then had a look at
the mysql table:-
$pref_value =
a:1:{i:0;a:11:{s:2:"id";s:16:"Default
Identity";s:8:"fullname";s:13:"Mark
Worsdall";s:9:"from_addr";s:0:"";s:12:"replyto_addr";s:0:"";s:9:"signatur
e";s:17:"--\nMe\nhttp://\n";s:9:"sig_first";i:0;s:10:"sig_dashes";i:0;s:1
4:"save_sent_mail";s:1:"1";s:16:"sent_mail_folder";s:0:"";s:11:"private_k
ey";N;s:16:"private_key_type";N;}}
I put the \n in for the newline. The original that I pulled from the
mysql table written by IMP3 actually had the linefeeds in like below:
a:1:{i:0;a:11:{s:2:"id";s:16:"Default
Identity";s:8:"fullname";s:13:"Mark
Worsdall";s:9:"from_addr";s:0:"";s:12:"replyto_addr";s:0:"";s:9:"signatur
e";s:17:"--
Me
http://
";s:9:"sig_first";i:0;s:10:"sig_dashes";i:0;s:14:"save_sent_mail";s:1:"1"
;s:16:"sent_mail_folder";s:0:"";s:11:"private_key";N;s:16:"private_key_ty
pe";N;}}
Then I manually deleted (used mysql) the 2 records from
horde.horde_prefs, then ran my script to insert exactly the same to
records back into the table.
When I look at the signature with compose it is corrupt.
Before I delve into the PHP stuff can the author give me some pointers
to what they have done when creating the default signature?
I have noticed that the s: number after the text "signature" is
different for every signature saved, what is this meaning of this
number?
s:9:"signature";s:17:
s:9:"signature";s:22:
s:9:"signature";s:57:
Note the changing number, what is that for?
Oh, the reason why is it is college policy to have a standard signature
for everyone that has their Name, position, email and college url in the
signature. We are a small college with about 200 students and staff but
I cannot be editing everyones signature plus this script also creates a
file based signature for pine and symbolic links for Eudora to the same
signature.
It was easy for IMP2.2.4 but is proving problematic for IMP3.
M.
--
Mark Worsdall
More information about the imp
mailing list