Can not receive e-mail - Postfix

Discussion in 'Server Operation' started by Hans, Apr 1, 2006.

  1. Hans

    Hans Moderator ISPConfig Developer

    I only can send e-mail using my postfix server.

    When i send an email to one of my domains on the server, there is an error in the emailclient:

    Remote-MTA: DNS; server1.mydomain.tld
    Diagnostic-Code: SMTP; 554 : Relay access denied

    I checked the Postfix configuration file by comparing it with the version mentioned here:

    Everything seems to be ok in my configuration file, so why this problem?

    I do not understand!

    What could be wrong?

    Last edited: Apr 1, 2006
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you set "server needs authentication" in the smtp settings of your email client?

    If you use ISPConfig, do you have this line in your postfix file:

    mydestination = /etc/postfix/local-host-names
  3. Hans

    Hans Moderator ISPConfig Developer

    Strange behaviour sending/receiving e-mails - Postfix

    There was a line in /etc/postfix/ :

    mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost

    I changed it in:

    #mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost

    I added your suggested line instead:

    mydestination = /etc/postfix/local-host-names

    My Postfix file looks now like:

    # See /usr/share/postfix/ for a commented, more complete version
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    myhostname = server1.mydomain.tld
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = server1.mydomain.tld, localhost.mydomain.tld, localhost
    mydestination = /etc/postfix/local-host-names
    relayhost =
    mynetworks =
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    smtpd_sasl_local_domain = $myhostname
    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
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom

    After this modification i restarted Postfix with:
    /etc/init.d/postfix restart

    When i use my e-mailclient, the mailserver does not recognise my username/password.
    "server needs authentication" is on (of course).

    When i send an e-mail from the outside world to an e-mailaddress which belongs to one of the domains on my server, it wil NOT reach the mailbox and it is not bounced back to me!

    The output of command grep -i smtp /etc/services :
    smtp 25/tcp mail
    ssmtp 465/tcp smtps # SMTP over SSL

    I have also discovered that saslauthd is not always running.
    When i do an /etc/init.d/saslauthd start
    it results into:
    Starting SASL Authentication Daemon: (failed).
    The output of ps aux|grep saslauthd:

    root 4225 0.0 0.2 34900 2396 ? Ss 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root 4226 0.0 0.2 34900 2392 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root 4227 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root 4228 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root 4229 0.0 0.2 34900 2396 ? S 21:05 0:00 /usr/sbin/saslauthd -m /var/spool/postfix/var/run/saslauthd -r -a pam
    root 9059 0.0 0.0 2908 620 pts/1 S+ 22:12 0:00 grep saslauthd

    I could start saslauthd again after killing the processes according:

    kill -9 4225
    kill -9 4226
    kill -9 4227
    kill -9 4228
    kill -9 4229

    /etc/init.d/saslauthd start

    saslauthd was started, but it did not solve my problem with receiving/sending emails.

    For me this is a serious problem, how can it be solved?

    I hope someone can help me.

    Last edited: Apr 1, 2006
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. Hans

    Hans Moderator ISPConfig Developer

    Postfix reinstallation

    Yes, Till i have ISPConfig (last stable version) installed.

    Can i just rerun the setup for Postfix?

    Or do i have to remove the existing Postfix files first with apt-get remove --purge ..., before is start again?

    I also have checked my /var/log/mail.log file.
    When i have send an e-mail to an e-mailaddress on the server it does not reach it.
    In every line of the logfile: nmsgs=0 ndele=0

    Last edited: Apr 2, 2006
  6. falko

    falko Super Moderator ISPConfig Developer


    No, you don't need this. But after
    apt-get install postfix ...
    you should run
    dpkg-reconfigure postfix
  7. Hans

    Hans Moderator ISPConfig Developer

    Thanks for your reply!

    Everything is up and running again.

Share This Page