sendmail or postfix smtp on virtual servers clarifications

5 posts / 0 new
Last post
#1 Sun, 04/07/2013 - 11:36
godowsky

sendmail or postfix smtp on virtual servers clarifications

Hi everyone, I'm a newbie with virtualmin and networks, just some linux skills. I have setup a new vps with centos and installed successfully virtualmin and webmin. I have two virtualservers on it, hosting two different domains and they both need to send out mails with an ecommerce platform (sales, client mails etc). Here my doubts come: My vps hostname is server.pincopallino.com (example), and it hostes one of the virtual server with the domain pincopallino.com, and another one with domain rossi.com. The vps provider gave me two different ip address for the same machine. 1.1.1.1 and 1.1.1.2 for example (that i setup as name servers for both the domains, using name of the first domain. ie ns1.pincopallino.com, ns2.pincopallino.com) If i understood good, the service sending email (postfix or sendmail) will name server.pincopallino.com (like the hostname). I created a reverse dns for rossi.com on ip 1.1.1.2 but how can i force the mail server to send out email from that ip address? Because it only uses 1.1.1.1. And the last question: spf records. rossi.com has the v=spf1 a mx a:rossi.com ip4:1.1.1.2 ?all but the server names server.pincopallino.com... should I add that in spf records too? I read guides about that.. but it is not so clear to me when related to more virtual servers on one server. Thanks for your attention..

Mon, 04/08/2013 - 02:55
VirtualNoob

Hey godowsky

There are a couple of things needed in order to get postfix to send from the IP address of the virtual server.

First, you need to create a Sender Transport Map in Postfix. Head to Webmin > Servers > Postfix then choose Sender Dependent Transport Mapping. Inside here, choose the radio button next to Map Specification and select Mapping File. Here you'll need to enter a location for your sender map (I use /etc/postfix/dependent) then hit Save and then Save and Apply.

I'm not sure from memory if the file above needs to exist in the file structure before you can use it for mapping - it's a while since I set mine up. If so, from the terminal just run sudo touch /etc/postfix/dependent

The once this is done, for a domain with mail enabled, simply head to Virtualmin > Server Config > Email Settings and set the option Send outgoing email for domain from IP to the Virtual Server's Address (1.1.1.2).

Then send a few tests and see how it looks - that should resolve it but post back here if you're struggling or something doesn't work right.

Wed, 08/23/2017 - 03:43 (Reply to #2)
tindoor1

Thank you. Excellent between tenths of bla-bla answers

Tue, 04/09/2013 - 05:25
godowsky

Thanks VirtualNoob for your reply. It clarified a lot and i was successfull in setting up sendmail. Now the problem is with hotmail servers. I have dkim (two keys, since one is for the outgoing mails from the server, the other for google.com since mx are there and i send email from google apps too) and spf. Spf should be set up ok but test@allaboutspam.com sends me a report with yellow state (not pass). All the other tests say my spf are ok. In this case having: server.mydomain.com as sendmail service and vps machine hostname mydomain.com mydomain2.com

the spf record of mydomain.com is: "v=spf1 include:_spf.mydomain.com include:_spf.google.com ip4:xxx.xxx.xxx.xxx ~all" where include:_spf.mydomain.com maybe can be removed and spf record of mydomain2.com is: v=spf1 include:_spf.mydomain.com.com include:_spf.google.com ip4:xxx.xxx.xxx.xxx ~all xxx.xxx.xxx.xxx is always the same and it is the same ip of the mail server. Can't understand.. hotmail mail box goes to spam, gmail and yahoo instead perfect. Any ideas? Ip are not blocked, i checked. Thanks

Tue, 08/12/2014 - 09:34
Alan

HI,

i installed Virtualmin and config postfix. mails are going good. But i need to configure all mail from its own IP. I tried with https://www.virtualmin.com/documentation/email/dependent. But mails are gone from same IP(server main IP). Please give me the exact steps to do my wish..

Thank you.

Topic locked