?
Solved

Setup cyrus-imapd POP3 server

Posted on 2004-11-14
25
Medium Priority
?
858 Views
Last Modified: 2008-01-09
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)
0
Comment
Question by:x_terminat_or_3
  • 16
  • 9
25 Comments
 
LVL 38

Accepted Solution

by:
wesly_chen earned 2000 total points
ID: 12579054
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12579122
Thanks Wesly, this is gonna take some time. . . . .
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12579529
Yeah but it doesn't say how to add/configure users
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12579608
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
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 2000 total points
ID: 12580875
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12581552
Let's say I want to go for LDAP.   Then wat?  How do I set up the users/pass data?




Ramses
0
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 2000 total points
ID: 12586238
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12586318
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12588133
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12588211
Hi,

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

Wesly
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12588246
I don't have an /etc/imad.conf file but I have a

/etc/xinetd.conf which contains

sasl_passwd_check: plaintext
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12588314
Can you change to
sasl_passwd_check: shadow

Wesly
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12588600
Did that, restarted Cyrus service, tried again, no GO

tried also with sasl_passwd_check: sasl_authd  no change
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12588635
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
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 2000 total points
ID: 12591058
> 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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12597788
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
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12597954
> 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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12598445
It doesn't, it looks at the @myserver
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12598540
Hasn't anybody been able to setup Cyrus POP3 server with shadow passwords on their system who can provide assistance....


0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12598575
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12598596
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12605624
What services need to be running for the authentification to work?  Isn't there any documentation on the sasl authorization method?
0
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12637955
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
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 2000 total points
ID: 12660108
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
 
LVL 2

Author Comment

by:x_terminat_or_3
ID: 12660180
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month17 days, 5 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question