sendmail or postfix smtp on virtual servers clarifications

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

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 (example), and it hostes one of the virtual server with the domain, and another one with domain The vps provider gave me two different ip address for the same machine. and for example (that i setup as name servers for both the domains, using name of the first domain. ie, If i understood good, the service sending email (postfix or sendmail) will name (like the hostname). I created a reverse dns for on ip but how can i force the mail server to send out email from that ip address? Because it only uses And the last question: spf records. has the v=spf1 a mx ip4: ?all but the server names 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

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 (

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)

Thank you. Excellent between tenths of bla-bla answers

Tue, 04/09/2013 - 05:25

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 since mx are there and i send email from google apps too) and spf. Spf should be set up ok but sends me a report with yellow state (not pass). All the other tests say my spf are ok. In this case having: as sendmail service and vps machine hostname

the spf record of is: "v=spf1 ~all" where maybe can be removed and spf record of is: v=spf1 ~all 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


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

Thank you.

Topic locked