554 5.7.1 <[email protected]>: Relay access denied

Discussion in 'Installation/Configuration' started by mramin05, Mar 5, 2009.

  1. mramin05

    mramin05 New Member

    hi guys,
    I have installed postfix and dovcot as the tutorial "The Perfect Server" in CentOS 5.2.
    I can access to that remote server by ssh secure shell.
    after completion I want to test my postfix.
    This is my steps:

    $>elnet mail.mydomain.com 25
     Connected to mail.mydomain.com.
     Escape character is '^]'.
     220 mail.mydomain.com ESMTP Postfix  
     mail from: [email protected]
     250 2.1.0 Ok
     rcpt to: [email protected]
     554 5.7.1 <[email protected]>: Relay access denied
    If I use localhost instead of the mail.mydomain.com
    then no problem at all.
    # telnet localhost 25
    Connected to localhost.
    Escape character is '^]'.
    220 mail.mydomain.com ESMTP Postfix
    mail from: [email protected]
    250 2.1.0 Ok
    rcpt to: [email protected]
    250 2.1.5 Ok
    354 End data with <CR><LF>.<CR><LF>
    250 2.0.0 Ok: queued as 0D504203C1
    221 2.0.0 Bye
    Connection closed by foreign host.
    here is my postconf -n result..
    # postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    home_mailbox = Maildir/
    html_directory = no
    inet_interfaces = all
    mail_owner = postfix
    mailbox_command = 
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    mydomain = mydomain.com
    myhostname = mail.mydomain.com
    mynetworks =,
    myorigin = $mydomain
    newaliases_path = /usr/bin/newaliases.postfix
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
    sample_directory = /usr/share/doc/postfix-2.3.3/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_tls_note_starttls_offer = yes
    smtp_use_tls = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_local_domain = 
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
    Please help me.
    I have googled a lot but not found any answer.
    Thx in advanced.
  2. mirostz

    mirostz New Member

    hey dude,
    I am not too good at it but i think your problem is at mydestination variable in main.cf

    your relay access is denied because i guess at mydestination in main.cf you dont have mail.mydomain.com you have only localhost that's why u connect with localhost.

    Add after localhost, mail.mydomain.com and u should be good. Cheers
  3. mramin05

    mramin05 New Member

    hi mirostz,
    Thx for your reply.
    I have solved the relay problem by this way a hour earlier. Now my problem is
    When I want to mail from local PC by ruby using my smtp server( remote) it create error. I am using user Authentication(login).here is setting
    ActionMailer::Base.smtp_settings = {
      :address  => "mail.mydomain.com",
      :port  => 25, 
      :domain  => "mydomain.com",
      :user_name  => "test",
      :password  => "xxxxxx",
      :authentication  => :login
    But If it send mail from the server computer then it ok.
    Is there any config problem?
    Please help me.Thx in advance.
  4. mirostz

    mirostz New Member

    hey dude,
    Well i dont use ruby but try squirrelmail it is easy to install and it is with web interface very good mail program. you have already dovecot and postfix running so just install sqruirrelmail and have fun
  5. falko

    falko Super Moderator ISPConfig Developer

    The problem is that you must authenticate if you're not sending from localhost.

Share This Page