Re: [exim] Email sent out depending on port received

Top Pagina
Delete this message
Reply to this message
Auteur: Jeroen van Aart
Datum:  
Aan: exim-users
Onderwerp: Re: [exim] Email sent out depending on port received
Phil Pennock wrote:
> On 2008-04-22 at 16:02 -0700, Jeroen van Aart wrote:
>> Below applies to options 1a and 1b?
>
> The first part, yes.
>
>> Would adding the "condition =" statement be enough to allow email to be
>> sent out if delivered on port 24? I understand I should ask this on the
>> debian exim list, but maybe someone has the answer.
>
> If I understand what you're asking, yes. My head is not very clear
> right now, though.
>
>> Exim is configured to send to a smarthost and the below configuration
>> section applies:
>>
>> smarthost:
>>    debug_print = "R: smarthost for $local_part@$domain"
>>    driver = manualroute
>>    domains = ! +local_domains
>>    transport = remote_smtp_smarthost
>>    route_list = * DCsmarthost byname
>>    host_find_failed = defer
>>    same_domain_copy_routing = yes

>>
>> Apart from "condition = ${if =={$received_port}{24}}" what would I have
>> to add/edit here to make the above work? I assume something like:
>
> I missed something you said originally, because my head wasn't as clear
> as I thought it was, which is that the ability to send out via a
> smarthost should remain as a default. Sorry.
>
> Drop option 2 from my original answer. It doesn't apply.


> Add a new Router, direct_outbound, which should be a dnslookup router as
> you suggest; add the condition to this new Router and put the new Router
> before the "smarthost" router.


Thanks for the help.
I added this before the smarthost router and it works fine:

direct_outbound:
        debug_print = "R: dnslookup for $local_part@$domain"
        driver = dnslookup
        domains = ! +local_domains
        transport = remote_smtp
        same_domain_copy_routing = yes
        # ignore private rfc1918 and APIPA addresses
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
                172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\
                255.255.255.255
        condition = ${if =={$interface_port}{24}}
        no_more


How would I change this to allow email with a local domain(s) as
recipient to be sent to one or more specific IP addresses?

Best regards,
Jeroen