Setup cyrus-imapd POP3 server

I would like to know how to setup the cyrus-imapd POP3 server

Links to documentation are welcome for future reference, but please explain the setup in short here.



With kind regards


Ramses (x_terminat_or_3)
LVL 2
x_terminat_or_3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wesly_chenCommented:
Hi,

    Download the cryus-imapd from your Linux distrubutor including the following packages:
cyrus-imapd
cyrus-imapd-devel
cryus-imapd-utils

    Or you can download the tarball from:
ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-2.2.8.tar.gz

   The "Cyrus IMAP HOWTO" is very clear and simple:
http://en.tldp.org/HOWTO/Cyrus-IMAP.html

   Basically, you need to do
1. Decide the authenticatiion methods: SASLdb, LDAP, PAM, or Kerberos.
2. Create a "cyrus" user: # useradd -g mail cryus
3. Edit /etc/syslog.conf, /etc/imapd.conf, /etc/services, /etc/inetd.conf , and /etc/sendmail.mc to do some modification.
4. Create several directories or files and apply the appropriate ownership and permission:
   # mkdir /var/adm /var/imap /var/spool/imap /var/imap/srvtab
   # touch /var/adm/imapd.log /var/adm/auth.log
   # chown cyrus:mail /var/imap /var/spool/imap /var/imap/srvtab
   # chmod 750 /var/imap /var/spool/imap /var/imap/srvtab
   # su cyrus
   # tools/mkimap
   # cd /var/imap
   # chattr +S . user quota user/* quota/*
   # chattr +S /var/spool/imap

Regards,

Wesly
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
x_terminat_or_3Author Commented:
Thanks Wesly, this is gonna take some time. . . . .
0
x_terminat_or_3Author Commented:
Yeah but it doesn't say how to add/configure users
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

x_terminat_or_3Author Commented:
What I have now is this:

telnet www.vlaamse-kern.com 110
Trying 81.220.168.250...
Connected to www.vlaamse-kern.com (81.220.168.250).
Escape character is '^]'.
+OK vlaamse-kern.com Cyrus POP3 v2.2.6-Invoca-RPM-2.2.6-2.FC3.5 server ready <2724653820.1100463248@vlaamse-kern.com>
user test
+OK Name is a valid mailbox
pass test
-ERR [AUTH] Invalid login
quit
+OK
Connection closed by foreign host.

I didn't setup the user test, but it says 'Name is a valid mailbox' anyway.  And when I try to use one of my unix accounts it doesn't accept the password either
0
wesly_chenCommented:
Hi,

   That's the authentication issue which you choose to to use at step one. You need to make sure the way you
use is working.

   In the /etc/imapd.conf, there is a entry:
-----
sasl_passwd_check: shadow    <==== use shadow password,

If you use LDAP, then
-----
sasl_passwd_check: ldap

Wesly
0
x_terminat_or_3Author Commented:
Let's say I want to go for LDAP.   Then wat?  How do I set up the users/pass data?




Ramses
0
wesly_chenCommented:
Hi,

   LDAP? It might be out of your IMAP topic.
   Besides, to setup LDAP can not be described in one page (at leat for me).

   You might want to check:
http://www.openldap.org/doc/admin22/quickstart.html
or
http://www.openldap.org/doc/admin22/

Regards,

Wesly
0
x_terminat_or_3Author Commented:
You know what the problem was?  I decided to go for PLAINTEXT (like almost all ISPs I know) but The deamon saslauthd wasn't running...

Now I get this:

[xxx@yyyyy ~]$ telnet www.vlaamse-kern.com 110
Trying 81.220.168.250...
Connected to www.vlaamse-kern.com (81.220.168.250).
Escape character is '^]'.
+OK vlaamse-kern.com Cyrus POP3 v2.2.6-Invoca-RPM-2.2.6-2.FC3.5 server ready <2475569596.1100542923@vlaamse-kern.com>
user boe
+OK Name is a valid mailbox
pass <mypass>
-ERR [SYS/PERM] Unable to locate maildrop


Any ideas on this?  Also how to setup the accounts?
0
x_terminat_or_3Author Commented:
I folowed step by step what they say on the HOWTO but it fails here:

bash-3.00$ imtest -m login -p imap localhost
S: * OK vlaamse-kern.com Cyrus IMAP4 v2.2.6-Invoca-RPM-2.2.6-2.FC3.5 server ready
C: C01 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ MAILBOX-REFERRALS NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE IDLE STARTTLS LISTEXT LIST-SUBSCRIBED X-NETSCAPE
S: C01 OK Completed
Please enter your password:
C: L01 LOGIN cyrus {11}
S: + go ahead
C: <omitted>
S: L01 NO Login failed: user not found
Authentication failed. generic failure
Security strength factor: 0
C: Q01 LOGOUT
Connection closed.
0
wesly_chenCommented:
Hi,

   In the /etc/imapd.conf, there is a entry:
-----
sasl_passwd_check: < >   <==== what's your setting here?

Wesly
0
x_terminat_or_3Author Commented:
I don't have an /etc/imad.conf file but I have a

/etc/xinetd.conf which contains

sasl_passwd_check: plaintext
0
wesly_chenCommented:
Can you change to
sasl_passwd_check: shadow

Wesly
0
x_terminat_or_3Author Commented:
Did that, restarted Cyrus service, tried again, no GO

tried also with sasl_passwd_check: sasl_authd  no change
0
x_terminat_or_3Author Commented:
I saw this in my system log:

Nov 15 23:11:01 ramses su(pam_unix)[10771]: session opened for user cyrus by andy(uid=0)
Nov 15 23:11:04 ramses imap[10569]: unable to open Berkeley db /etc/sasldb2: No such file or directory
Nov 15 23:11:04 ramses imap[10569]: unable to open Berkeley db /etc/sasldb2: No such file or directory
0
wesly_chenCommented:
> unable to open Berkeley db /etc/sasldb2
You need to create /etc/sasldb2 before you use asaldb. Please use "saslpasswd2" utility to create users.
man  saslpasswd2
for more details.
Besides,  make sure Cyrus can read "/etc/sasldb2":
# chown cyrus /etc/sasldb2*

Some more cryus-imap links:
http://asg.web.cmu.edu/cyrus/download/imapd/install.html
http://asg.web.cmu.edu/cyrus/imapd/install-FAQ.html
http://asg.web.cmu.edu/cyrus/download/imapd/faq.html

Wesly
0
x_terminat_or_3Author Commented:
I keep getting the errors:


If I run SASLPASSWD cyrus  and look @ the log:

Nov 16 21:21:11 ramses saslpasswd: PLAIN: set secret for cyrus
Nov 16 21:21:11 ramses saslpasswd: CRAM-MD5: set secret for cyrus
Nov 16 21:21:11 ramses saslpasswd: DIGEST-MD5: set secret for cyrus

Then If I try SASLPASSWD2 cyrus :

Nov 16 21:22:09 ramses saslpasswd2: setpass succeeded for cyrus
Nov 16 21:22:09 ramses saslpasswd2: error deleting entry from sasldb: DB_NOTFOUND: No matching key/data pair found
Nov 16 21:22:09 ramses last message repeated 2 times

Nov 16 21:22:46 ramses imap[31384]: badlogin: localhost.localdomain [81.220.168.250] plaintext cyrus SASL(-13): user not found: checkpass failed


You know the instructions on the asg.web.cmu.edu assume that one can login right away and don't give instructions for when it fails...
0
wesly_chenCommented:
> the instructions on the asg.web.cmu.edu assume that one can login right away and don't give instructions for when it fails
You are right. The login is for SMTP software, sendmail or whatever. IMAP or POP3 just on top of SMTP.
So how does your SMTP softwares to authenticate the username/password?

Wesly
0
x_terminat_or_3Author Commented:
It doesn't, it looks at the @myserver
0
x_terminat_or_3Author Commented:
Hasn't anybody been able to setup Cyrus POP3 server with shadow passwords on their system who can provide assistance....


0
wesly_chenCommented:
Hi,

   What's your Linux? Fedora/RedHat or SuSE?
   What's your SMTP software? Sendmail, Qmail or Postfix?

   I used snedmail on RedHat which come with imapd and pop3d in /usr/sbin so after I setup sendmail, turn on the imapd and
pop3d, everything worked for me.

Wesly
   
0
x_terminat_or_3Author Commented:
I have Fedora Test 3

latest sendmail
latest cyrus-imapd

From what I see, the problem isn't realy Cyrus because it's running, but it's somewhere the auth process that's going wrong
0
x_terminat_or_3Author Commented:
What services need to be running for the authentification to work?  Isn't there any documentation on the sasl authorization method?
0
x_terminat_or_3Author Commented:
I managed to get it up and running after a fresh system installation....  there are however two remaining issues

1. how do I map emails to usernames.  for instance, I created a usr myuser1  in cyrus, and set the password.  Now I would like that all mails send to myuser1@mydomain.com are deliver in the box of myuser1


2. part of the cyrus configuration sais to update the sendmail.cf with the following:

MAILER(local)
  MAILER(cyrus)
  define(`confLOCAL_MAILER',`cyrus')
  LOCAL_RULE_0
  R$=N                   $: $#local $: $1
  R$=N < @ $=w . >       $: $#local $: $1
  Rbb + $+ < @ $=w . >   $#cyrusbb $: $1



After restart I get the following error:

Nov 21 12:58:08 ramses sendmail[3158]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1002: unknown configuration line "\001S=N < @ \001=w . >\t\001: \001#local \001: \0011"
Nov 21 12:58:08 ramses sendmail[3162]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1002: unknown configuration line "\001S=N < @ \001=w . >\t\001: \001#local \001: \0011"

0
wesly_chenCommented:
Hi,

   I've installed Fedora Core 3 recently and I found "saslauthd" is not running by default.
You might want to check it first if you want to use saslauthd.
# chkconfig --list | grep sasl
# service saslauthd start <=== start the saslauthd
# chkconfig --level 2345 saslauthd on  <===enable it at boot up.

Wesly
0
x_terminat_or_3Author Commented:
OK I already noticed that it wasn't running on level 5 and had already turned it on.  Now I added it to levels 2,3,4 as sugested .

Still two issues to address:

1/  I need extended documentation on account administration.
2/ http://en.tldp.org/HOWTO/Cyrus-IMAP-7.html#ss7.1 says:
"Edit /etc/sendmail.mc with care not to add extra spaces and add the following lines(do not copy and paste directly from this text as the tabs won't be added correctly):

  LOCAL_RULE_0
  R$=N                   $: $#local $: $1
  R$=N < @ $=w . >       $: $#local $: $1
  Rbb + $+ < @ $=w . >   $#cyrusbb $: $1 "  (end quote)

But doing this produces an error in my log!

Nov 21 12:58:08 ramses sendmail[3158]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1002: unknown configuration line "\001S=N < @ \001=w . >\t\001: \001#local \001: \0011"
Nov 21 12:58:08 ramses sendmail[3162]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1002: unknown configuration line "\001S=N < @ \001=w . >\t\001: \001#local \001: \0011"


What does these things mean and do I need them and if so how do I fixed those errors?


With kind regards



0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.