default Sendmail plus Cyrus-SASL

Joseph Garcia bsd_usr at
Mon Jul 30 17:53:41 PDT 2007

Okay, so got this to work. Joerg's hint got it to compile and work 
right. The rest was a matter of configuration.

The goal is to configure Sendmail as a relay client using 
authentication. It's supposed to accept incoming email then forward it 
over to a smtp server using authentication (ie. user name and password).

For those if you that want to do this. You need to first figure out what 
sort of authtentication services your smtp provider requires. 
Apparently, mine uses LOGIN. To find that out you just telnet to port 25 
of their smtp server and type 'ehlo' and it should spit 
out some stuff at you and you should pay attention to the "AUTH" line. 
That will pretty much tell you waht Cyrus plugins you'll need to install.

My first mistake was assuming that all I needed was 
/usr/pkgsrc/security/cyrus-sasl but I actually also needed the 
/usr/pkgsrc/security/cy2-login plugin that goes with the above mentioned 
SASL library. After I installed that, things were cake.

Once you have Cyrus SASL and it's plugins installed you'll need to 
recomplile Sendmail. I added the following lines to my 
/etc/defaults/make.conf file.

SENDMAIL_CFLAGS=-I/usr/pkg/include/sasl -I/usr/local/include -DSASL 
SENDMAIL_LDFLAGS=-L/usr/pkg/lib -R/usr/pkg/lib
SENDMAIL_LDADD=-lsasl2 -lssl -lcrypto

NOTE: Joerg helped me with the "-R/usr/pkg/lib" part. Thanks to him, it 
compiled right and worked.

I followed some tips from a site that I found to compile and reinstall 

If you need to do this, I suggest taking a look at the following URL for 
some help: (to test out LOGIN)
I pretty much spent a day working this and now I know why there are so 
many people who hate configuring Sendmail.

Hope this helps anyone out there.


Joseph Garcia wrote:
Hello all!

I'm trying to setup a sort of relay or gateway using Sendmail. Here's 
there deal:

Our hosted email provider let's us send them email via SMTP but that 
only works within the company's domain. If we want to send out of the 
domain we need to authenticate against their SMTP server.

We have these nifty Canon copiers that can scan and email the document 
in PDF form. Unfortunately, I can't put a username and password for SMTP 
authentication. Thefore, I'm thinking I can setup Sendmail to accept 
email from that Canon copier and then relaty it acting as a client to 
our hosted email provider's SMTP server.

It seems like I need AUTH to do this which requires Cyrus-SASL. Okay, so 
 I installed Cyrus-SASL from pkgsrc. Now I'm trying to rebuild sendmail 
to be able to use SASL but I'm getting the following error:

dfly# /etc/rc.d/sendmail forcestart
Starting sendmail.
/usr/libexec/ Shared object "" not found, 
required by "sendmail"
/usr/libexec/ Shared object "" not found, 
required by "sendmail"

Okay, when I built sendmail I added the following lines to my 
/etc/defaults/make.conf file:

SENDMAIL_CFLAGS=-I/usr/pkg/include/sasl -DSASL
Then I used the following websites as a guide to getting this to work:
So far I'm stuck with that "" not found, required by 
"sendmail" error.

Any help would be appreciated. If there's an easier way to do this, such 
as another program then I'm all ears. I've always known that Sendmail 
was a bitch to configure.

Thanks in advance,

Joseph Garcia

More information about the Users mailing list