LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-13-2015, 03:54 PM   #1
thirteen_engines
Member
 
Registered: Sep 2009
Distribution: Slackware 14.1
Posts: 118

Rep: Reputation: 20
Problems authenticating with sendmail


I'm trying to set up sendmail, dovecot and thunderbird on my office email server. I'm running sendmail 8.14.9 and dovecot 2.2.13 under Slackware 14.1 and have compiled and installed dovecot from Slackbuilds and can use it to read emails with TB from anywhere. However I can't send emails using TB except from the server itself. It seems not to want to authenticate ... saslauthd is running.

The sendmail.mc is:
Code:
dnl# This is the default sendmail .mc file for Slackware.  To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
dnl#
dnl# cp sendmail-slackware.mc /usr/share/sendmail/cf/config.mc
dnl# cd /usr/share/sendmail/cf
dnl# sh Build config.cf
dnl#
dnl# You may then install the resulting .cf file:
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
VERSIONID(`TLS supporting setup for Slackware Linux')dnl
OSTYPE(`linux')dnl
dnl# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
dnl define(`SMART_HOST',`mailserver.example.com')
dnl# No timeout for ident:
define(`confTO_IDENT', `0')dnl
dnl# Enable the line below to use smrsh to restrict what sendmail can run:
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl# See the README in /usr/share/sendmail/cf for a ton of information on
dnl# how these options work:
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
FEATURE(`no_default_msa')dnl
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl##################ADDED STUFF##################
dnl# define a max message size so the MTA doesn't choke
define(`confMAX_MESSAGE_SIZE',`52428800')dnl
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')dnl
define(`confCACERT_PATH',`/etc/mail/certs')dnl
define(`confCACERT',`/etc/mail/certs/cacert.pem')dnl
define(`confSERVER_CERT',`/etc/mail/certs/cert.pem')dnl
define(`confSERVER_KEY',`/etc/mail/certs/key.pem')dnl
define(`confCLIENT_CERT',`/etc/mail/certs/cert.pem')dnl
define(`confCLIENT_KEY',`/etc/mail/certs/key.pem')dnl
dnl# Allow SASL authentication/relaying:
define(`confAUTH_OPTIONS', `A')dnl
  TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtps, Name=MSA, M=Ea')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
I'm using "ssl/tls" and "normal password" in TB's server settings which seems to work ok from anywhere. For the outgoing server settings, using TB on the server, "no security" and "no authentication" work. Using TB with "starttls" and "normal password" on either the server machine or an off-server machine doesn't work. TB says
Quote:
The message could not be sent because connecting to SMTP server chem4823.usask.ca failed. The server may be unavailable or is refusing SMTP connections.
My understanding is that in a situation such as this authentication is required from an off-server client in order to send the email.

Zenmap shows port 587 open

In the sendmail log file, when I try to send, I see:
Code:
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39R009950: --- 220 2.0.0 Ready to start TLS
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=server, get_verify: 0 get_peer: 0x0
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=server, relay=localhost.localdomain [127.0.0.1], version=TLSv1/SSLv3, verify=NO, cipher=DHE-RSA-AES128-SHA, bits=128/128
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=server, cert-subject=, cert-issuer=, verifymsg=ok
Apr 13 14:42:03 myserv sm-mta[9950]: AUTH: available mech=LOGIN OTP PLAIN DIGEST-MD5 CRAM-MD5, allowed mech=DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39R009950: <-- EHLO [127.0.0.1]
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-myserv.usx.ca Hello localhost.localdomain [127.0.0.1], pleased to meet you
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-ENHANCEDSTATUSCODES
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-PIPELINING
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-8BITMIME
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-SIZE 52428800
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-DSN
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250-DELIVERBY
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 250 HELP
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: <-- AUTH PLAIN AGJyb3duoawAydVE0czY5UQ==
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 535 5.7.0 authentication failed
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: AUTH failure (PLAIN): user not found (-20) SASL(-13): user not found: Password verification failed, relay=localhost.localdomain [127.0.0.1]
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: <-- AUTH LOGIN
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 334 VXNlcm5hbWU6
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 334 UGFzc3dvcmQ6
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: --- 535 5.7.0 authentication failed
Apr 13 14:42:03 myserv sm-mta[9950]: t3DKg39S009950: AUTH failure (LOGIN): user not found (-20) SASL(-13): user not found: checkpass failed, relay=localhost.localdomain [127.0.0.1]
Apr 13 14:42:03 myserv sm-mta[9950]: STARTTLS=read, info: fds=9/5, err=2
Apr 13 14:42:10 myserv sm-mta[9950]: t3DKg39S009950: <-- QUIT
Apr 13 14:42:10 myserv sm-mta[9950]: t3DKg39S009950: --- 221 2.0.0 myserv.usx.ca closing connection
Authentication appears to be the problem but why ....

Last edited by thirteen_engines; 04-13-2015 at 04:54 PM.
 
Old 04-14-2015, 05:17 AM   #2
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Rep: Reputation: 73
sending with plain 25 port, without these ssl and pass - works ok? do you check?
also logfile says "user not found" -in that part all is ok. that user is really exist on your mailserver?
shell is valid?
 
Old 04-14-2015, 06:48 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Years ago when I configured Sendmail with SASL Auth, I ran into this problem. I needed to create a Sendmail configuration file for saslauthd:

File name: /etc/sasl2/Sendmail.conf
File content:
Code:
pwcheck_method:saslauthd
mech_list:login plain
saslauthd_path:/var/state/saslauthd/mux
If you start saslauthd manually with debug sent to your terminal (saslauth -d) then you would already have a bigger chance to see if anything is happening between Sendmail and saslauthd.
if you raise the Debug Level of Sendmail to 13, then you would additionally see errors like "safesasl(/etc/sasl2/Sendmail.conf) failed: No such file or directory". At least that was how I found out I needed that file.
 
1 members found this post helpful.
Old 04-14-2015, 09:53 AM   #4
thirteen_engines
Member
 
Registered: Sep 2009
Distribution: Slackware 14.1
Posts: 118

Original Poster
Rep: Reputation: 20
Thumbs up

Thanks for the replies, guys. WiseDraco, sending via port 25 without ssl and password works only using TB on the server itself. My research indicates that this is because sendmail trusts connections made directly on the machine it resides on. Trying the same thing using TB on a remote machine will result in a "relay" error ... authentication is required or no email can be sent. A spam-relay protection mechanism I guess.

Bob, I did have a Sendmail.conf file in /usr/lib/sasl2. I put a copy into /etc/sasl2 as you suggested but it still didn't work. Then, after reading the saslauthd man page (which I should have done in the beginning) I put the Sendmail.conf file in /usr/local/etc. It was necessary to restart both saslauthd and sendmail but it seems to have worked, at least on the local machine. Wait a sec .... Yes!!!! It works on a remote machine as well. Thanks so much for your help.
 
Old 04-15-2015, 03:26 PM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by thirteen_engines View Post
I put the Sendmail.conf file in /usr/local/etc.
Did you compile your own version of cyrus-sasl and installed that to /usr/local instead of /usr ? There is no other reasonable explanation.
 
Old 04-16-2015, 09:29 AM   #6
thirteen_engines
Member
 
Registered: Sep 2009
Distribution: Slackware 14.1
Posts: 118

Original Poster
Rep: Reputation: 20
No. I'm using the stock version of saslauthd that comes with Slackware.

After rereading the man page for saslauthd I find that it's the saslauthd.conf file that goes into /usr/local/etc rather than Sendmail.conf. So, since authentication is working now I assume that /etc/sasl2 is actually the correct place for Sendmail.conf.

Thanks again for your help.
 
  


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
Sendmail DNSBL blocking authenticating users feloniousj Linux - Server 3 02-17-2022 12:22 PM
Problems authenticating with squid_ldap_auth josemi Linux - Server 1 05-19-2012 04:45 PM
Sendmail not authenticating users manutdfan1988 Linux - General 1 01-24-2011 05:25 AM
Problems authenticating more than once with wpa_supplicant cdhgee Linux - Wireless Networking 1 09-06-2006 03:17 PM
sendmail and authenticating smtp jgnasser Linux - Networking 3 01-23-2005 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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