[exim] Decimal IP Calculation

Top Page
Delete this message
Reply to this message
Author: Phil White
Date:  
To: exim-users
Subject: [exim] Decimal IP Calculation
Hi.

I'm trying to store the DECIMAL IP address of a connecting host in
$acl_c*. Do do this, I'm using the following:

set acl_c5    = ${eval10: \
                        (${extract {1}{.}{$sender_host_address}}<<24) \
                      + (${extract {2}{.}{$sender_host_address}}<<16) \
                      + (${extract {3}{.}{$sender_host_address}}<<8) \
                      +  ${extract {4}{.}{$sender_host_address}} \
                   }


Which, sadly, doesn't work quite as expected:
dotquad addr = 131.111.8.192
decimal addr = -2089875264
which means approximately 50% of my mail is not being flagged correctly.

Is there another way I can achieve the desired effect?

Cheers,

Phil