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 5th December 2011, 11:12
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default IspConfig API: FTP & Email not accessible

Hi guys,

I am using your API to connect my software to your IspConfig these are my steps:

1. Create a client (client_add)
2. Create the website (sites_web_domain_add)
3. Create the FTP account (sites_ftp_user_add)
4. Create the Email Account (mail_user_add)
5. Create the Database (sites_database_add)

All the elements are visible in the IspConfig panel but the FTP and the Email doesn't work.

I mean that If I try to log with roundcube for the email account and/or browse by the Filezilla the ftp profile created It doesn't connect.

These are the parameters log from my software to your software:

Code:
05-12-2011 09:48:32 - ID 1 - Shineisp_Api_Panels_Ispconfig_Main::create_client - Paramenters: {"company_name":"My User","contact_name":"John Doe","customer_no":"212","vat_id":"IT1231231231","email":"info@johndoe.com","street":"via Roma 31","zip":"20111","city":"Milan","state":"TS","country":"IT","mobile":[],"fax":[],"telephone":"+39.0400644524","language":"it","usertheme":"default","template_master":0,"template_additional":"","created_at":0,"limit_web_quota":"3000","limit_mailbox":"10","limit_database":"3","limit_traffic_quota":"12000","limit_ftp_user":"3","limit_web_domain":"5","limit_mailaliasdomain":"1","limit_maildomain":"10","limit_mailcatchall":"3","limit_mailforward":"10","limit_mailrouting":"10","limit_fetchmail":"3","limit_mailfilter":"10","limit_mailquota":"1000","limit_spamfilter_wblist":"-1","limit_web_aliasdomain":"10","limit_cron_frequency":"15","limit_cron_type":"url","limit_web_subdomain":"15","limit_spamfilter_policy":"-1","ssh_chroot":"no,jailkit","limit_spamfilter_user":"-1","limit_webdav_user":"0","limit_cron":"7","limit_shell_user":"0","web_php_options":"no,fast-cgi","username":"johndoe","password":"furerufe"}
05-12-2011 09:48:33 - ID 1 - Shineisp_Api_Panels_Ispconfig_Main::create_website - Paramenters: {"server_id":"1","ip_address":"","domain":"johndoe.com","type":"vhost","parent_domain_id":0,"vhost_type":"name","hd_quota":"3000","traffic_quota":"12000","errordocs":1,"is_subdomainwww":1,"subdomain":"www","php":"fast-cgi","active":"y","traffic_quota_lock":"n","system_user":"web1","allow_override":"All","custom_php_ini":"","apache_directives":""}
05-12-2011 09:48:34 - ID 1 - Shineisp_Api_Panels_Ispconfig_Main::create_ftp - Paramenters: {"server_id":1,"parent_domain_id":3790,"username":"xewewajo","password":"wudoteyo","quota_size":"3000","active":"y","uid":"5000","gid":"5000","dir":"maybe","quota_files":-1,"ul_ratio":-1,"dl_ratio":-1,"ul_bandwidth":-1,"dl_bandwidth":-1}
05-12-2011 09:48:43 - ID 1 - Shineisp_Api_Panels_Ispconfig_Main::create_mail - Paramenters: {"server_id":"3","email":"info@johndoe.com","login":"admin@johndoe.com","password":"dedubati","uid":5000,"gid":5000,"maildir":"","quota":1048576000,"cc":"","homedir":"","autoresponder":"n","autoresponder_start_date":"","autoresponder_end_date":"","autoresponder_text":"","move_junk":"n","custom_mailfilter":"spam","postfix":"y","access":"n","disableimap":"n","disablepop3":"n","disabledeliver":"n","disablesmtp":"n"}
05-12-2011 09:48:47 - ID 1 - Shineisp_Api_Panels_Ispconfig_Main::create_database - Paramenters: {"server_id":"2","type":"y","database_name":"db_o","database_user":"mahugima","database_password":"yuwicini","database_charset":"UTF8","remote_access":"y","remote_ips":"","active":"y"}
FTP:
Code:
Risposta:	220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Risposta:	220-You are user number 1 of 50 allowed.
Risposta:	220-Local time is now 09:56. Server port: 21.
Risposta:	220-This is a private system - No anonymous login
Risposta:	220-IPv6 connections are also welcome on this server.
Risposta:	220 You will be disconnected after 15 minutes of inactivity.
Comando:	USER xewewajo
Risposta:	331 User xewewajo OK. Password required
Comando:	PASS ********
Risposta:	421 Home directory not available - aborting
Email
Seems that the email has been not created. Roundcube tells me that there is not any account with the credencials posted.

Furthermore if I delete the customer and all the services by the IspConfig panel I get this error: Possible security violation when deleting the maildir

If you need to see my inteface for IspConfig take a look at: http://code.google.com/p/shineisp/so...onfig/Main.php

Last edited by vaio1; 5th December 2011 at 11:20.
Reply With Quote
Sponsored Links
  #2  
Old 5th December 2011, 11:16
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,995
Thanks: 840
Thanked 5,648 Times in 4,458 Posts
Default

Seems as if you have not set the maildir or that you set a invalid maildir path while you created. You might want to take a look at bthe example functions that we proviude in the 3.0.4.1 tar.gz and also compare the database records for mail users that you created with the api with one that you created in ispconfig to see the correct parameters.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 5th December 2011, 11:45
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Hi Till,

these are my email parameters sent to ISPConfig API:

Code:
{
   "server_id":"3",
   "email":"info@johndoe.com",
   "login":"admin@johndoe.com",
   "password":"dedubati",
   "uid":5000,
   "gid":5000,
   "maildir":"",
   "quota":1048576000,
   "cc":"",
   "homedir":"",
   "autoresponder":"n",
   "autoresponder_start_date":"",
   "autoresponder_end_date":"",
   "autoresponder_text":"",
   "move_junk":"n",
   "custom_mailfilter":"spam",
   "postfix":"y",
   "access":"n",
   "disableimap":"n",
   "disablepop3":"n",
   "disabledeliver":"n",
   "disablesmtp":"n"
}
and these are your parameters:

Code:
'server_id' => 1,
			'email' => 'hmmnoe@test.int',
			'login' => 'hmmnoe@test.int',
			'password' => 'howtoforge',
			'name' => 'hmmnoe',
			'uid' => 5000,
			'gid' => 5000,
			'maildir' => '',
			'quota' => 10000000000,
			'cc' => '',
			'homedir' => '',
			'autoresponder' => 'n',
			'autoresponder_start_date' => '',
			'autoresponder_end_date' => '',
			'autoresponder_text' => 'hallo',
			'move_junk' => 'n',
			'custom_mailfilter' => 'spam',
			'postfix' => 'n',
			'access' => 'n',
			'disableimap' => 'n',
			'disablepop3' => 'n',
			'disabledeliver' => 'n',
			'disablesmtp' => 'n'
I don't see any difference for the maildir param.
Reply With Quote
  #4  
Old 5th December 2011, 12:20
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

I have solved the eMail maildir problem.
In your example you have to write the default value

Code:
'gid' => 5000,
'maildir' => '',
'quota' => 10000000000,
'cc' => '',
You have to tell to your "fans" that the maildir needs a parameter like:

Code:
'gid' => 5000,
'maildir' => '/var/vmail/yourdomain.com/info',
'quota' => 10000000000,
'cc' => '',
Now I can login with roundcube!

Anyway when the email is deleted by IspConfig this error appears: Possible security violation when deleting the maildir
Reply With Quote
  #5  
Old 5th December 2011, 12:26
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,995
Thanks: 840
Thanked 5,648 Times in 4,458 Posts
Default

Quote:
Anyway when the email is deleted by IspConfig this error appears: Possible security violation when deleting the maildir
The reason are your test records without maildir, as a empty maildir is a security violation for the system.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 5th December 2011, 12:27
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Yes now I have completely solved the email problem, thanks!

Now I am trying to solve the ftp problem.
Reply With Quote
  #7  
Old 5th December 2011, 13:27
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Nothing to do

I have set the parameters as mentioned in your example but If I set the UID and the GID Filezilla doesn't connect to the profile. This is my snipped code: http://code.google.com/p/shineisp/so...g/Main.php#268

Code:
Risposta:	220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Risposta:	220-You are user number 1 of 50 allowed.
Risposta:	220-Local time is now 12:18. Server port: 21.
Risposta:	220-This is a private system - No anonymous login
Risposta:	220-IPv6 connections are also welcome on this server.
Risposta:	220 You will be disconnected after 15 minutes of inactivity.
Comando:	USER jdoe_ftp1
Risposta:	331 User jdoe_ftp1 OK. Password required
Comando:	PASS ********
Risposta:	530 Login authentication failed
Updates:
- When I set the UID and GID with the value: 5000 I can login with filezilla but I see only empty dir and not the web dir.
- When I set the UID and GID with the correct web3798 and client133 I don't connect myself anymore.

Why!?

Last edited by vaio1; 5th December 2011 at 13:36. Reason: Updates
Reply With Quote
  #8  
Old 5th December 2011, 13:44
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,995
Thanks: 840
Thanked 5,648 Times in 4,458 Posts
Default

Quote:
When I set the UID and GID with the value: 5000 I can login with filezilla but I see only empty dir and not the web dir.
Thats the UID for the email accounts in /var/vmail, not websites. Dont use this uid for anything related to websites.

Quote:
When I set the UID and GID with the correct web3798 and client133 I don't connect myself anymore.
Compare your ftp user and the website you created by the remote api with a website and FTP user that you created trough ispconfig interface to see the correct parameters for the records.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 5th December 2011, 14:09
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

I have found a little bug in the vhost configuration:

Code:
/etc/apache2/sites-enabled/100-thedomain.com.vhost
In the IspConfig vhost file I can see the <VirtualHost *:80> but when the API create the vhost file I get <VirtualHost :80>.

Why?

Furthermore when I restart the webserver I get:
Code:
# /etc/init.d/apache2 restart
sh: getcwd() failed: No such file or directory
Restarting web server: apache2sh: getcwd() failed: No such file or directory
 ... waiting sh: getcwd() failed: No such file or directory
Reply With Quote
  #10  
Old 5th December 2011, 14:27
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
 
Default

Quote:
Originally Posted by till View Post
Compare your ftp user and the website you created by the remote api with a website and FTP user that you created trough ispconfig interface to see the correct parameters for the records.
It's hard to debug your code or read your database without any documentation. I have followed what you are written in the samples and the FTP doesn't work.

What have I wrong in these parameters?

Code:
Paramenters: {
   "server_id":1,
   "parent_domain_id":3800,
   "username":"jdoe_ftp1",
   "password":"bexujuga",
   "quota_size":"3000",
   "active":"y",
   "uid":"web135",
   "gid":"client3800",
   "dir":"\/var\/www\/clients\/client135\/web3800",
   "quota_files":-1,
   "ul_ratio":-1,
   "dl_ratio":200,
   "ul_bandwidth":-1,
   "dl_bandwidth":100
}
Web Site Parameters
Code:
{
   "server_id":"1",
   "ip_address":"",
   "domain":"testdomain.com",
   "type":"vhost",
   "parent_domain_id":0,
   "vhost_type":"name",
   "hd_quota":"3000",
   "traffic_quota":"12000",
   "errordocs":1,
   "is_subdomainwww":1,
   "subdomain":"www",
   "php":"fast-cgi",
   "active":"y",
   "traffic_quota_lock":"n",
   "system_user":"web1",
   "allow_override":"All",
   "custom_php_ini":"",
   "apache_directives":""
}

Last edited by vaio1; 5th December 2011 at 14:30.
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
ISPConfig 3.0.3.3 fresh instalation - email tab is empty artur_gib Installation/Configuration 14 28th January 2014 20:02
chroot SSH IspConfig2 kextra1 General 4 20th January 2011 19:41
ISPconfig 3: can't send or receive messages zogthegreat Installation/Configuration 6 22nd May 2010 15:45
email receiving died ??? + report a bug in ispconfig email add/remove coolen Installation/Configuration 14 4th November 2008 20:34
CentOS 5.1 Server Setup: LAMP, Email, DNS, FTP, ISPConfig (a.k.a. The Perfect Server) Derekman9 HOWTO-Related Questions 1 15th October 2008 14:35


All times are GMT +2. The time now is 14:39.


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