Listener file for adding entries in Postfix transport(5) table

  • @Nuxwin


    Background: I have an issue with an ISP in our region that has arbitrarily blocked our IP for emails heading into their domain. While we work to get that sorted, my data center has provided a relay host so that our messages can be delivered. This, of course, involves adding entries to /etc/postfix/imscp/transport, which we have done manually as a work-around. This led me to this thread:


    I am working on a listener to enforce entries in /etc/postfix/imscp/transport, but while I am a coder from way back, I am really a coder from waaaaaay back. If I can get this working, it will be my first humble code contribution to the i-MSCP universe. Here is what I have so far (based on 10_system_hosts.pl):


    I have two questions:

    • Is “afterSetupServerHostname” a good trigger for this event, or would you recommend something else?
    • I do not have a clue how to trigger the necessary “postmap /etc/postfix/imscp/transport” from this file. Feeling pretty stupid here, but at least I am smart enough to know when I am stupid—and that is one good step in the direction of being a little less being stupid!

    Thank you so very much for your help with this, and for all you do to make our lives better through i-MSCP!

    Regards,


    /\/\___


    “There are 10 kinds of people. Those who understand base-2 and those who do not.”

  • @innodapt


    That is really simple. I'll give you the modified version in few minutes. First, I'll move your post in a new thread...


    Edit: New thread created. Give me few minutes.

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

  • @innodapt


    10_postfix_transport_table.pl : http://pastebin.com/TMtnDbvN


    As you can see, all is simple when you use i-MSCP API. postmap will be called automatically at the very end of i-MSCP reconfiguration.



    If you want understand how it works, see:



    Note: I'll commit that listener in few minutes.

    Files

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

  • Thank you!


    Studying the “how it works” now. I have been looking for an opportunity to explore the API.

    Regards,


    /\/\___


    “There are 10 kinds of people. Those who understand base-2 and those who do not.”

  • @innodapt


    You're welcome ;)


    Listener pushed in our development branch. See https://github.com/i-MSCP/imsc…ostfix_transport_table.pl

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