Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th January 2013, 18:50
fatbear fatbear is offline
Member
 
Join Date: Jul 2010
Location: Raleigh, NC US
Posts: 42
Thanks: 4
Thanked 9 Times in 4 Posts
Default 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?
__________________
Steve Amerige, Fat Bear Incorporated
Server Leasing | Web Software Development | User Experience & Graphic Design
Managed Services, Website, Java, and Source-Code Hosting
Did my post help you? Click the Thanks button!
Reply With Quote
Sponsored Links
  #2  
Old 6th January 2013, 19:52
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 6th January 2013, 21:10
fatbear fatbear is offline
Member
 
Join Date: Jul 2010
Location: Raleigh, NC US
Posts: 42
Thanks: 4
Thanked 9 Times in 4 Posts
Default

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?
__________________
Steve Amerige, Fat Bear Incorporated
Server Leasing | Web Software Development | User Experience & Graphic Design
Managed Services, Website, Java, and Source-Code Hosting
Did my post help you? Click the Thanks button!

Last edited by fatbear; 6th January 2013 at 21:23.
Reply With Quote
  #4  
Old 6th January 2013, 21:44
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,001
Thanks: 840
Thanked 5,650 Times in 4,460 Posts
 
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Email Working ISPConfig3 Squirrelmail and Courier etc Ian Wilson Installation/Configuration 17 19th June 2013 23:58
mail recipient linux_red Installation/Configuration 6 9th March 2012 15:24
Sendig mail Error fisherofer Installation/Configuration 12 30th November 2011 08:56
Problem with dcc-client installation (Postfix) swap-as Installation/Configuration 9 18th September 2008 21:47
Filtering emails using Spamassassin and Clamav for Exchange 2000 Server Rocky Server Operation 19 11th March 2008 09:27


All times are GMT +2. The time now is 00:52.


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