14

I've installed dovecot, postfix and roundcube on an ubuntu 12.04 box. The system is basically working - i.e it is able to send/receive mails to/from other domains.

However, some domains cause the following error message in /var/log/mail.log

Jul 15 01:59:21 one postfix/smtp[2019]: 0D0399C025F: to=<someone@destdomain.com>,
      relay=sm01.destdomain.com[x.x.x.x]:25, delay=0.56, delays=0.4/0/0.06/0.1,
      dsn=5.5.2, status=bounced (host sm01.destdomain.com[x.x.x.x] said:
      504 5.5.2 <contact@localhost>: Sender address rejected: need
      fully-qualified address (in reply to RCPT TO command))

Do you have any idea what's wrong here? I.e. How to force postfix to use "contact@mydomain.com" instead of "contact@localhost" when connecting to another mail server?

Any hints are appreciated.

Alexis Wilke
  • 2,210
  • 1
  • 20
  • 37
Tolaksa
  • 165
  • 1
  • 1
  • 6

2 Answers2

14

$mydomain is used as a default value for many other configuration parameters, but it does not set the sender domain.

Take a look to the $myorigin parameter in /etc/postfix/main.cf

It specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine.

For more information, see Postfix basic configuration README

rpet
  • 197
  • 1
  • 7
2

Programs like "mail myself@example.com" may not use myorigin. Instead create /etc/postfix/canonical

@local @realdomain.com

Add a reference to it in your /etc/postfix/main.cf

canonical_maps = hash:/etc/postfix/canonical

And activate the stuff

postmap /etc/postfix/canonical
service postfix restart

See the docs

UlfR
  • 347
  • 6
  • 11
Kjeld Flarup
  • 121
  • 2