Howto make relayhost persistent in main.cf?

  • Hello,


    I have a small PC with Debian 8.5.0 and installed i-MSCP 1.3.0.
    The PC is connectet via an Dynamic Domain Provider. All works nearly perfect.


    But my problem is, that i have a relayhost in the main.cf of postfix. When I run the update script to insert my certs from startssl, I lose all configuration in main.cf.


    Is there any way to put something like that in an template, that wil be writen after the upgrade script running into the main.cf?


    Also i want to install things like spamfilter and some other tools. Where can i write the configuration, so that it will be writen in the normal configuration file?


    Sorry about my bad englisch but I hope you understand what i want to do?


    Thanks a lo,
    TiDschay

  • Hello,


    you must use the smarthost listener which is available here: https://github.com/i-MSCP/imsc…x/10_postfix_smarthost.pl


    You can modify that listener file for your own need of course. To resume, when you want add your own configuration parameters and make them persistent, you must use a listener file which will register one or many event listeners. >These listeners must listen on the events that are triggered by i-MSCP core or plugin (depending on what you want to do). At this moment, there is not documentation listing all events. This will be done in near future.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hello Nuxwin,


    thank you for your fast answer.


    OK, i found this file inside the installer of i-MSCP 1.3.0 and edited them. But how do i have to insert this now? What do you mean with listener?
    Wich plugin do i need to install?
    I yust found something in the internet about ist but the link dosent work anymore.


    Please excuse me but i dont have any idea how to set it up. Are the lines begining with "my" the line, where i can put alle the informations about the host where i want to deliver my mails? Or can i just write all informations in there like in main.cf?


    Original it seems like this, what i have to write in main.cf:


    elayhost = [RELAYHOST]
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
    smtp_sasl_security_options = noanonymous
    smtp_use_tls = yes
    smtp_enforce_tls = yes
    smtp_tls_enforce_peername = no


    should i have to put a "my" on the begin of every line?


    Thank you a lot for helping me.
    Regards, TiDschay

  • You must only edit value of the configuration variables: https://github.com/i-MSCP/imsc…_postfix_smarthost.pl#L31
    Once done, you must put the file into the /etc/imscp/listenerd.d directory and run:


    Code
    1. perl /var/www/imscp/engine/setup/imscp-reconfigure -danv

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hy again,


    ok i did it now but when i start "perl /var/www/imscp/engine/setup/imscp-reconfigure dasnv"


    i get the error:


    Can't locate iMSCP/EventManager.pm in @INC (you may need to install the iMSCP::EventManager module) (@INC contain
    s: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/p
    erl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) a
    t /etc/imscp/listeners.d/10_postfix_smarthost.pl line 26.


    BEGIN failed--compilation aborted at /etc/imscp/listeners.d/10_postfix_smarthost.pl line 26.


    From where can i get the EventManager Plugin? i searches in the Plugindirectory but could not found this plugin


    Iam so sorry for so much questions,
    Best regards,
    TiDschay

  • From where can i get the EventManager Plugin?

    This is not a plugin ! This is a module which is part of i-MSCP core...


    Please, try to upgrade to latest 1.3.x using the following archive: https://github.com/i-MSCP/imscp/archive/1.3.x.tar.gz


    There is maybe a bug in 1.3.0.


    Also, the command is not


    Code
    1. # perl /var/www/imscp/engine/setup/imscp-reconfigure dasnv


    but:


    Code
    1. # perl /var/www/imscp/engine/setup/imscp-reconfigure -danv


    Honnestly, I think that you don't have sufficient knownledges to play with i-MSCP ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hy again,


    now i upgraded to 1.3.x and all will work fine :)


    Thank you a lot and you are right. it is my first time i use this fine i-MSCP ;)


    So i don't want to disturb you today anymore. Have a nice Sunday,
    Best Regards, TiDschay