<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
	<name>postfix</name>
	<version>1.1.12_1</version>
	<title>Services: Postfix Forwarder</title>
        <preoutput>yes</preoutput>
        <savetext>Change</savetext>
	<aftersaveredirect>pkg_edit.php?xml=postfix.xml&amp;id=1</aftersaveredirect>
	<menu>
		<name>Postfix Forwarder</name>
		<tooltiptext>Configure Postfix Forwarder</tooltiptext>
		<section>Services</section>
		<url>pkg_edit.php?xml=postfix.xml&amp;id=1</url>
	</menu>
	<fields>
		<field>
			<fielddescr>Primary Domain</fielddescr>
			<fieldname>primarydomain</fieldname>
			<description>Enter your primary domain.  (ex: example.com)</description>
			<type>input</type>
		</field>
		<field>
			<fielddescr>My Hostname</fielddescr>
			<fieldname>hostname</fieldname>
			<description>Enter the hostname of this system to be used by Postfix.  (ex: mail.example.com)</description>
                        <type>input</type>
		</field>
		<field>
		    <type>rowhelper</type>
		    <rowhelper>
			<rowhelperfield>
			    <type>input</type>
			    <size>20</size>
			    <fieldname>domain</fieldname>
			    <fielddescr>Domain</fielddescr>
			    <description>Enter the domain here (ex: example.com)</description>
			</rowhelperfield>
			<rowhelperfield>
			    <type>input</type>
			    <size>20</size>
			    <fieldname>mailserverip</fieldname>
			    <fielddescr>Mail Server IP</fielddescr>
			    <description>Enter the mail server IP to forward to here.</description>
			</rowhelperfield>
		    </rowhelper>
		</field>
        </fields>
	<custom_add_php_command>
	</custom_add_php_command>
	<custom_php_deinstall_command>
	</custom_php_deinstall_command>
	<custom_php_install_command>
	</custom_php_install_command>
        <templates>
            <template>
                <filename>/usr/local/etc/postfix/main.cf</filename>
                <templatecontents>
myhostname = hostname_fieldvalue \n
mydomain = primarydomain_fieldvalue \n
relay_domains = domain_fieldvalue[ ] \n
                </templatecontents>
            </template>
            <template>
                <filename>/usr/local/etc/postfix/transport</filename>
                <templatecontents>domain_fieldvalue smtp:[mailserverip_fieldvalue]\n</templatecontents>
            </template>
        </templates>
        <start_command>/usr/local/sbin/postfix start</start_command>
        <restart_command>/usr/local/sbin/postmap /usr/local/etc/postfix/transport ; /usr/local/sbin/postfix reload</restart_command>
</packagegui>