Re: [exim] warn set grey file

Etusivu
Poista viesti
Vastaa
Lähettäjä: Mike Cardwell
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] warn set grey file
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_part@$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:

mike@haven:~$ sudo exim4 -be
'${sg{"foo-b../ar"@???}{[^@A-Za-z0-9]}{_}}'
_foo_b___ar_@wibble_com
mike@haven:~$

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