SMTP authentication not working

Discussion in 'Installation/Configuration' started by antun, Jan 11, 2008.

  1. antun

    antun New Member

    I set up an ISPConfig server some time ago, following the perfect setup. My SMTP server works for sending mail, but doesn't require or ask for any authentication.

    Is there a setting I have to make it require SMTP auth?

    -Antun
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the content of the postfix main.cf file, comments stripped.
     
  3. antun

    antun New Member

    Here you go. I've replaced the domain name of the ISPConfig server with "mydomain.com". Note that mydomain.com refers to the ISPConfig server itself, not one of the sites on it that I send mail from.

    Thanks,

    Antun
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you send the email form a mail application which is installed on the server or from a mail application that is installed on another computer?
     
  5. antun

    antun New Member

    Hi Till,

    I sent the email from a mail client on my laptop, not from this server.

    -Antun
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Any errors in your mail log?
    What's the output of
    Code:
    telnet localhost 25
    and then
    Code:
    ehlo localhost
    ?
     
  7. antun

    antun New Member

    I get the same output regardless of whether I log in as root@mydomain.com or webX_myusername@mysite.com:

    Remember, mydomain.com is the domain of the ISPConfig server. webX_myusername is my username on one of the sites that is controlled by that ISPConfig server (i.e. mysite.com).

    Thanks,

    Antun
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    SMTP authentications means that you have to authenticate when you want to send emails to external domains. If you want to send emails to a local domain or when you use a email client which runs on the server like a webmail application, you dont have to authenticate yourself.
     
  9. antun

    antun New Member

    I understand. However, when I try to provide a username and password for the SMTP server (in say, Thunderbird), it fails to authenticate me. It simply doesn't accept my username/password (although it does let me send emails to other accounts on the same domain with no authentication).

    I know I'm using the right credentials, because I'm able to check my mail using Thunderbird.
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Are you sure you filled in your username and password in the right place in Thunderbird?
     
  11. antun

    antun New Member

    Absolutely!

    I set the username and password under:

    Tools>Account Settings>Outgoing Server (SMTP)

    Note I used webX_myusername as the username and the password that works for SSH access. webX_myusername is the username from the mysite.com domain that is one of the domains that is managed by ISPConfig.

    -Antun
     
  12. falko

    falko Super Moderator ISPConfig Developer

    Are there any errors in your mail log? Which distribution are you using?
     
  13. antun

    antun New Member

    Here's what shows up in /var/log/mail.log when I try to connect using SMTP authentication:

    I've obscured myworkdomain.com and the IP address.

    -Antun
     
  14. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ps aux|grep saslauthd
    ? What's in /etc/default/saslauthd? Does it work when you restart saslauthd?
    Code:
    /etc/init.d/saslauthd restart
     
  15. antun

    antun New Member

    Hi Falko,

    Here's the output I get from ps aux | grep saslauthd:

    When I try to restart it, as you suggested, there are no error messages written out to the terminal but it looks like the saslauthd service is not being started correctly. It still doesn't show up if I run ps aux... and I can't send emails either.

    Thanks,

    Antun
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Any errors in your mail log, syslog or messages log when you restart saslauthd?
     
  17. antun

    antun New Member

    Woohoo, it's working!

    There were no errors in any of the log files you mentioned when I restarted saslauthd. No log entries at all, in fact. So I took a look at the saslauthd startup script (/etc/init.d/saslauthd), and noticed that it exited silently as follows:

    Code:
    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
        exit 0
    fi
    
    The START variable was set in a DEFAULTS file (/etc/default/saslauthd). I opened that file and found this piece of code:

    Code:
    # This needs to be uncommented before saslauthd will be run automatically
    # START=yes
    
    I uncommented the START=yes line and tried restarting saslauthd, and hey presto, it worked.

    Thank you both Falko and Till for your patience and help on this!

    Now I have a couple more follow-up questions:

    • Why was that line ever commented out at all?
    • Did I do the right thing here, or should I not make changes to stuff in /etc/default?
    • On Ubuntu, how do I ensure that the saslauthd startup script gets called on a reboot?

    Again, many thanks for your help on this.

    -Antun
     
  18. tensor

    tensor New Member

    This a "disabled by default" security approach of modern OS'es.

    /etc/default/* file are designed to be edited by admin on Debian.

    You may want to read "man update-rc.d".
     
  19. antun

    antun New Member

    Great. Thanks for the info everyone!

    -Antun
     

Share This Page