LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-18-2009, 09:19 PM   #16
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122

Do you have a line like
Code:
mail.*                                                  -/var/log/maillog
in /etc/syslog.conf?

Have you told your client that authentication is encrypted?
 
Old 04-18-2009, 11:07 PM   #17
Guardian-Mage
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
Sure enough that line was no longer there, must of got removed somewhere along the lines.

Code:
Apr 18 23:06:43 cl-t112-271cl postfix/smtpd[22623]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Apr 18 23:06:43 cl-t112-271cl postfix/smtpd[22623]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
That is the problem, SASL is using the wrong authentication method, so I figure the config file I edited was the wrong one, because that guide has had a few files in different locations than mine. Not sure where the proper one is though.

Any chance /etc/postfix/sasl/smtpd.conf should be /etc/postfix/sasl2/smtpd.conf ?

Last edited by Guardian-Mage; 04-18-2009 at 11:09 PM.
 
Old 04-18-2009, 11:25 PM   #18
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Show "cat /etc/sysconfig/saslauthd"
 
Old 04-18-2009, 11:38 PM   #19
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Also, what is "MECH" in /etc/init.d/saslauthd?
 
Old 04-19-2009, 12:04 AM   #20
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Are you trying to authenticate against the standard user database? If so, you shouldn't need to change any sasl configs. If this is the case, you should be able to delete /etc/postfix/sasl and its contents
 
Old 04-19-2009, 07:57 AM   #21
Guardian-Mage
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
As the tutorial states, I am trying to authenticate against a mysql database, just like my IMAP server is.

cat /etc/sysconfig/saslauthd
Code:
# Directory in which to place saslauthd's listening socket, pid file, and so
# on.  This directory must already exist.
#SOCKETDIR=/var/run/saslauthd

# Mechanism to use when checking passwords.  Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
#MECH=pam

# Additional flags to pass to saslauthd on the command line.  See saslauthd(8)
# for the list of accepted flags.
#FLAGS=

# This needs to be uncommented before saslauthd will be run automatically
START=yes

# You must specify the authentication mechanisms you wish to use.
# This defaults to "pam" for PAM support, but may also include
# "shadow" or "sasldb", like this:
# MECHANISMS="pam shadow"

MECHANISMS="pam"
PARAMS="-m /var/spool/postfix/var/run/saslauthd -r"
All the values that are commented out were original, and the uncommented ones are what the tutorial told me to add.

cat /etc/init.d/saslauthd
Code:
[root]~ # cat /etc/init.d/saslauthd
#! /bin/bash
#
# saslauthd      Start/Stop the SASL authentication daemon.
#
# chkconfig: - 95 05
# description: saslauthd is a server process which handles plaintext \
#              authentication requests on behalf of the cyrus-sasl library.
# processname: saslauthd

# Source function library.
. /etc/init.d/functions

# Source our configuration file for these variables.
SOCKETDIR=/var/run/saslauthd
PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"
MECH=shadow
FLAGS=
if [ -f /etc/sysconfig/saslauthd ] ; then
        . /etc/sysconfig/saslauthd
fi

RETVAL=0

# Set up some common variables before we launch into what might be
# considered boilerplate by now.
prog=saslauthd
path=/usr/sbin/saslauthd

# Ugh. Switch to a specific copy of saslauthd if there's one with $MECH
# in its name, in case it wasn't included in the base cyrus-sasl package
# because it would have dragged in too many undesirable dependencies.
if test -x ${path}.${MECH} ; then
        path=/usr/sbin/saslauthd.$MECH
fi

start() {
        echo -n $"Starting $prog: "
        daemon $path -m $SOCKETDIR -a $MECH $FLAGS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        killproc $path
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  status)
        status $path
        ;;
  condrestart)
        [ -f /var/lock/subsys/$prog ] && restart || :
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
        exit 1
esac

exit $?
And my smtpd.conf file from /etc/postfix/sasl/
Code:
[root]~ # cat /etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: test123
sql_database: mail
sql_select: select password from users where email = '%u'
http://www.howtoforge.com/virtual_po...ota_courier_p2

That is the instructions I am following.

Last edited by Guardian-Mage; 04-19-2009 at 08:46 AM.
 
Old 04-19-2009, 11:14 AM   #22
Guardian-Mage
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
I now know the problem for sure.

Code:
[root]~ # telnet localhost 26
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 smtp.sabotix.com ESMTP Postfix
ehlo localhost
250-smtp.sabotix.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
BASE_64 ENCODED USERNAME HERE
334 UGFzc3dvcmQ6
BASE_64 ENCODED PASSWORD HERE
235 2.0.0 Authentication successful
The thing is I entered an actual shell account username and password, which should not of authenticated if MySQL was being used. The problem is getting mysql to work now. Any ideas?

I am using /usr/lib/sasl/smtpd.conf /usr/lib/sasl2/smtpd.conf and /etc/postfix/sasl/smtpd.conf which all looks like this:

Code:
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: 36upuYacHuCUw57e9Ewazej5
sql_database: mail
sql_select: select password from users where email = '%u'
Shouldn't it use pam or something and if not, maybe auxprop isn't installed. Can I check?

Last edited by Guardian-Mage; 04-19-2009 at 11:17 AM.
 
Old 04-19-2009, 02:06 PM   #23
Guardian-Mage
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
I've reinstalled postfix and saslauthd to try and fix it, and now when I try to login with telnet, it tells me no auth mech can be found.

Output of saslauthd -v
Code:
[root]/etc/sysconfig # saslauthd -v
saslauthd 2.1.22
authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap
 
Old 04-19-2009, 03:32 PM   #24
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did you install pam_mysql?
 
Old 04-19-2009, 09:15 PM   #25
Guardian-Mage
Member
 
Registered: Jan 2008
Posts: 36

Original Poster
Rep: Reputation: 15
yes
 
Old 04-19-2009, 09:20 PM   #26
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'm probably not going to be of much use from here, since I don't use mysql for anything to do with my mail servers.

Can I suggest you start a new thread regarding mysql and saslauth (but note that it's CentOS)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix - how to restrict access by telnet to postfix ? dlugasx Linux - Server 4 01-29-2009 03:55 PM
Postfix can't telnet 25 maceee Linux - Server 53 12-02-2008 04:06 AM
Cannot telnet postfix on port 25 alivewithtechnology Linux - General 6 08-22-2006 03:23 PM
telnet / ftp slow to respond sanjeevkumark Linux - Networking 1 10-05-2005 08:31 AM
postfix or telnet problem?? hivtop Red Hat 0 04-20-2005 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration