Additional IP and SMTP server

oceanox
Posts: 11
Joined: Wed Aug 12, 2020 10:57 am

Hi!
My server has a primary IP from which I have successfully installed myvestacp.

Now I have rented a new failover IP and added it to the panel once the provider has assigned it to my VPS. So far everything is correct.
I have generated a new domain in myvesta and have assigned this new IP to this new domain.
All right.
Next, I have created an email for this new domain and I have marked "Use Domain" instead of "use server name" with the intention that the mail server uses the IP of the domain itself, and not the main IP of the server.

The changes seem not to be saved, because whenever I go back to edit the mail, the option "use server name" appears.

In fact I have sent an email to myself to a Gmail account and I have verified that the email has been sent from the main IP of the server.

What I want is to assign each domain its own IP and for the mail server to send from each assigned IP of each domain, not from the main one.

Can't do this? Where is my fault?
Thanks
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Currently it's possible only to make outgoing email to be sent from another IP, but it will be only for SMTP-authorized users (PHP will still send email from main IP), and it will be for all accounts.
Command is v-make-separated-ip-for-email - https://github.com/myvesta/vesta/blob/m ... -for-email

Currently it's not possible to change IP of outgoing emails just for desired account.
Actually, it can be done, but with custom modification of /etc/exim4/exim4.conf.template
oceanox
Posts: 11
Joined: Wed Aug 12, 2020 10:57 am

dpeca wrote: Thu Aug 13, 2020 9:59 pm Currently it's possible only to make outgoing email to be sent from another IP, but it will be only for SMTP-authorized users (PHP will still send email from main IP), and it will be for all accounts.
Command is v-make-separated-ip-for-email - https://github.com/myvesta/vesta/blob/m ... -for-email

Currently it's not possible to change IP of outgoing emails just for desired account.
Actually, it can be done, but with custom modification of /etc/exim4/exim4.conf.template
With that script would it allow me to send via SMTP to each domain its own IP?
In the end, what I want is for each domain to have its IP assigned and for that IP to be in charge of sending the SMTP mail.
That is to say:
Domain1> IP1> SMTP IP1
Domain2> IP2> SMTP IP2
Domain3> IP3> SMTP IP3
Etc...
That is, each domain has its own ip and its own smtp
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

oceanox wrote: Fri Aug 14, 2020 10:47 am With that script would it allow me to send via SMTP to each domain its own IP?
As I said, nope.
All accounts will be switched to desired IP.

I think that www.hestiacp.com have support for this what you need.
oceanox
Posts: 11
Joined: Wed Aug 12, 2020 10:57 am

I have been testing Hestia and indeed, Hestia does send the emails from each additional IP that each assigned domain has.
However, I have had many problems with Hestia permissions .... panel that does not respond to changes, error 403 on the webs that I have tried to put, in short ... a disaster.Domain of the panel that does not acquire SSL when installing and I did not like to see so much problem and error the truth.
I go back to Myvestacp I have not had any errors with it and it worked the first time in my VPS everything.
I just would like the emails to be sent from the IP that each domain has assigned ... Would it be very difficult to implement this?
Couldn't it be done by modifying any line?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

To be honest, I think we can do something with changing few lines in exim4.conf.template, i mean, i already did that 'trick' on one server.
Give me some time today, i will see.
Command v-make-separated-ip-for-email can be good base for upgrading on it.

Hestia... sorry to hear that...
That was my fear one year ago when I decided to stay with my fork and not to join Hestia.
Talked about it here - https://forum.vestacp.com/viewtopic.php?p=82536#p82536
Really without a will to say anything bad about Hestia.
Bugs are a cost of rapid development, that's all.
I believe they will take a care of bugs.
oceanox
Posts: 11
Joined: Wed Aug 12, 2020 10:57 am

I don't know why I have had so many problems with Hestia to be honest, which I have not had with Vestacp and Myvestacp. Using the same VPS server and the same configuration (debian 10) although I have also tried with Ubuntu and the same thing happens with Hestia.

Hestia looks more "cool" because of the "dark" environment and it has a file manager and it also works by using each additional IP to send emails from it. This is great, but too many problems, I have installed a dozen times and reformatted and I can't get it to work correctly, sometimes the certificates, other times errors in the webs, other times the changes are not saved ...

Thing that with Myvestacp has not happened to me, everything works the first time, only the characteristic that of sending smtp mail from the assigned IP in each domain, if that can be put it would already be fantastic and I could definitely start migrating my panel websites .
I am waiting as you tell me, to see if you give me a joy;)
THANK YOU
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Let's try.
First update myVesta to latest version:

Code: Select all

rm /var/cache/apt/archives/vesta_0.9.*
apt update && apt install --reinstall vesta
Now type:

Code: Select all

v-make-separated-ip-for-email-domain "your-domain.com" "YOUR-IP"
(where YOUR-IP is something like 123.123.123.123)
oceanox
Posts: 11
Joined: Wed Aug 12, 2020 10:57 am

I have set up a clean panel again on my VPS.
Debian 10 and Myvesta.
I added a new IP to the server and a new domain assigning that new IP to that domain.
Then, by console I wrote the indicated command but I got this error:

bash: v-make-separated-ip-for-email-domain: command not found

So I googled and came up with this solution that you also wrote in the Vesta forum

source /etc/profile
PATH=$PATH:/usr/local/vesta/bin && export PATH

Later if I could write the command:
v-make-separated-ip-for-email-domain "your-domain.com" "YOUR-IP"

The result is correct, now in the headers it appears that the IP assigned to the domain is the one that sent the mail.
I have a problem with mail-tester that tells me that the PTR is not correct in reverse, but I think I can solve it by changing the reverse record to the IP in the OVH provider panel.

Now I am going to wait a while for the change to be updated and I will test again to see if the shipment is correct.
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

PTR should be some hostname that resolves back that IP.
It could be domain that you are trying to bind on that IP.
If PTR is not set correctly, my script will warning you too.

Check /etc/exim4/virtual/helo_data to see what hostname you binded to that IP.
Then set that hostname to be PTR on that IP.
Post Reply