14

I am using postfix to send out emails. Its working fine when I send email to other domains but it does not send email when I send emails to the same domain the post fix is configures with.

Below is my configuration:

myhostname = [FQDN]
virtual_alias_maps = hash:/etc/postfix/virtual
#home_mailbox = mail/
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
#mydestination = mydomain1.com, mydomain2.com
#relayhost =
#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4

Can anyone point me where misconfiguration is?

2 Answers2

28

Add this blank line in your main.cf file.

mydestination = 

Then reload your postfix configuration by running

/etc/init.d/postfix reload

I noticed you had tried to do something similar by commenting out the line defining mydestination, however, this will not fix your problem because mydestination defaults to $myhostname, localhost.$mydomain, localhost .

hofan41
  • 1,438
  • 1
  • 11
  • 25
  • This seems to work, although I already had many destinations defined on the `mydestination =` line. I simply removed my domain from the line and it now works. – harryg Jul 08 '14 at 09:29
  • This leads to a solution, but it should be noted that removing the domain from the mydestination list will fix the issue - this is unless you have a mail handler running on the same host (if you have the mail handler, you wouldn't be having the issue in the first place anyway) – dakdad Apr 07 '15 at 10:50
  • Thank you very much, this is the only answer which worked. – FR073N Nov 05 '15 at 16:10
  • Thanks @hofan41. You have saved my several hours of work :) . – Altaf Hussain Jul 09 '16 at 11:55
3

Check the settings in your /etc/postfix/main.cf file, specifically the setting for virtual_mailbox_domains. If your domain is in this line, but another server is the MX for your domain, then this would explain the problem - i.e. the postfix server thinks it's handling incoming mail for your domain, but the MX records say otherwise.

mti2935
  • 11,465
  • 3
  • 29
  • 33
  • I have mentioned my configuration above. virtual_mailbox_domains is not set and MX set on google. What configuration should I modify to fix this issue? – Shahzad Fateh Ali Jul 14 '13 at 08:14
  • Actually the emails are getting bounced. This is mentioned in log. This is what the log states: "Jul 14 05:18:54 localhost postfix/local[32434]: AED86105E43: to=, relay=local, delay=0, delays=0/0/0/0, dsn=5.1.1, status=bounced (unknown user: "shahzad.fatehali")" – Shahzad Fateh Ali Jul 14 '13 at 09:36
  • that was exactly my case. Thanks. – Sergey Grechin Feb 03 '16 at 06:14