LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-21-2005, 07:07 PM   #1
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Rep: Reputation: 15
SMTP AUTH & MySQL


I posted the following in the "Linux - Software" forum, but realized it probably is more on topic in this forum:

Maybe I'm going about this the wrong way. I have Postfix installed, with Courier Imapd (and POP3d). I am planning on hosting several websites, and have setup Postfix and Courier to use virtual mailboxes. In otherwords, users don't need to have a system account to receive and get mail. So far, everything is working fine. I can log in using IMAP and get my email. All info is stored in MySQL table (passwords, using ENCRYPT() function).

Now, I want to set up Postfix to allow sending email. I would like to use SMTP AUTH. Users will have to authenticate using the same login information that courier uses. I've read quite a bit of google articles on how to set this up, but seem to be coming up blank.

First, my environment:
CentOS 64 3.4
AMD 64 processor
postfix-2.2.1
courier-imap-4.0.2

Here's what I've done so far:

Postfix's main.cf contains the following sasl options:
smtpd_sasl_auth_enable=yes
smtpd_sasl_security_options=noanonymous
broken_sasl_auth_clients=yes

smtpd_recipient_restrictions=permit_sasl_authenticated, permit_mynetworks, reject
smtpd_sasl_local_domain =

In the file /usr/lib64/sasl2/smtpd.conf:
pwcheck_method: pam

The file /etc/pam.d/smtp:
#%PAM-1.0
auth sufficient pam_mysql.so user=postfix passwd=secret db=maildb table=mailbox usercolumn=username passwdcolumn=password crypt=1

auth required pam_mysql.so user=postfix passwd=secret db=maildb table=mailbox usercolumn=username passwdcolumn=password crypt=1


I am unable to successfully authenticate when I attempt to send an email. The following is what's written in /var/log/maillog (host and IP removed):

warning: SASL authentication problem: unknown password verifier
warning: .....com[.......]: SASL LOGIN authentication failed

Any suggestions?

THanks in advance
 
Old 03-22-2005, 09:12 PM   #2
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Original Poster
Rep: Reputation: 15
Going to answer my own question, just in case anyone else needs this info.

Things that are different in my original post (NOTE: My stuff is in /usr/lib64. Usually, it will be in /usr/lib):

In the file /usr/lib64/sasl2/smtpd.conf:
pwcheck_method: saslauthd
mech_list: plain login

(last line was added, and pwcheck_method changed to "saslauthd"

Biggest problem was that I had pam_mysql.so in /lib/security, as opposed to /lib64/security. Moving it ot /lib64/security fixed a lot of problems I was having.

The file /etc/pam.d/smtp:
#%PAM-1.0
auth sufficient pam_mysql.so user=postfix passwd=secret db=maildb table=mailbox usercolumn=username passwdcolumn=password crypt=1

account required pam_mysql.so user=postfix passwd=secret db=maildb table=mailbox usercolumn=username passwdcolumn=password crypt=1


(changed last line from "auth" to "account").

Hope this helps someone who's been struggling with this same issue.

Cheers.
 
  


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
SMTP "open relay" and SMTP AUTH aikempshall Linux - Security 3 10-11-2006 08:19 AM
SMTP AUTH & MySQL vbfischer Linux - Software 0 03-21-2005 01:05 PM
What's going on with this SMTP AUTH. exper Linux - Software 0 12-25-2004 02:58 AM
sendmail & smtp auth vacilus Linux - Software 18 09-15-2004 02:52 AM
Sendmail & smtp auth ROAR Linux - Software 1 10-05-2003 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:12 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