Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd August 2007, 03:51
matulio matulio is offline
Junior Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question postfix, sasl2 e mysql in debian etch

hello,

I tried to use sasl2 with MySQL without pam in the debian 4.0 but I did not have sucess.
I did not have success in making the user to use the smtp authentication. Somebody can help ?

I did install the following packages:
#apt-get install libsasl2-modules-sql libsasl2-modules libsasl2-2 libsasl2 libsasl2-dev libsasl2-modules sasl2-bin


/var/log/auth.log
"postfix/smtpd[3393]: sql plugin trying to open db 'postfix' on host 'localhost'
postfix/smtpd[3393]: sql plugin could not connect to host localhost "

my confs:
/etc/postfix/sasl/smtpd.conf
log_level:7
pwcheck_method: auxprop
auxprop_plugin: sql
sql_engine: mysql
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
sql_hostnames:localhost,127.0.0.1
sql_user: postfix
sql_passwd: xxxx
sql_database: postfix
sql_select: SELECT password FROM mailbox WHERE username = '%u@%r'
sql_verbose: yes

/etc/default/saslauthd
START=YES
MECHANISMS="sql"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

/etc/postfix/main.cf
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients=yes
Reply With Quote
Sponsored Links
  #2  
Old 4th August 2007, 11:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by matulio
postfix/smtpd[3393]: sql plugin could not connect to host localhost "
What's the output of
Code:
netstat -tap
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 5th August 2007, 16:43
matulio matulio is offline
Junior Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello, Falko, thanks for reply.

I followed your tutorial, but I tried to use sasl without pam.

is this the output of netstat -tap
11:56:02 root@ marte :~ # netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:mysql *:* LISTEN 2450/mysqld
tcp 0 0 marte.domain:domain *:* LISTEN 2359/named
tcp 0 0 localhost:domain *:* LISTEN 2359/named
tcp 0 0 *:smtp *:* LISTEN 2687/master
tcp 0 0 localhost:953 *:* LISTEN 2359/named
tcp6 0 0 *:imaps *:* LISTEN 2593/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 2581/couriertcpd
tcp6 0 0 *:www *:* LISTEN 2785/apache2
tcp6 0 0 *:domain *:* LISTEN 2359/named
tcp6 0 0 *:ssh *:* LISTEN 2712/sshd
tcp6 0 0 *:smtp *:* LISTEN 2687/master
tcp6 0 0 ip6-localhost:953 *:* LISTEN 2359/named
Reply With Quote
  #4  
Old 6th August 2007, 16:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Hm, MySQL is listening on localhost...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 6th August 2007, 19:02
matulio matulio is offline
Junior Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello, Falko, thanks again for reply.

yes, mysql is running in the same machine of postfix

is not correct listen on localhost ?

what should I need to do ?


ps: sorry for my english.
Reply With Quote
  #6  
Old 7th August 2007, 09:16
geekman geekman is offline
Member
 
Join Date: Sep 2006
Location: Sydney, Australia
Posts: 56
Thanks: 1
Thanked 10 Times in 10 Posts
Send a message via ICQ to geekman Send a message via MSN to geekman
Default

Have you tried making sure you can connect with the mysql client with the details you provided? Example:

mysql -u postfix -p <password>
use postfix;
Then maybe...run a test query too:
SELECT password FROM mailbox WHERE username = '<test username>';
quit;

You could do that to verify that you can in fact connect normally, though it's probably not the case that you can't connect it's always good to eliminate possibilities.

Of course if you can't connect then you may be looking at problems with your MySQL installation, or a typo.

Thanks.
Reply With Quote
  #7  
Old 15th August 2007, 18:45
gosi gosi is offline
Junior Member
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, I think so:

postfix runs in a chroot jail, so localhost will not work, unless you do the following:

# mkdir -p /var/spool/postfix/var/run/mysqld
# chown mysql /var/spool/postfix/var/run/mysqld
# ln /var/run/mysqld/mysqld.sock /var/spool/postfix/var/run/mysqld/mysqld.so

since the socket will be recreated every time MySQL restarts, so its best to add that lines into /etc/mysql/debian-start just before "exit 0":

# rm -rf /var/spool/postfix/var/run/mysqld/mysqld.sock
# ln /var/run/mysqld/mysqld.sock /var/spool/postfix/var/run/mysqld/mysqld.sock

pasted from:

http://kb.gosi.at/content/9/20/en/db...bian-etch.html


and btw: you most likely won´t need saslauthdaemon running ... postfix directly interfaces with the authentication plugins from sasl.
Reply With Quote
  #8  
Old 15th August 2007, 19:01
matulio matulio is offline
Junior Member
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will try.
thank you
Reply With Quote
  #9  
Old 15th August 2007, 19:05
gosi gosi is offline
Junior Member
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

well if that doesn´t work, you should check the user credentials ...

just let me know how this story goes, I will stay as long as it takes
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Users And Domains With Postfix, Courier And MySQL (Debian Etch) mess-mate HOWTO-Related Questions 1 2nd July 2007 23:07
Virtual Users And Domains With Postfix, Courier And MySQL & debian etch Tortanick HOWTO-Related Questions 5 19th June 2007 12:29
Debian Etch Postfix Sasl2 issues switchtower HOWTO-Related Questions 15 27th May 2007 20:05
Centos 4.4 32bit Hangs, High Server load 3cwired_com Server Operation 11 16th November 2006 15:47
Verify email setup meekish Installation/Configuration 28 27th October 2006 15:36


All times are GMT +2. The time now is 15:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.