3

I have postfix installed with dovecot. There are no problems when I'm trying to send e-mails from my server, however all e-mails that are coming in are rejected.

My main.cf file:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix

mail_owner = postfix
inet_interfaces = all

mydestination = localhost, $mydomain, /etc/postfix/domains/domains
virtual_maps = hash:/etc/postfix/domains/addresses


unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/

debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:9999,
    permit_mynetworks,
    permit_sasl_authenticated,
    reject_non_fqdn_recipient,
    reject_unknown_recipient_domain,
    reject_unauth_destination,
smtpd_sender_restriction = reject_non_fqdn_sender
broken_sasl_auth_clients = yes

UPDATE: Now, when e-mail comes to the server, the server tries to reroute the mail. Example, if the message was sent to john@example.com, my server changes that to john@HOSTNAME.localhost and then the mail bounces because there's no such domain on my server.

Primoz
  • 45
  • 7
  • I'm having this problem right now, did you ever get this solved? – Ryan Ward Feb 07 '12 at 00:42
  • Hey! Sorry for a late reply. No, unfortunately I wasn't able to solve it, and because time was a constraint at that time I just switched to sendmail. – Primoz Sep 12 '12 at 11:20

1 Answers1

1

From the configuration posted, I can't see a $myhostname or a $mydomain - if that's the case in main.cf, it will only treat @localhost as local and everything else will be rejected with 550. You can send out as you are sasl authenticated.

Add $mydomain = yourdomainname.com and it should work.

James L
  • 6,025
  • 1
  • 22
  • 26
  • I have multiple domains on this server, and I'd like to enable mail on all of them. Can I list multiple domains in $mydomain? – Primoz Aug 25 '10 at 17:53
  • Do: `mydestination = localhost, $mydomain, /etc/postfix/virtual_domains` And then list each domain on a separate line inside that file. – James L Aug 25 '10 at 21:50
  • I posted the updated main.cf file. I've also added virtual_maps statement, following a guide on virtual domains. The virtual map file contains all my domains and maps existing e-mail addresses. – Primoz Aug 26 '10 at 12:17