Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 1998 16:44:12 -800
From:      walton@nordicdms.com (Dave Walton)
To:        chas <panda@peace.com.my>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Cyrus IMAPd and Qmail working together anyone ?
Message-ID:  <19980527234413097.AAA201@mail.nordicdms.com>
In-Reply-To: <3.0.32.19980527113520.0092f940@peace.com.my>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27 May 98 at 11:13, chas wrote:

> I'm now having a total nightmare trying to get Qmail to feed
> mail to Cyrus IMAP on a third server. Has anyone got this to
> work ? If so, may I ask a desperate 'how' ? 


Chas,

I just did this, and it went very smoothly.  Of course, I did get 
some good pointers from someone on the qmail list before I started, 
so I guess it's my turn to pass it along.

I assume you can handle installing cyrus and qmail.  Do that, except 
you can ignore the sendmail-specific portions of the cyrus install, 
since you won't be using sendmail.

You'll need to give the cyrus account a home directory to put its 
.qmail files in, and make it owned by cyrus.  (We'll assume you use 
/home/cyrus, but it could be anywhere.)

Create /home/cyrus/.qmail-default containing:
|/home/cyrus/qmail-deliver

Create /home/cyrus/qmail-deliver containing the script attached 
below, and make it executable by the cyrus account.  This script 
feeds the email to cyrus and translates the return codes for qmail.

Now all you need to do to put mail into username's cyrus box is 
forward it to cyrus-username from any .qmail file.  cyrus-username is 
handled by ~cyrus/.qmail-default while qmail strips off the "cyrus-" 
and puts "username" in $EXT.  The cyrus deliver program reads $EXT 
from its command line, and puts the mail in the user.username box.

That help any?

By the way...  Do you know how to make cyrus use something other than 
/etc/passwd for authentication?  I've got it on a machine that 
doesn't allow user logins, and I don't really want to fill up 
/etc/passwd with a bunch of usernames and passwords that will only be 
used by cyrus.

Dave



qmail-deliver:
------------------------------------------------------------
#!/bin/sh
#
# This script should be called from a .qmail-default file.
# It delivers mail to Cyrus' deliver, and returns the proper
# error code for qmail.
#
/usr/local/cyrus/bin/deliver $EXT
case $? in
  64|65|66|67|68|76|77|78)
    exit 100
    ;;
  0)
    exit 0
    ;;
  *)
    exit 111
    ;;
esac
# man qmail-command:
#         command's exit codes are interpreted as follows:  0 means
#         that the delivery was successful; 99 means that the delivery
#         was successful, but that qmail-local should ignore all
#         further delivery instructions; 100 means that the delivery
#         failed permanently (hard error); 111 means that the delivery
#         failed but should be tried again in a little while (soft
#         error)

# cyrus deliver uses the /usr/include/sysexits.h codes:
#
# define EX_USAGE       64   /* command line usage error */
# define EX_DATAERR     65   /* data format error */
# define EX_NOINPUT     66   /* cannot open input */
# define EX_NOUSER      67   /* addressee unknown */
# define EX_NOHOST      68   /* host name unknown */
# define EX_UNAVAILABLE 69   /* service unavailable */
# define EX_SOFTWARE    70   /* internal software error */
# define EX_OSERR       71   /* system error (e.g., can't fork) */
# define EX_OSFILE      72   /* critical OS file missing */ 
# define EX_CANTCREAT   73   /* can't create (user) output file */ 
# define EX_IOERR       74   /* input/output error */ 
# define EX_TEMPFAIL    75   /* temp failure; user is invited to retry */ 
# define EX_PROTOCOL    76   /* remote error in protocol */ 
# define EX_NOPERM      77   /* permission denied */ 
# define EX_CONFIG      78   /* configuration error */
------------------------------------------------------------

----------------------------------------------------------------------
Dave Walton                                                           
Tech Support                            Nordic Entertainment Worldwide
techsupport@nordicdms.com                     http://www.nordicdms.com
----------------------------------------------------------------------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



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