If you are using an smtpsmarthost for relay you'd need to customize var/qmail/control/smtproutes/20SMTPSmartHost.
The default output (with a smarthost), sends all email to the smarthost:
...
$OUT .= ":$SMTPSmartHost";
...
To relay only your selected domains, you would need to add the domains in front of the colon, and remove the default route shown above.
This would do it:
mkdir -p /etc/e-smith/templates-custom/var/qmail/control/smtproutes/
cd /etc/e-smith/templates-custom/var/qmail/control/smtproutes/
# note the dot at the end of the next command...
cp /etc/e-smith/templates/var/qmail/control/smtproutes/20SMTPSmartHost .
Now edit the "custom" copy of 20SMTPSmartHost to list only your desired domains:
{
$OUT = "";
#--------------------------------------------------
# Now check for SMTP smart host
#--------------------------------------------------
if (
$SMTPSmartHost
&&
($SMTPSmartHost ne 'off')
&&
($SMTPSmartHost !~ /^\s*$/)
)
{
# Is the smtp-auth-proxy enabled?
if (${'smtp-auth-proxy'}{'status'} eq 'enabled')
{
$OUT .= ":localhost:26";
}
else
{
$OUT .= "domainA.org:$SMTPSmartHost";
$OUT .= "domainB.org:$SMTPSmartHost";
$OUT .= "domainC.org:$SMTPSmartHost";
}
}
chomp ($OUT);
}
SME is designed to allow persistent, safe override of default settings using this mechanism - a fragment inside .../templates-custom/... with the same name and path as a fragment inside .../templates/... will override and disable the original fragment. Learn more at
https://wiki.contribs.org/Template_TutorialActivate the changes:
signal-event email-update
Removing the new file in ".../templates-custom/..." will re-enable the default settings (in case your changes cause unexpected problems):
rm -f /etc/e-smith/templates-custom/var/qmail/control/smtproutes/20SMTPSmartHost
signal-event email-update