On 2012-04-16 at 18:32 +0100, paul cooper wrote:
> ive set up a test version on my local machine and when i send from a
> client
Not enough data visible. In the main section of your configuration,
add:
log_selector = +outgoing_port
(or amend the existing rule if you already set log_selector).
> begin routers
>
> smarthost_auto:
> debug_print ="T. auto_route remote_smtp for $local_part@$domain from
> $sender_address "
> self = send
> condition =
> ${extract{smarthost}{${lookup{$sender_address}wildlsearch*@{/etc/exim4/smarthosts}{$v
> alue}fail}}}
> driver = manualroute
> transport = remote_smtp
> route_list = *
> "${extract{smarthost}{${lookup{$sender_address}wildlsearch{/etc/exim4/smarthosts}
> {$value}fail}}}"
> domains = ! +local_domains
The route_list lookup is still "wildlsearch", not "wildlsearch*@".
(You might also use route_data instead of route_list, and drop the
leading "*", so that you're just saying "everything goes to this
destination I give here").
If you add:
address_data = ${lookup{$sender_address}wildlsearch*@{/etc/exim4/smarthosts}{$value}fail}
to the Router, then in Transports (and Authenticators and later Routers)
you can reference "$address_data" instead of that lookup, and cut down
on the potential for mistakes (plus some efficiency benefits, deriving
in part from how Exim caches lookup results).
> begin transports
>
> remote_smtp:
> debug_print = "T: remote_smtp for $local_part@$domain and $host_address"
> driver = smtp
> tls_certificate = /etc/exim4/exim.crt
> tls_privatekey = /etc/exim4/exim.key
> hosts_require_auth = *
> port =
> ${extract{port}{${lookup{me@???}wildlsearch{/etc/exim4/smarthosts}{$value}fail}}}
Again, you omit "*@" from the end of "wildlsearch*@". Also, you're now
specifying "me@???" instead of "$sender_address".
If you use address_data, then you can write this, which also provides a
default port, while being much easier to read:
port = ${extract{port}{$address_data}{$value}{25}}
> begin authenticators
>
> login:
> driver = plaintext
> public_name=LOGIN
> client_send = :
> "${extract{auth_name}{${lookup{$sender_address}wildlsearch{/etc/exim4/smarthosts}{$value}fail}}}"
> :
> "${extract{auth_pass}{${lookup{$sender_address}wildlsearch{/etc/exim4/smarthosts}{$value}fail}}}"
Same missing "*@" here.
client_send = : \
${extract{auth_name}{$address_data}{$value}fail} : \
${extract{auth_pass}{$address_data}{$value}fail}
Again, by using address_data, you confine all of the lookups to the
Router which set that, keeping everything in one place and making it
easier to do things like change the source of the data, spot missing
modifiers on the lookup type, etc.
-Phil