Matt wrote:

> Looking at this simple greylisting implementation:
> 
> http://wiki.exim.org/DbLessGreyListingRun
> 
> They use this to create name of grey file:
> 
> warn set acl_m_greyfile = /var/spool/exim/greylist/${length_255:\
>   ${sg{$sender_host_address}{\N\.\d+$\N}{}},\
>   ${tr{$sender_address,$local_p...@$domain}{/\040}{;} }}
> Is there anyway to replace any characters in grey file that are not a-z or
> A-Z or @ with a simple _ underscore?  Seems like it would be safer to
> exclude any special characters and should be just as effective.  I heard
> some comments by others elsewhere that this implementation was not trusted
> because of that.  I like how incredibly simple it is though.

You could just use an md5 hash of the addresses. Ie,

$sender_address

Becomes:

${md5:$sender_address}

Alternatively, if you really do just want to replace all non 
letter/number/@ chars with underscores, wrap it like so:

${sg{$sender_address}...@a-za-z0-9]}{_}}

For example:

m...@haven:~$ sudo exim4 -be 
'${sg{"foo-b../ar"@wibble.com}...@a-za-z0-9]}{_}}'
_foo_b___...@wibble_com
m...@haven:~$

-- 
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to