DomainKeys (DKIM) support for iMSCP

  • 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!

    Edited once, last by Zero ().

  • 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? :)