LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-20-2016, 03:07 AM   #1
Patric.F
Member
 
Registered: Feb 2010
Posts: 47

Rep: Reputation: 0
Postifx authenticate local users


Hi,

I need to setup an outgoing SMTP server using Debian and Postfix.
This server is Only for outgoing mail and nothing else.
I will have local users that will authenticate and send email only.

I get a bit of a headache when trying to figure this out.
I'm trying to get SASL and Postfix to work with authentication but I can't get it to work.

When I try this:
Code:
testsaslauthd -u test -p testpass
I get:
Quote:
0: OK "Success."
However when I try to do telnet and try the authentication I get this:
Quote:
root@smtpout:~# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 smtpout.domain.com ESMTP Postfix (Debian/GNU)
ehlo dummy
250-smtpout.domain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH DIGEST-MD5 CRAM-MD5 NTLM PLAIN LOGIN
250-AUTH=DIGEST-MD5 CRAM-MD5 NTLM PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN dGVzdAB0ZXN0AHRlc3RwYXNz
535 5.7.8 Error: authentication failed: authentication failure
quit
221 2.0.0 Bye
In mail.log I get this:
Quote:
Jan 20 09:55:31 edith-smtpout postfix/smtpd[6091]: connect from localhost[::1]
Jan 20 09:55:35 edith-smtpout postfix/smtpd[6091]: warning: SASL authentication failure: Password verification failed
Jan 20 09:55:35 edith-smtpout postfix/smtpd[6091]: warning: localhost[::1]: SASL PLAIN authentication failed: authentication failure
Jan 20 09:55:38 edith-smtpout postfix/smtpd[6091]: disconnect from localhost[::1]
These are my configs:

main.cf:
Code:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = smtpout.domain.com, localhost.domain.com, , localhost
myhostname = smtpout.domain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
/etc/default/saslauthd-postfix:
Code:
START=yes
DESC="SASL Auth. Daemon for Postfix"
NAME="saslauthd-postf"
MECHANISMS="shadow"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
I can't find much info on how to setup with local users and don't use Dovecot and MySQL etc.
Is there anyone that can help me with this?
If I just get the authentication to work I will be able to do the rest myself. I haven't done much in the TLS section yet as I want to get things working first.
 
Old 01-27-2016, 02:39 AM   #2
Patric.F
Member
 
Registered: Feb 2010
Posts: 47

Original Poster
Rep: Reputation: 0
I had forgot to create /etc/postfix/sasl/smtpd.conf with this content:

Code:
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
Now it's working.
 
  


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
Authenticate only some users in Apache? ngiw2012 Linux - Software 5 07-20-2014 09:08 AM
authenticate AD users to openldap hkg04 Linux - Enterprise 4 02-24-2010 09:34 AM
how to config sendmail to authenticate anybody except local users? botskonet Linux - Software 1 11-29-2008 07:36 AM
How to Authenticate users in a Hotspot landysaccount Linux - Newbie 1 10-15-2008 10:05 AM
how to authenticate external users but bypass prompt on local LAN users? taiwf Linux - Security 5 07-13-2005 09:01 AM

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

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