Import multiple mail forwarders

Discussion in 'ISPConfig 3 Priority Support' started by Stelios, Jan 13, 2022.

  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi all and happy new year.

    I need to create 300+ email forwarders for a domain and I was wondering if there is a way to create them in a batch or so to avoid adding them one by one?

    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes, either in the database or through the API.
     
  4. Stelios

    Stelios Active Member HowtoForge Supporter

    The database seems much easier.....which table/field is the proper one @Th0m to import these?

    Thanks a lot
     
  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Probably mail_forwarding, unless you want to use the 'cc' feature of a mailbox, which would be mail_user.
     
  6. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks Jesse, do I need to sync somehow the rest of the servers afterwards or they will do automatically once the daily cron runs? This is on a multi server setup.
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Yes, you will need to run the resync tool. (If you insert via the remote API that is not needed.)
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    I'm doing something wrong as I can't make it work.
    I've import on the main control panel server under the dbispconfig DB and mail_forwarding tables the values I wanted without a problem via an sql insert. I've test and all data are there under phpmyadmin.
    Then I rsync everything via the control panel but when I do a select from the mail_forwarding table under my 3 email servers nothing gets into their mail_forwarding table.
    Also the new mail forwards don't get listed under control panel.

    Any ideas?
     
  9. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Have you set the correct server_id? If the other mailservers are mirrors, it should be the id of the main server.
     
  10. Stelios

    Stelios Active Member HowtoForge Supporter

    Server id is on all entries 2. I had already added manually a couple in order to check the sql to be correct.
     
  11. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Can you share a few example lines of date?
     
  12. Stelios

    Stelios Active Member HowtoForge Supporter

    Somehow there was a typo in the sql (some \\ strings), once I empty the table and re-import it and afterwards rsync it worked fine.
     
    Th0m likes this.

Share This Page