Tuesday, July 7, 2015

exim smarthost matching null or empty string via wildlsearch

okay, it took me a long time to finally figure how to match possible null / empty string
due to nature that sender_address_domain may be empty if its a bounce mail,
delimiting it in a string did not work, turn out ive to just create a blank {}

client_send = : ${extract{auth_name}{${lookup{${if eq{$sender_address_domain}{}{'default'}{$sender_address_domain}}}nwildlsearch{/etc/smart}{$value}fail}}} : ${extract{auth_pass}{${lookup{${if eq{$sender_address_domain}{}{'default'}{$sender_address_domain}}}nwildlsearch{/etc/smart}{$value}fail}}}

with this, it matches in /etc/smart:

default: auth_name=... auth_pass=...

notice the {} empty without any string inside

other complaints:
- for some weird reason, strlen function wont work in section: auth...

No comments: