php script for importing emails
Posted: Mon 30. Jan 2023, 03:41
For my own needs i've created a little script in php for importing emails from a plesk backup (roundcube) to keyhelp roundcube.
1) Basically you extract an email folder from the plesk backup (e.g. info/Maildir/.Sent/cur) and put it into the script folder.
2) Input a name for the new folder and the "program" will extract all files from the above mentioned directory, rename the files into .eml files and create a .zip archive which can be imported easily into roundcube.
If someone's interested please send me a PM with your email address so i'll send it as i don't want to spam the forum with code that maybe nobody needs.
I check this forum once a week | once every 2 weeks as i'm very busy so please be patient for reply.
Bonus: after finishing importing all emails into the new roundcube i've discovered that a lot of emails cannot be read because of some formatting issue (maybe because they weren't written with an WYSIWYG editor | not formatted in html ?)
To solve the issue i've edited the parameter from
$config['imap_disabled_caps'] = [];
to
$config['imap_disabled_caps'] = ['BINARY'];
in file /home/keyhelp/www/roundcube/config/defaults.inc.php
1) Basically you extract an email folder from the plesk backup (e.g. info/Maildir/.Sent/cur) and put it into the script folder.
2) Input a name for the new folder and the "program" will extract all files from the above mentioned directory, rename the files into .eml files and create a .zip archive which can be imported easily into roundcube.
If someone's interested please send me a PM with your email address so i'll send it as i don't want to spam the forum with code that maybe nobody needs.
I check this forum once a week | once every 2 weeks as i'm very busy so please be patient for reply.
Bonus: after finishing importing all emails into the new roundcube i've discovered that a lot of emails cannot be read because of some formatting issue (maybe because they weren't written with an WYSIWYG editor | not formatted in html ?)
To solve the issue i've edited the parameter from
$config['imap_disabled_caps'] = [];
to
$config['imap_disabled_caps'] = ['BINARY'];
in file /home/keyhelp/www/roundcube/config/defaults.inc.php