modify received headers in exim for one IP only

chauaso

Registered
Aug 7, 2009
2
0
51
hi,

Like a lot of us, i send emails from my cellphone. When i send an email ( using outlook mobile), i use my own smtp server, but my cellphone providers gateway IP appears in the received headers...
see:
:Received: from [216.198.139.38] (port=17979 helo=Inbox)
by MyOwnSMTP.domain.com with esmtpsa (SSLv3:RC4-MD5:128)
(Exim 4.69)
(envelope-from <[email protected]>)
id 1MZA6R-0008Sa-BJ
for [email protected]; Thu, 06 Aug 2009 17:02:24 -0400
I want to change the 216.198.139.38 to 127.0.0.1 everytime it appears in the received headers...

The problem with 216.198.139.98 is that they are on a lot of blacklists... and my mails are sometimes dropped, or tagged as spam...

i'm sure some of you have the solution near you :)
Some guy like Chirpy should know the solution ... ? :eek:

thanks a lot for your help! :)
 
Last edited:

chauaso

Registered
Aug 7, 2009
2
0
51
I've found that code... this is the way to go.. but i need a bit of help ...
Code:
  received_header_text = Received: \
      ${if def:sender_rcvhost {from ${if def:authenticated_id \
      {127.0.0.1 (helo=authenticated.user-IP.removed)} \
      {$sender_rcvhost }}\n\t}}\
      by $primary_hostname \
      ${if def:received_protocol {with $received_protocol}} \
      ${if def:tls_cipher {($tls_cipher)\n\t}}\
      (Exim $version_number)\n\t\
      id $message_id\
      ${if def:received_for {\n\tfor $received_for}}
First, is there any received_* that is not included in this code that should be included ?
I'm asking because this is rewriting the received_header.... everything that was previously inserted will be deleted.

Second, if i want this to work only for one ip, what should i change ?
I know it's in the two or three first lines... but these regex and stuff are hard hehe! :)

third, where do i put this ??? exim configuration is splitted in many files... :)