-3

I'm trying to setup postfix to use multi-domains mail.

Right now, I can send mails to [email protected], but sending mails to [email protected] isn't working: I receive the following email while trying to send emails to this address

Delivery to the following recipient failed permanently:

     [email protected]

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain domain2.com by redirect.ovh.net. [213.186.33.5].

The error that the other server returned was:
550 sorry, no mailbox here by that name (#5.1.1)

main.cf

myhostname = domain1.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ns3289160.ip-5-135-180.eu, localhost.ip-5-135-180.eu, localhost
virtual_alias_domains = domain2.com
virtual_alias_maps = hash:/etc/postfix/virtual/addresses

/etc/postfix/virtual/addresses

domain2.com         DOMAIN
[email protected]    user

I genuinely have no clue about what's going on, knowing that I never switch my MX entries on my domain name (it still points to redirect.ovh.net, that stands for, according to their documentation, the mx for personnal mailboxes).

How can I properly set everything up so that I can be able to use postfix with a personalized mail address ? (such as domain1.com instead of ns**.eu)

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> domain2.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15795
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0005 , udp: 512
;; QUESTION SECTION:
;domain2.com.               IN      MX

;; ANSWER SECTION:
domain2.com.        5       IN      MX      1 redirect.ovh.net.

;; Query time: 156 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Thu Apr 02 18:26:12 EDT 2015
;; MSG SIZE  rcvd: 76

The names domain2.com, user have been changed...

3
  • What's the output of dig domain2.com mx?
    – masegaloeh
    Apr 2, 2015 at 22:23
  • I edited the post.
    – Lght
    Apr 2, 2015 at 22:27
  • well, that's the problem. Please setup mx record of domain2.com to your server.
    – masegaloeh
    Apr 2, 2015 at 22:33

1 Answer 1

1

If you would like to receive mail with your VPS, you need to point the MX to your server. Now it's pointing to redirect.ovh.net so the virtual aliases has to be configured there as redirects, not destinations. You could have for example:

mail.example.com.   IN   A     5.135.180.55
example.com.        IN   MX 1  mail.example.com.

This is not a Postfix issue and your Postfix is probably configured correctly. Just remember to postmap the virtual alias table if it isn't.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .