php script for importing emails

For modifications in and around KeyHelp.
Post Reply
nobody
Posts: 11
Joined: Sun 8. Jan 2023, 22:29
Location: Universe
Contact:

php script for importing emails

Post by nobody »

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
User avatar
Jolinar
Community Moderator
Posts: 3829
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: php script for importing emails

Post by Jolinar »

nobody wrote: Mon 30. Jan 2023, 03:41 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.
We have a special forum section for things like modifications and user scripts ->
Modification Corner / Bastelecke
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
nobody
Posts: 11
Joined: Sun 8. Jan 2023, 22:29
Location: Universe
Contact:

Re: php script for importing emails

Post by nobody »

Jolinar wrote: Mon 30. Jan 2023, 03:59 We have a special forum section for things like modifications and user scripts ->
Modification Corner / Bastelecke
- Saw the 1st page, it's all in german and i have no idea about german language.
- imo would be good to separate german from english forums.

Just move the topic if you find it more appropriate, np.
christian.john
Posts: 228
Joined: Tue 9. Apr 2019, 16:31
Location: Korschenbroich
Contact:

Re: php script for importing emails

Post by christian.john »

I always use a tool called imapsync.

https://github.com/imapsync/imapsync

Once you have installed the script you can use the script even as a website (cgi wrapper on subdomain) syncing mail boxes or mail folder.
Individuelle Entwicklung webbasierter Datenbanksysteme
https://www.john-softwareentwicklung.de
Post Reply