Assuming that you are using Exim.
Open /etc/exim.conf and go to 'TRANSPORT CONFIGURATION'
Comment out the existing 'interface' entry and add the following line :-
interface = X.X.X.X
(Replace this with the IP that you want to use)
After making the change, this part of the file should look something like this.
Code:
remote_smtp:
driver = smtp
# interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch* {/etc/mailips}{$value}{}}}{}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
interface = x.x.x.x
Alternatively, you can just put the IP in the file '/etc/mailips'