-1

I am trying to setup a mail server with postfix/dovecot.

I can currently receive emails and send emails from domains that I have configured.

I have a lot of domains and my email setup is simple - all emails from every domain goes to one account.

I am trying to work out how to setup postfix so that I can send emails from any of my domains without having to set them all up explicitly as domains in the system.

Right now I get RELAY ACCESS DENIED if the from address is a domain not listed in the domains table.

I have the following two lines in main.cf :

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_sasl_authenticated,permit_mynetworks,defer_unauth_destination

Which I thought would fix it, but it doesn't.

Anyone know what I am missing?

EDIT:

I am sending from a mail client (evolution)

Relevant log entries:

Jan 31 03:33:15 myserver postfix/smtpd[30117]: connect from unknown[94.xxx.xxx.xxx]
Jan 31 03:33:16 myserver postfix/smtpd[30117]: NOQUEUE: reject: RCPT from unknown[94.xxx.xxx.xxx]: 454 4.7.1 <destination@destination.com>: Relay access denied; from=<me@unconfigureddomain.com> to=<destination@destination.com> proto=ESMTP helo=<[127.0.0.1]>
Jan 31 03:33:16 myserver postfix/smtpd[30117]: lost connection after RCPT from unknown[94.xxx.xxx.xxx]
Jan 31 03:33:16 myserver postfix/smtpd[30117]: disconnect from unknown[94.xxx.xxx.xxx]
Ben Holness
  • 944
  • 2
  • 10
  • 28
  • 1
    What method do you use when sending email? `mail` command? PHP apps? Mail client? Others? – masegaloeh Jan 31 '15 at 04:50
  • 1
    Providing the complete and relevant maillog when you sending email will also helpful :) – masegaloeh Jan 31 '15 at 04:58
  • @masegaloeh - I am using the mail client Evolution. Also, I have added the log entries to the post. FYI this was working last week then my mail server died and I am setting everything up from scratch on a new server, I just don't remember how I got this part to work :) – Ben Holness Jan 31 '15 at 11:29
  • Did you setup [SASL authentication in postfix](http://www.postfix.org/SASL_README.html)? – masegaloeh Jan 31 '15 at 11:31
  • I figured it out! On my old server everything was through port 25. Turns out that now I have to go through 587 for the SASL to work, so when I was sending from the configured domains, it worked on 25, but the none configured ones have to go through 587. – Ben Holness Jan 31 '15 at 12:19

1 Answers1

0

I figured it out! On my old server everything was through port 25. Turns out that now I have to go through 587 for the SASL to work, so when I was sending from the configured domains, it worked on 25, but the non-configured ones have to go through 587

Ben Holness
  • 944
  • 2
  • 10
  • 28