Vesta: Send email from certain ip

Created on 27 Nov 2017  路  6Comments  路  Source: serghey-rodin/vesta

Operating System (OS/VERSION):

Centos 6

VestaCP Version:

0.9.8-17

Installed Software (what you got with the installer):

Default installer

Steps to Reproduce:

Related Issues/Forum Threads:

Other Notes:

Is it possible to send email from a certain domain which is owned by a user (like: customer1) or is it still sending from the default/system ip?

Most helpful comment

@moucho

I got it working with the following config:

When I removed the first interace it worked.

remote_smtp:
  driver = smtp
  interface = ${lookup{$sender_address_domain}lsearch{/etc/exim/mailips}{$value}{1.2.3.4}}

All 6 comments

You need to edit manually exim.conf in order to do that.

So it's possible to manually change it so that only accounts/domains owned by user x are sending over that ip?

I guess it's possible, it's stuff that is related only to Exim, and I believe that Exim can be configured to do that... you just need to see how to configure Exim for that...

You can do this in two steps (tested on CentOS 6 and CentOS 7):

  • Edit /etc/exim/exim.conf , search for 'remote_smtp' and change it to this:
remote_smtp:
  driver = smtp
  interface = 1.2.3.4     // default IP for you domains
  interface = ${lookup{$sender_address_domain}lsearch{/etc/exim/mailips}{$value}{default_ip_in_case_no_match}}
  • Create file /etc/exim/mailips to add domain and IP configuration on it.
    You have to add 1 domain and IP per line (even if it's the same IP):
domain.tld: 1.2.3.5
domain2.tld: 1.2.3.6

@moucho

I got it working with the following config:

When I removed the first interace it worked.

remote_smtp:
  driver = smtp
  interface = ${lookup{$sender_address_domain}lsearch{/etc/exim/mailips}{$value}{1.2.3.4}}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaniWinter picture DaniWinter  路  5Comments

BukinPK picture BukinPK  路  5Comments

developer-av picture developer-av  路  7Comments

SteenSchutt picture SteenSchutt  路  7Comments

albasyir picture albasyir  路  7Comments