HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   How are sys_userid, sys_groupid determined for forwarding e-mail mappings? (http://www.howtoforge.com/forums/showthread.php?t=60147)

fatbear 6th January 2013 17:50

How are sys_userid, sys_groupid determined for forwarding e-mail mappings?
 
I'm working on a script to allow me to bulk import mail forwards. When I add forwards manually, I can see the MySQL table mail_forwarding specifies the sys_userid and sys_groupid fields. I want to determine how to pick values for these fields based on the source e-mail domain.

I first thought it would be the web_domain table, but in this table, all of the sys_userid values are 1, even though I have multiple domains.

I next thought it might be dns_soa, but it seems that the sys_userid and sys_groupid values here are 1:1 with a specific client, not with a domain.

Can anyone tell me sys_userid and sys_groupid are computed when adding a forwarding e-mail address?

till 6th January 2013 18:52

Quote:

I want to determine how to pick values for these fields based on the source e-mail domain.
The values in a foward are the same then the ones of the mail_domain.

As a general note: Use the remote api to add the forwards, the sys_userid and sys_groupid are set by the functions automatically. Adding them to the tables manually will lead to invalid transactions and no changes will get written to disk, so dont add anything to the ispconfig database directly, use the api.

fatbear 6th January 2013 20:10

I forgot that there was code in the ISPConfig-3.0.4.6.tar.gz file. I found two relevant files.

remoting_client/API-docs/mail_forward_add.html
remoting_client/examples/mail_forward_add.php

In the latter, I see that $params needs server_id. What is the appropriate way to get this? Via a MySQL query? Or, because this isn't likely to change, just hard code it?

till 6th January 2013 20:44

Quote:

In the latter, I see that $params needs server_id. What is the appropriate way to get this? Via a MySQL query? Or, because this isn't likely to change, just hard code it?
The server_id of a forward is the same then the one of the mail_domain as the forward has to be created on the same server.


All times are GMT +2. The time now is 06:49.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.