Link to home
Start Free TrialLog in
Avatar of efegue
efegue

asked on

Postfix can't send mails from outside to my server - relay access denied

I can't send mail from an external mail to my postfix mails..

Oct 16 15:44:17 mail postfix/smtpd[18600]: connect from externaldomain.com[195.62.28.xxx]
Oct 16 15:44:17 mail postfix/smtpd[18600]: NOQUEUE: reject: RCPT from externaldomain.com[195.62.28.xxx]: 554 <localuser@localdomain.com>: Relay access denied; from=<user@externaldomain.com> to=<localuser@localdomain.com> proto=ESMTP helo=<server.externaldomain.com>
Oct 16 15:44:17 mail postfix/smtpd[18600]: disconnect from externaldomain.com[195.62.28.xxx]

here's my postconf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = mail.localdomain.com, localhost.localdomain.com, localhost
myhostname = mail.localdomain.com
mynetworks = 127.0.0.0/8
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_pipelining, permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
virtual_alias_maps = hash:/etc/postfix/virtual

I'm using virtualmin to setup the mail accounts..
I can send mail for gmail for example and for the server email accounts.. but outside I cant send mails for my server email accounts..!
ASKER CERTIFIED SOLUTION
Avatar of Cyclops3590
Cyclops3590
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of efegue
efegue

ASKER

well, already found the solution. It was kinda like that..
In this case it was the virtual_alias_domains variable that was missing..

Although I want this to be automatic, do u know how can I have it to make automatic checks for the existing domains in the server?
sorry, never used virtual domains yet.  but you'd have to write a script I'm sure to update the config and reload postfix.