LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-15-2010, 02:20 PM   #1
nikooo777
LQ Newbie
 
Registered: Apr 2010
Location: Switzerland
Distribution: Debian Squeeze
Posts: 15

Rep: Reputation: 0
Postfix + saslauthd can't get it to work/(auth?)


Hello,
this is like my 20th time trying to successfully setup a postfix server working, unfortunately, even if i spent many many hours trying and retrying i always failed at it. even google became useless after all the errors i had to deal with.

so here i am hoping my 21st time with the help of an acknowledged community will be successful.

some info you may need:
i am running a box with Debian Lenny 5 installed on it (64bit)
one of the domains pointed at my box and that i want to use as hostname (user@nikooo777.info) is (i'll use something different than the real one as i would like to keep it private) nikooo777.info

my /etc/postfix/main.cf looks like:
PHP Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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

readme_directory no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file
=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls
=yes
smtpd_tls_session_cache_database 
btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database 
btree:${data_directory}/smtp_scache
smtpd_sasl_auth_enable 
yes
smtpd_sasl_local_domain 
nikooo777.info
smtpd_recipient_restrictions 
permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_security_options 
noanonymous

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname nikooo777.info
alias_maps 
hash:/etc/aliases
alias_database 
hash:/etc/aliases
myorigin 
= /etc/mailname
mydestination 
nikooo777.infolocalhost
relayhost 

mynetworks 127.0.0.0/[::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit 
0
recipient_delimiter 
= +
inet_interfaces all
inet_protocols 
ipv4
home_mailbox 
Maildir/
mailbox_command 
my /etc/postfix/master.cf looks like:
PHP Code:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       
-       -       -       0       cleanup
qmgr      fifo  n       
-       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  
-       -       -       -       -       trivial-rewrite
bounce    unix  
-       -       -       -       0       bounce
defer     unix  
-       -       -       -       0       bounce
trace     unix  
-       -       -       -       0       bounce
verify    unix  
-       -       -       -       1       verify
flush     unix  n       
-       -       1000?   0       flush
proxymap  unix  
-       -       n       -       -       proxymap
proxywrite unix 
-       -       n       -       1       proxymap
smtp      unix  
-       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    
-o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  
-       -       -       -       -       error
retry     unix  
-       -       -       -       -       error
discard   unix  
-       -       -       -       -       discard
local     unix  
-       n       n       -       -       local
virtual   unix  
-       n       n       -       -       virtual
lmtp      unix  
-       -       -       -       -       lmtp
anvil     unix  
-       -       -       -       1       anvil
scache    unix  
-       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags
=DRhu user=vmail argv=/usr/bin/maildrop -${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags
=Fqhu user=uucp argv=uux ----a$sender $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags
=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags
=Fquser=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail
-backend unix    -    n    n    -    2    pipe
  flags
=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags
=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  
${nexthop} ${user
my /etc/default/saslauthd looks like:
PHP Code:
#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="shadow"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
#OPTIONS="-c -m /var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
PWDIR="/var/spool/postfix/var/run/saslauthd"
PARAMS="-m ${PWDIR}"
PIDFILE="${PWDIR}/saslauthd.pid" 
an info that may be useful:
PHP Code:
products:/var/spool/postfix/var/run/saslauthd# ls
cache.flock  cache.mmap  mux  mux.accept  saslauthd.pid 
i edited line 95 of /etc/init.d/postfix into:
PHP Code:
FILES="etc/localtime etc/services etc/resolv.conf etc/hosts etc/nsswitch.conf etc/sasldb2" 
with Microsoft Outlook 2007 when i try to connect it will ask me for the username and the password everytime i press ok,
opening /var/log/mail.info i see this:
PHP Code:
Nov 15 20:11:17 products postfix/master[7407]: daemon started -- version 2.5.5configuration /etc/postfix
Nov 15 20
:11:26 products pop3dLOGINuser=nikoip=[::ffff:195.***.***.10], port=[36354]
Nov 15 20:11:26 products pop3dscancur opendir("cur"): No such file or directory
Nov 15 20
:11:29 products postfix/smtpd[7420]: connect from 195-***-***-10.dclient.hispeed.ch[195.***.***.10]
Nov 15 20:11:29 products postfix/smtpd[7420]: warningSASL authentication failureno secret in database
Nov 15 20
:11:29 products postfix/smtpd[7420]: warning195-***-***-10.dclient.hispeed.ch[195.***.***.10]: SASL NTLM authentication failedauthentication failure
Nov 15 20
:11:29 products postfix/smtpd[7420]: warningSASL authentication failurerealm changedauthentication aborted
Nov 15 20
:11:29 products postfix/smtpd[7420]: warning195-***-***-10.dclient.hispeed.ch[195.***.***.10]: SASL DIGEST-MD5 authentication failedauthentication failure
Nov 15 20
:11:30 products postfix/smtpd[7420]: warning195-***-***-10.dclient.hispeed.ch[195.***.***.10]: SASL LOGIN authentication failedauthentication failure
Nov 15 20
:11:30 products postfix/smtpd[7420]: lost connection after AUTH from 195-***-***-10.dclient.hispeed.ch[195.***.***.10]
Nov 15 20:11:30 products postfix/smtpd[7420]: disconnect from 195-***-***-10.dclient.hispeed.ch[195.***.***.10
i really hope you can help me making it work!
by the way i also installed courier-pop to retrieve my mails which actually won't work too but this is another problem.

sincerely, Niko.

PS: if you need more data feel free to ask!
 
Old 11-16-2010, 12:47 PM   #2
nikooo777
LQ Newbie
 
Registered: Apr 2010
Location: Switzerland
Distribution: Debian Squeeze
Posts: 15

Original Poster
Rep: Reputation: 0
anyone? i got pop3 running and i can receive mails successfully but i cant auth to send mails still stand with this error.
 
Old 11-16-2010, 04:44 PM   #3
nikooo777
LQ Newbie
 
Registered: Apr 2010
Location: Switzerland
Distribution: Debian Squeeze
Posts: 15

Original Poster
Rep: Reputation: 0
Fixed by:
editing /etc/default/saslauthd to:
PHP Code:
...
MECHANISMS="pam"
... 
adding to /etc/postfix/main.cf :
PHP Code:
#adding this:
smtpd_sasl_path smtpd 
and by creating a conf file EXACTLY like this (if using saslauthd to auth):
/etc/postfix/sasl/smtpd.conf
PHP Code:
pwcheck_methodsaslauthd
mech_list
plain login cram-md5 digest-md5 
if you are using a mysql database use this instead:
PHP Code:
pwcheck_methodsaslauthd auxprop
auxprop_plugin
mysql
mech_list
plain login cram-md5 digest-md5
sql_engine
mysql
sql_hostnames
: [your_hostname]
sql_user: [username]
sql_passwd: [password]
sql_database: [user_database]
sql_selectSELECT [password_columnFROM [authentication_tableWHERE [username_column] = '%u@%r' 

i hope you'll finally success like me
i'm really happy now!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 'auth login' using saslauthd set up doesn't work. lxvor Linux - Software 1 09-10-2010 03:48 PM
How to setup mysql and saslauthd with postfix (CentOS 5.3) Guardian-Mage Linux - Server 10 04-21-2009 06:05 AM
postfix/saslauthd/smtp - somethings not right nucklebone Linux - Server 2 03-16-2007 09:57 PM
postfix mysql cyrus saslauthd problem Sleen Linux - Server 1 02-15-2007 10:10 AM
Postfix SMTP AUTH, Problem using saslauthd + pam k1e0x Debian 0 10-19-2004 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:16 AM.

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