Re: Running on different port with ASMTP
"Matt" <[email protected]> Mon, 24 Jan 2005 10:46:58 -0600
| Newsgroups | gmane.mail.exim.exiscan.user |
|---|---|
| Message-ID | <00c801c50234$5223a5b0$7801a8c0@matthew> |
>>server_advertise_condition = ${if eq {$interface_port}{587}{1}{0}}
Appears to work dandy. Changed my mind and used port 587 instead of 2500
for alternate SMTP. Thanks for all the help.
Matthew
> It is the right direction but not correct. Lets do some testing.
> You can easily test expansions with exim:
> ----
> /usr/sbin/exim -be '{if eq {$interface_port}{}{2500}}'
> {if eq {-1}{}{2500}}
> ----
> Hmm. We get a literal if? Compare your try with the example you found:
> yours: {if eq {$interface_port}{}{2500}}
> example: ${if eq{$tls_cipher}{}{0}{1}}
> Now it is obvious, we are missing the starting $.
> /usr/sbin/exim -be '${if eq {$interface_port}{}{2500}}'
>
> Empty string, looks like the syntax is correct, now lets try to
> understand what it does. String expansions are explained in great
> detail in
> http://www.exim.org/exim-html-4.40/doc/html/spec_11.html#CHAP11
>
> The basic syntax of "if" is:
> ${if <condition>{replacementonsuccess}{replacementonfailure}}
> Apply this to your try:
> <condition> <---> eq {$interface_port}{}
> replacementonsuccess <---> empty string
> replacementonfailure <---> 2500
>
> So you have got a expansion that checks whether $interface_port is
> empty and returns the empty string if this correct and 2500 otherwise.
>
> Do you want that? Recheck the documentation of server_advertise_condition:
> | If it yields the empty string, `0', `no', or `false', the mechanism
> | is not advertised.
>
> Obviously not. You want a expansion that returns something which is
> "`0', `no', or `false'" if $interface_port is 25 and success (1, yes
> or true) if $interface_port 2500. As you are running exim only on
> these two ports you can choose to return true for port 2500 and false
> for anything else.
> cu andreas