LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-21-2014, 09:05 PM   #1
dschuett
Member
 
Registered: Aug 2010
Posts: 40

Rep: Reputation: 1
Sendmail With Optional Auth


I have a CentOS 6.5 server running sendmail. I use this server as a smarthost for all my other servers. I use the /etc/access file to control what machines are allowed to use this server as a relay using:
Code:
Connect:192.168.100.1 RELAY
Connect:192.168.100.2 RELAY

mydomain.com RELAY
This is all working great. The issue I am having is that I use IMAP in order to send and receive emails on my cell phone. I can receive email just fine. However, I am unable to use the server as a relay to send email from my phone because (obviously) my phone has a dynamic IP, so I can't add it to the access.db.

Is there a way to set up some sort of optional auth mechanism for my cell phone to authenticate with sendmail to allow it to use the server as a relay for outbound email from my phone?
 
Old 05-22-2014, 08:10 AM   #2
Rawcous
Member
 
Registered: Jan 2014
Location: Farnborough, Hampshire - UK
Distribution: SCO UNIX -> Fedora (Core) -> CentOS -> RedHat
Posts: 128

Rep: Reputation: 48
Hello "dschuett",

I have kind of been thinking the same thing myself in terms of accessing my domain mail via my smart phone. Until I have the time to sit down and read all the blurb and do it the proper way I have done the following:

1. Installed Webmin, a great web-based tool that can be used for locally and remotely administering a *Nix - type server.
2. Create a restricted webmin user account that can only read / create emails for specific accounts (blocking access to any admin activities).
3. Access webmin via my smartphone's browser.

The only downside (if it can be considered a downside), is that it requires the installation & configuration of Apache (not an issue), domain registration & hosting

I have done it - nice and simple.

As mentioned it's only a temporary measure until I find the time to do things "properly". I am sure there are hundreds of guys out there who can provide a quick-fire step-by-step guide on how-to's

Regards,

Rawcous!
 
Old 05-22-2014, 09:53 AM   #3
dschuett
Member
 
Registered: Aug 2010
Posts: 40

Original Poster
Rep: Reputation: 1
Resolved

## Install Needed Packages
Code:
yum install sendmail sendmail-cf cyrus-sasl-plain cyrus-sasl-md5
## Edit /etc/sasl2/Sendmail.conf
Code:
pwcheck_method:saslauthd
## Edit /etc/pam.d/smtp
Code:
#%PAM-1.0
auth       include      system-auth
account    include      system-auth
## Edit /etc/sysconfig/saslauthd
Code:
MECH=pam
# these two settings are the defaults
SOCKETDIR=/var/run/saslauthd
FLAGS=
## Start saslauthd
Code:
chkconfig saslauthd on
service saslauthd start
## Add/Edit These Lines To sendmail.mc
Code:
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN PAM')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN PAM')dnl

define(`CERT_DIR', `/etc/mail/certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/ca-bundle.crt')
define(`confCRL', `CERT_DIR/ca-bundle.crt')
define(`confSERVER_CERT', `CERT_DIR/sendmail.pem')
define(`confSERVER_KEY', `CERT_DIR/sendmail.pem')
define(`confCLIENT_CERT', `CERT_DIR/sendmail.pem')
define(`confCLIENT_KEY', `CERT_DIR/sendmail.pem')

define(`confAUTH_OPTIONS', `A p y')dnl

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtps,Addr=0.0.0.0, Name=MTA-SSL M=E')dnl
## Create The Certs
Code:
cd /etc/mail
mkdir certs
cd certs
openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 365
openssl req -nodes -new -x509 -keyout sendmail.pem -out sendmail.pem -days 365
cp /etc/ssl/certs/ca-bundle.crt /etc/mail/certs
chmod -R 600 /etc/mail/certs/*
## Add trusted user to /etc/mail/trusted-users
Code:
yourlinuxusername

## Make New sendmail.cf and restart
Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

Profit!
 
1 members found this post helpful.
  


Reply

Tags
sendmail, sendmail access, smtp, smtpauth



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
[SOLVED] SMTP AUTH with sendmail in centos.. 504 5.3.3 AUTH mechanism LOGIN not available satyadev75 Linux - Server 3 01-23-2014 02:30 AM
[SOLVED] sendmail client with AUTH chuikingman Linux - Server 16 02-10-2012 06:00 AM
Sendmail Auth Turrauko Linux - Software 1 02-28-2007 11:00 AM
Using sendmail as a client with AUTH VAS Linux - Software 10 04-24-2006 06:11 PM
SMTP Auth for sendmail wolftechmn Linux - Networking 4 11-27-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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