Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2006 14:25:04 -0700
From:      "Kirk Davis" <Kirk.Davis@epsb.ca>
To:        "Greg Groth" <ggroth99@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: Sendmail - IMAP-UW - Cyrus-SASL2 - SMTPAUTH problems
Message-ID:  <04C71268DFDAA8499EC1A248A44B6A2B019E50B6@Exchange21.EDU.epsb.ca>

next in thread | raw e-mail | index | archive | help
Hi Greg,
=20
> I'm trying to set up a FreeBSD 6.0 box as a mail server, and while=20
> everything seems to be working OK for the most part, I have=20
> run into two=20
> issues that I cannot resolve (I'm new to BSD, please bear=20
> with me). Install=20
> went as follows:  Installed via FTP last night along with=20
> "src - Sources for=20
> everything",
>=20
> IMAP-UW was compiled via ports with WITH_SSL_AND_PLAINTEXT=20
> enabled (same for=20
> cclient), OpenSSL, Cyrus-SASL2 & Cyrus-SASL2-saslauthd were=20
> compiled via=20
> ports with no flags.
>=20
> Sendmail was installed with the base install and recompiled=20
> (after SASL2 was=20
> up and running) with the following options added to make.conf:
>=20
> # SASL (cyrus-sasl v2) sendmail build flags...
> SENDMAIL_CFLAGS=3D-I/usr/local/include -DSASL=3D2
> SENDMAIL_LDFLAGS=3D-L/usr/local/lib
> SENDMAIL_LDADD=3D-lsasl2
> # Adding to enable alternate port (smtps) for sendmail...
> SENDMAIL_CFLAGS+=3D -D_FFR_SMTP_SSL
>=20
> I followed the instructions I found at=20
> http://www.bsdconspiracy.net/howto/sendmail.html, and had no=20
> problems with=20
> the install except for Sendmail.  After recompiling sendmail,=20
> I added the=20
> following lines to the mail.server.mc file:
>=20
> define(`confAUTH_MECHANISMS',`PLAIN LOGIN')dnl
> TRUST_AUTH_MECH(`PLAIN LOGIN')dnl
> define(`CERT_DIR', `/etc/mail/certs')dnl
> define(`confCACERT_PATH', `CERT_DIR')dnl
> define(`confCACERT', `CERT_DIR/mycert.pem')dnl
> define(`confSERVER_CERT', `CERT_DIR/mycert.pem')dnl
> define(`confSERVER_KEY', `CERT_DIR/mykey.pem')dnl
> define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')dnl
> define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')dnl
> DAEMON_OPTIONS(`Port=3Dsmtp, Name=3DMTA')dnl

This is your problem.  The above line sets up the Sendmail daemon to
listen on port 25 but the standard mc file distributed with FreeBSD also
sets up a DAEMON port (it's at the end of the MC file).

Here is what my DAEMON_OPTIONS lines look like.  These should be the
only DAEMON_OPTIONS lines in the mc file.
dnl Enable for both IPv4 and IPv6 (optional)
DAEMON_OPTIONS(`Name=3DIPv4, Family=3Dinet')
DAEMON_OPTIONS(`Name=3DIPv6, Family=3Dinet6, Modifiers=3DO')
DAEMON_OPTIONS(`Port=3Dsmtps, Name=3DTLSMTA, M=3Ds')dnl


> DAEMON_OPTIONS(`Port=3Dsmtps, Name=3DTLSMTA, M=3Ds')dnl
>=20
> After running (in /etc/mail) "make clean", "make cf", "make=20
> install", "make=20
> restart", SMTP no longer works, and I find the following in=20
> maillog and=20
> messages
>=20
> Feb 12 20:25:55 mail sm-mta[1213]: daemon IPv4: problem=20
> creating SMTP socket
> Feb 12 20:26:00 mail sm-mta[1213]: NOQUEUE: SYSERR(root):=20
> opendaemonsocket:=20
> daemon IPv4: cannot bind: Address already in use
>=20
> When I try and stop sendmail, I get a message that the pid=20
> for Sendmail=20
> cannot be found.  I end up killing the missing Sendmail daemon using=20
> KSysGuard
>=20
> If I remove this line - "DAEMON_OPTIONS(`Port=3Dsmtp,=20
> Name=3DMTA')dnl" from the=20
> mail.server.mc file, make cf, make install, make restart,=20
> sendmail starts=20
> normally.  When trying to access from another machine on my=20
> network, I can=20
> only connect on port 25 without a secure connection (I'm=20
> using Thunderbird=20
> for this), although SMTP-AUTH is working correctly.

Have you tried to setup your mail client to connect to port 465?  This
is the smtps (SMTP SSL) port.


> Any ideas on what I might need to do to get SSL / SMTP-AUTH=20
> working on SMTP?=20
>   I took a look at the instructions in the handbook, but they=20
> were written=20
> for SASL1.  Running netstat shows smtps listening on 465, but=20
> when I try to=20
> telnet to that port, the server drops the connection.

Hmm... It should connect but you will not see anything since it is
expecting an SSL connection.

> My second problem is rather simple, after I create an IMAP=20
> folder, I am=20
> unable to delete it using a remote client.  Thunderbird=20
> responds with "The=20
> mail server responded: RENAME failed: Can't create mailbox node=20
> /home/User/Trash/: File exists.  Nothing shows up in any of=20
> the server logs=20
> though.

I have not seen this problem although I have it setup for an office of
Outlook users.  I would check the permissions on the folders in the user
home directory.  This is where the IMAP user forlders are by default.  I
usually setup the clients to use the base imap if Mail and then create a
Mail directory in the user home directory.  That way the mail folders
don't get messed up with the user stuff.

>=20
> Hopefully this is the right list for these questions, if not,=20
> could someone=20
> please direct me to the correct one?  Any advice anyone can=20
> give me on=20
> either of these problems would be greatly appreciated.
>=20

---- Kirk
Kirk Davis
Senior Network Analyst, ITS
Edmonton Public Schools
1-780-429-8308



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?04C71268DFDAA8499EC1A248A44B6A2B019E50B6>