Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
cPanelResources

Tutorial How to convert SquirrelMail address books to Roundcube or Horde

Manually export SquirrelMail address books and import them into Roundcube or Horde.

  1. cPanelResources
    In April of 2018 we announced the deprecation and removal of SquirrelMail. cPanel version 76 stopped shipping SquirrelMail in new installations. cPanel version 78 removes SquirrelMail completely. More information can be found in this Blog Post.

    With this deprecation and removal comes the need to transfer users' address books to either Roundcube or Horde.

    Here we'll look at the steps required to export the SquirrelMail address book data into vcard format so that users can import their address books into their chosen webmail client.

    1. Login via SSH and make a backup of the user's .sqmaildata directory:
      Code:
      cp -a /home/username/.sqmaildata /home/username/.sqmaildata-backup
    2. Browse to a user's .sqmaildata directory:
      Code:
      cd /home/username/.sqmaildata/
      
    3. Create a file named /home/username/.sqmaildata/address-book-converter.sh with the following content:
      Code:
      #!/bin/bash
      for x in `ls *.abook`
      do
      
      cat $x | while read line
      do
      echo "BEGIN:VCARD" >> $x.vcf
      echo "VERSION:3.0" >> $x.vcf
      echo -n "N:" >> $x.vcf
      echo -n `echo $line | cut -d'|' -f3` >> $x.vcf
      echo -n ";" >> $x.vcf
      echo `echo $line | cut -d'|' -f2` >> $x.vcf
      echo -n "FN:" >> $x.vcf
      echo `echo $line | cut -d'|' -f1` >> $x.vcf
      echo -n "EMAIL;TYPE=PREF,INTERNET:" >> $x.vcf
      echo `echo $line | cut -d'|' -f4` >> $x.vcf
      echo "END:VCARD" >> $x.vcf
      echo >> $x.vcf
      
      done
      
      echo "done $x"
      done
      

      Source: Linux in My Box: Migrating your squirrel mail contacts to roundcube


    4. Set the permissions on this script to 0755:
      Code:
      chmod 0755 /home/username/.sqmaildata/address-book-converter.sh
      
    5. Run the converter script:
      Code:
      sh /home/username/.sqmaildata/address-book-converter.sh
      
    6. Ensure the newly generated .vcf file is owned by the account username:
      Code:
      chown username.username /home/username/.sqmaildata/*.vcf
    Upon completing the steps above, you can browse to the /home/$username/.sqmaildata/ directory to download the .vcf file(s) to your workstation using the file transfer method of your preference (e.g. FTP, SFTP, cPanel >> File Manager).

    Once downloaded to your workstation, you can import the .vcf file into Roundcube with the following steps:
    1. Login to Roundcube.
    2. Click on the Contacts button in the upper right area.
    3. Click Import in the upper left area.
    4. Click choose file, select the file, and click import.
    You can import the .vcf file into Horde with the following steps:
    1. Login to Horde.
    2. In the horizontal navbar navigate to Address Book -> Address Book.
    3. Click on the Import/Export button in the left sidebar.
    4. Click choose file, select the file, and click import.
    Feel free to use the Discussion tab on this page if you have any trouble with the instructions in this tutorial, or have additional questions or feedback.

    Thanks!
    jndawson likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice