Postfix error

Hello,
I recently setup a mail server ( Postfix ) but when I try to send from gmail or any other external server to to my mail server I got this error
PERM_FAILURE: SMTP Error (state 13): 550 5.7.1

any idea where I should dig to solve this problem .. Thanks in advance
usmbayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Cyclops3590Commented:
did you configure postfix to accept email for your domain?

please post your main.cf  with comments and blank lines removed
cat /etc/postfix/main.cf | grep -v ^# | grep -v ^$

then change any private info like public IPs, domain names, etc.
0
usmbayAuthor Commented:
here's the output
***********************************
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $transport_map
unknown_local_recipient_reject_code = 550
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases


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.4.5/samples
readme_directory = /usr/share/doc/postfix-2.4.5/README_FILES
disable_vrfy_command = yes
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_policy_service inet:
content_filter = smtp-amavis:[127.0.0.1]:10024
0
Cyclops3590Commented:
change:
mydestination = $myhostname, localhost.$mydomain, localhost, $transport_map
to this:
mydestination = $myhostname, localhost.$mydomain, localhost, $transport_map,$mydomain
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Cyclops3590Commented:
remember to do the following as well
postfix reload
0
usmbayAuthor Commented:
same error
PERM_FAILURE: SMTP Error (state 13): 550 5.7.1 <email address>... Relaying denied
0
Cyclops3590Commented:
remove the check_policy_service from the restrictions parameter
0
Cyclops3590Commented:
btw, your $mydomain variable is the same as the domain that comes after the @ sign in the email address, correct?
0
usmbayAuthor Commented:
yes correct
0
usmbayAuthor Commented:
I got same error even after the modification
0
Cyclops3590Commented:
ok, then we need to turn on verbose logging to see if we can get a clearer picture of why there is a relay access denied.
in the master.cf on the smtpd transport, add '-v -v' to the end of the line as parameters for the smtpd daemon.

restart postfix, send a test email, and see what the logs say.
0
usmbayAuthor Commented:
always same error


logfile0.txt
0
Cyclops3590Commented:
the posted log doesn't contain the error or the smtp communication that should be there with the '-v -v' added.

however, there are alot of errors coming from clamav.  for testing for now, lets remove the content_filter line  from the config and restart again.  We want to start eliminating any variables that might be causing the problem here until we find the culprit.
0
usmbayAuthor Commented:
here the result after removing the fileter
maillog.txt
0
Cyclops3590Commented:
according to that, the email was delivered.  it appears something is wrong with the way amavis is configured possible.

first though to remove some of the warning logs, you need to update your clamav engine.  Best is to download it from their website at www.clamav.com and compile it yourself.  The first time takes a little while because of the dependencies that need to be satisfied, but after that, its very simple and quick
0
usmbayAuthor Commented:
still I cann't send from gmail or any other server to this email address try it yourself uhass@montreal2007.com
0
Cyclops3590Commented:
looks like you have a pix.
do this on your pix:

no fixup protocol smtp 25

just want to make sure that isn't causing the issue.
0
Cyclops3590Commented:
never mind about the pix, that isn't it.  after I went further into my test, i see that its thowing the relay denied error after the recipient address is being entered so the smtpd_recipient_restrictions is what is causing the issue

please post the following:
postconf smtpd_recipient_restrictions
postconf mydestination
postconf mydomain
0
usmbayAuthor Commented:
attached
postconf.txt
0
Cyclops3590Commented:
your mydomain is incorrect, it needs to be montreal2007.com, or montreal2007.com needs to be added to the mydestination variable explicitly.
0
usmbayAuthor Commented:
still have same error
0
Cyclops3590Commented:
what does
postconf mydestination
postconf mydomain

say now.  remember, for it to take effect, you need to restart postfix
0
usmbayAuthor Commented:
postconf -n attached

now I can send to localhost and gmail but I cann't send from gmail to this email

what's mean by -  Relaying denied

postconf--n.txt
0
Cyclops3590Commented:
Sorry, got busy and completely forgot about the Q.

Relaying denied means you lack the appropriate credentials to relay email thru the MTA (postfix).  However, you shouldn't be getting that message because if the MTA is the destination like you want it to be in this case, it bypasses those checks and goes to delivery of the message.

we need to look at the logs again.  have you turned on verbose logging.  in your master.cf, you're
smtp    inet    n       -       y       -       -       smtpd
entry, will be changed to
smtp    inet    n       -       y       -       -       smtpd -v -v

then restart postfix.  

Also, have you restarted the postfix daemon after you added montreal2007.com to the list.  When I telnet to port 25, it accepts root@localhost, but not uhass@montreal2007.com
0
Cyclops3590Commented:
telneting tests appear to prove you are still using the default mydestination parameters as only the following work:
root@discovery
root@localhost
root@localhost.localdomain

as the default mydestination is:
mydestination = $myhostname, localhost.$mydomain, localhost

so this would mean that the mydomain is set to 'localdomain'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Protocols

From novice to tech pro — start learning today.