1

here is the situation: we had a mail server configured within a VPS (using Postfix/Dovecot) with the mail for 1 domain being managed.

We just moved the mail for that domain to Google Apps.

The MX records are working fine, and we can receive the email that the rest of the world send us. But the email from our VPS (mostly, notification for a couple of webapps and system tools like Logwatch) are being delivered locally.

The VPS sends email properly to any other domain, but enroute the mail for our own domain internally, without sending it to Google Apps. We want that mail to be route through the Internet to the Google Apps mailboxes.

How do I get the VPS to send the domain for the domain to the new inbox in Google Apps? Where do I need to start tuning the config for Postfix/Dovecot? I'm very new to mail servers and I don't know exactly which of these two applications is responsible for the mail being delivered/routed locally.

I've been diving into ServerFault and found a question about the pros and cons of moving (not exactly what I'm needing right now), a few less-related though still interesting questions, and a very similar question that has an answer but does not explain what I would like to do.

So, anyone has an idea on how to reconfig the system on the VPS to get it to deliver the mail?

I'm not a sysadmin and I'm a bit lost on how to proceed. This is my first question in this SE site :)

Thank you all.

  • 1
    To oversimplify it a bit, Postfix sends and Dovecot receives, so you will need to look at the Postfix configuration. It's been long enough since I've used Postfix that I don't remember offhand what to look for (otherwise I'd post an answer). You will also have to make sure the programs that are sending mail are configured to send to user@domain rather than user@localhost. – David Z Oct 23 '14 at 19:49
2

The basic problem is that your postfix configuration is such that mail for your domain is delivered locally.

The cause may be that:

  • the hostname of your server is your domainname and postfix is implicitly configured to accept mail for the hostname for local delivery. (Quick to resolve by changing the hostname to something like hostname.domainname)
  • Postfix is explictely configured to accept mail for your domain. Check the mydomain setting in the default configuration file /etc/postfix/main.cf for the most trivial case. Check the Virtual Domain page for slightly less trivial configurations that would allow mail for yourdomainname to be delivered locally.
  • Thanks for the pointer, @HBruijin. Indeed the server is using virtual mailboxes and it seems that what I needed to do is change the domain in the virtual_domains entry regarding this exact domain. Still in testing phase, but it seems to send the mail as intended now :) – versvs Oct 23 '14 at 20:48
  • Just to confirm my previous comment, when using Postfix using Virtual Domains, the change in the virtual_domains table to a not-real domain (something like notrealsubdomain.domain.tld) is all you need. I remark the need for the new domain (subdomain, preferibly) to be a non-operative domain, as you will deliver the mail to that subdomain internally. – versvs Oct 24 '14 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.