Posts by Zero

    Hello all,


    I was in need of a way to automatically include hooks when the engine is executed and I ended up with a very easy modification to achieve this.


    As suggested by Nuxwin in his thread (http://forum.i-mscp.net/Thread…0-rc1-4-and-newer-version) I've made sure that the HooksManager will load all the perl scripts in {CONF_DIR}/custom.d/ at initialization.


    No priorities support thought.


    To apply the patch:

    Code
    1. patch /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff


    To remove the patch:

    Code
    1. patch -R /var/www/imscp/engine/PerlLib/iMSCP/HooksManager.pm < HooksManager.pm.diff


    Use at your own risk.

    Modify your /etc/imscp/apache/00_master.conf or /etc/imscp/apache/00_master_ssl.conf and add this vhost to the end:


    Code
    1. <VirtualHost {BASE_SERVER_IP}:80> ServerAdmin {DEFAULT_ADMIN_ADDRESS} DocumentRoot {ROOT_DIR}/gui/public/tools/webmail ServerName {BASE_SERVER_VHOST} ServerAlias webmail.* <IfModule mpm_itk_module> AssignUserID {SYSTEM_USER_PREFIX}{SYSTEM_USER_MIN_UID} {SYSTEM_USER_PREFIX}{SYSTEM_USER_MIN_UID} </IfModule> # Only enable suexec when not running with the itk mpm <IfModule !mpm_itk_module> <IfModule suexec_module> SuexecUserGroup {SYSTEM_USER_PREFIX}{SYSTEM_USER_MIN_UID} {SYSTEM_USER_PREFIX}{SYSTEM_USER_MIN_UID} </IfModule> </IfModule> <Directory {ROOT_DIR}/gui/public/tools/webmail> Options -Indexes Includes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> <IfModule mod_fcgid.c> <Directory {ROOT_DIR}/gui/public/tools/webmail> FCGIWrapper {PHP_STARTER_DIR}/master/php{PHP_VERSION}-fcgid-starter .php Options +ExecCGI </Directory> <Directory "{PHP_STARTER_DIR}/master"> AllowOverride None Options +ExecCGI MultiViews -Indexes Order allow,deny Allow from all </Directory> </IfModule> <IfModule mod_fastcgi.c> ScriptAlias /php5/ {PHP_STARTER_DIR}/master/ <Directory "{PHP_STARTER_DIR}/master"> AllowOverride None Options +ExecCGI MultiViews -Indexes Order allow,deny Allow from all </Directory> </IfModule> <IfModule php5_module> <Directory {ROOT_DIR}/gui/public/tools/webmail> php_admin_value sendmail_path '/usr/sbin/sendmail -f webmaster@{BASE_SERVER_VHOST} -t -i' php_admin_value open_basedir "{ROOT_DIR}/gui/:{CONF_DIR}/:{MR_LOCK_FILE}:/proc/:/bin/df:/bin/mount:{RKHUNTER_LOG$ php_admin_value session.save_path "{ROOT_DIR}/gui/data/sessions/" php_admin_value upload_tmp_dir "{ROOT_DIR}/gui/data/tmp/" php_value include_path ".:{ROOT_DIR}/gui/library/:/usr/share/php" php_admin_value suhosin.session.encrypt "off" </Directory> </IfModule></VirtualHost>


    Then modify /etc/imscp/bind/parts/db_e.tpl and add this after the ftp CNAME:

    Code
    1. ; CNAME for webmail subdomain
    2. webmail IN CNAME www


    Rebuild all configuration files using /var/www/imscp/engine/setup/imscp-setup and everything should be ok, if something isn't working don't panic and report any error here ;)

    Hello,


    so here's a small modification to add DomainKeys (DKIM) support to i-MSCP.


    Install the OpenDKIM package:

    Code
    1. apt-get install opendkim


    Add these lines to the /etc/opendkim.conf file:

    Code
    1. KeyTable refile:/etc/opendkim/KeyTableSigningTable refile:/etc/opendkim/SigningTable


    Create the /etc/opendkim directory and create the basic files:

    Code
    1. mkdir /etc/opendkimtouch /etc/opendkim/KeyTabletouch /etc/opendkim/SigningTable


    Open /etc/default/opendkim and uncomment the following line:

    Code
    1. SOCKET="inet:12345@localhost" # listen on loopback on port 12345


    Now we need to modify the Postfix configuration, open /etc/postfix/main.cf and add these lines at the end of the file:

    Code
    1. milter_default_action = acceptmilter_protocol = 2smtpd_milters = inet:localhost:12345non_smtpd_milters = inet:localhost:12345


    Restart Postfix and start OpenDKIM:

    Code
    1. service postfix restart
    2. service opendkim start


    Now open your browser, and go to your phpMyAdmin installation, login and modify the max length of the domain_text field in domain_dns to 255.
    Backup your /var/www/imscp/engine/PerlLib/Servers/mta/postfix.pm and replace with the one provided here.



    For i-MSCP 1.1.0 Beta 1 only!



    Important notes:
    1. Use this modified postfix.pm at your own risk!
    2. The client(s) should be allowed to use the built-in DNS manager otherwise the TXT record couldn't be generated!


    I'm sorry if something is wrong, but I'm tired, sorry :P

    Files

    Hello,


    I've modified the addDmn function in postfix.pm to generate dkim files, the only thing I need to do now is to contact the iMSCP daemon and tell him to regenerate the config files (the script add a record to the domain_dns table) I've tried this:


    Code
    1. ($rs, $fd) = connect_imscp_daemon();($rs, $rdata) = send_line($fd, 'helo v1.1\r\n');($rs, $rdata) = recv_line($fd);($rs, $rdata) = send_line($fd, 'execute query\r\n');($rs, $rdata) = recv_line($fd);($rs, $rdata) = send_line($fd, 'bye\r\n');close_imscp_daemon($fd);


    I also added this to the top of the file:

    Code
    1. use IO::Socket;
    2. use IO::Socket::INET;
    3. require '../../../imscp_common_methods.pl';


    No errors when running the engine but the DNS file doesn't change.
    Any advice? :)

    Hello all,


    I'm trying to develop an addon for the backend of i-MSCP to add support for DomainKeys, I'm not a Perl developer (mainly PHP) and I'm watching the files under /var/www/imscp/engine/PerlLib to get some inputs but I'm stucked.


    I would like to ask the developers some things:


    There is a particoular function that get called to register the hooks inside the addon?
    Hooks can be attached to all the functions inside /var/www/engine/PerlLib/Servers/mta/postfix.pm or only to some functions inside /var/www/engine/PerlLib/Servers/mta/postfix/installer.pm (I think I've seen some calls to the callbacks array) ?


    Thanks everyone!