You are not logged in.

#1 2007-10-14 08:33:09

rcorder
Member
Registered: 2007-09-07
Posts: 17

Cyrus IMAP server

20071014 -- Updated and patched with University of Athen's mailbox autocreate feature.

I have uploaded a PKGBUILD to AUR for the Cyrus Project's IMAP Server.

I have used it for years...tried others, but I always come back to Cyrus.   I was surprised when I switched over to Arch Linux a couple of months ago to find it strangely missing, yet dovecot was in there.

So, here it is.  Have at it please.  I've tried to make it as complete as possible, but may have missed something.

http://aur.archlinux.org/packages.php?d … s=0&SeB=nd

thanks.
ryanc

Last edited by rcorder (2007-10-15 06:21:24)

Offline

#2 2007-10-14 15:13:18

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Cyrus IMAP server

hello,

great! when i switched to arch some months ago i also tried to install cyrus, but it didn't want to compile. now i've tried your pkgbuild and directly worked. i'm using dovecot now, but i'm considering switching back to cyrus (when i have more time). cyrus makes things easier.
thanks,
vlad

Offline

#3 2007-10-14 20:06:12

rcorder
Member
Registered: 2007-09-07
Posts: 17

Re: Cyrus IMAP server

I too initially had difficulty getting Cyrus to compile.  the problem stemmed from the Berkeley DB.  Cyrus *highly* recommends that you compile imapd against the same version of db that cyrus sasl is compile against.  libsasl (in extra) is compiled against db4, imapd will not compile against db4.

this problem was isolated to the stable (2.2) branch.  note that my PKGBUILD is for the 2.3 branch, but in my use has been plenty stable.

I hope it works well for you.

Offline

#4 2007-11-02 17:17:24

ivanich
Member
From: Odessa
Registered: 2007-11-02
Posts: 9

Re: Cyrus IMAP server

I have a strange problem with the cyrus-imapd, when i tried starting it i got:
Nov  2 19:12:07 ivanich master[22525]: retrying with 1024 (current max)
Nov  2 19:12:09 ivanich master[22549]: setrlimit: Unable to set file descriptors limit to -1
: Operation not permitted
and can't telneting to it:
telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.
If cyrus is running i cant start posfix, if postfix running it die when cyrus is start.

Offline

#5 2007-11-02 18:06:39

rcorder
Member
Registered: 2007-09-07
Posts: 17

Re: Cyrus IMAP server

ivanich wrote:

Nov  2 19:12:07 ivanich master[22525]: retrying with 1024 (current max)
Nov  2 19:12:09 ivanich master[22549]: setrlimit: Unable to set file descriptors limit to -1: Operation not permitted

I get this too.  It's not an error, just Cyrus wanting more than 1024 file descriptors

ivanich wrote:

and can't telneting to it:
telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.

well, you are connecting, Cyrus is just disconnecting you.  do you have proper entries in your hosts.allow file?

ivanich wrote:

If cyrus is running i cant start posfix, if postfix running it die when cyrus is start.

this is a very vague statement and without further information, I can't presume how they are releated.

Offline

#6 2007-11-03 17:04:46

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Cyrus IMAP server

First, sorry, i can only speak for my server which runs under opensuse and i hope the most is guilty for arch too.

ivanich wrote:

Nov  2 19:12:07 ivanich master[22525]: retrying with 1024 (current max)
Nov  2 19:12:09 ivanich master[22549]: setrlimit: Unable to set file descriptors limit to -1 : Operation not permitted

You can set temporally the "file size" for the user cyrus in /etc/security/limits.conf to unlimited. But i'm a little bit surprised that you need this. Perhaps it could be better to reduce some options in the cyrus.conf. At example i deactivated all what i don't need in the Section SERVICES and changed imap from 'prefork=0' to 'prefork=5'.

ivanich wrote:

If cyrus is running i cant start posfix, if postfix running it die when cyrus is start.

Postfix shouldn't die and so check your logfiles to find the answer because there be different ways to run them together. You even have to start them in a certain order:
- start cyrus
- start postfix
- stop postfix
- stop cyrus

Offline

#7 2007-11-03 18:55:47

ivanich
Member
From: Odessa
Registered: 2007-11-02
Posts: 9

Re: Cyrus IMAP server

That's all i have in logs about postfix after starting cyrus:
Nov  2 18:38:40 ivanich master[4435]: process 4438 exited, status 0
Nov  2 18:38:42 ivanich postfix/postfix-script[4453]: fatal: the Postfix m
ail system is not running
Nov  2 18:38:43 ivanich postfix/postfix-script[4474]: fatal: the Postfix m
ail system is not running
Nov  2 18:38:43 ivanich postfix/postfix-script[4495]: fatal: the Postfix m
ail system is not running
Nov  2 18:38:45 ivanich master[4435]: exiting on SIGTERM/SIGINT

Offline

#8 2007-11-04 07:44:20

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Cyrus IMAP server

ivanich wrote:

That's all i have in logs about postfix after starting cyrus:

Sorry, i have no idea but as i said you have to start cyrus and than postfix. Have you look in the web at example http://www.postfix.org/docs.html or google for it? The most links what i know be in german so they don't help you.
My configuration is postfix -> procmail -> cyrus and the relevant lines be:
main.cf:

mailbox_command = /usr/bin/procmail -a "$EXTENSION"
mailbox_transport = procmail

master.cf (real it be 2 lines not 3 lines):

procmail  unix  -       n       n       -       -       pipe
  flags=R user=cyrus argv=/usr/bin/procmail -t -m USER=${user} EXT=${extension} /etc/procmailrc

Minimal procmailrc:

LOGFILE=/var/log/procmail
VERBOSE=off
LOGABSTRACT=all
DELIVERMAIL = "/usr/lib/cyrus/bin/deliver"
IMAP = "$DELIVERMAIL -e -a $USER -m user.$USER"
# Last Rule
:0
| $IMAP

My only hint is to get a minimal configuration, make cyrus and postfix so verbose as possible for the logfiles, start cyrus and create the mailbox for one existing user, start postfix and send yourself an email from outside (gmx acount at example).

Offline

#9 2007-11-05 15:02:47

ivanich
Member
From: Odessa
Registered: 2007-11-02
Posts: 9

Re: Cyrus IMAP server

Config files i get from my other system, with these configs in gentoo all works fine.
main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
smtpd_banner = $myhostname ESMTP service ready (Fuck off spammers!!!)
mail_owner = postfix
alias_maps = hash:/etc/postfix/aliases 
alias_database = hash:/etc/postfix/aliases
myhostname = ivanich.od.ua
mydomain = ivanich.od.ua
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain


local_recipient_maps = unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks_style = subnet
mynetworks = 127.0.0.0/8, 85.238.100.22
relay_domains = $mydestination
#НА ЭТУ СТРОЧКУ ОБРАТИТЕ ВНИМАНИЕ!!! 
mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
smtpd_sasl_type = cyrus
#smtpd_sasl_type = dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
#smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = 
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client bl.spamcop.net, reject_rbl_client list.dsbl.org,reject_rbl_client cbl.abuseat.org, permit
smtpd_helo_restrictions = permit_mynetworks
#, reject_invalid_hostname
#new stuff
disable_vrfy_command = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes

smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_sender_domain, reject_unverified_sender, permit

smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_pipelining, permit_sasl_authenticated, reject_unauth_destination, permit
smtpd_data_restrictions = reject_unauth_pipelining

#TLS
smtpd_use_tls=yes
#smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/postfix/newreq.pem
#smtpd_tls_cert_file = /etc/postfix/ivanich.od.ua.crt 
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 5
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
debug_peer_level = 5

debug_peer_list = 127.0.0.1

imapd.conf

configdirectory:    /var/imap
partition-default:    /var/spool/imap
sievedir:        /var/imap/sieve
tls_ca_path:            /etc/ssl/certs
tls_cert_file:        /etc/ssl/cyrus/server.pem
tls_key_file:        /etc/ssl/cyrus/server.pem
# Don't use an everyday user as admin.
admins:            cyrus
#hashimapspool:        yes
allowanonymouslogin:    no
allowplaintext:        yes
sasl_pwcheck_method:    auxprop
sasldb_path: /etc/sasldb2
sasl_mech_list: LOGIN PLAIN
pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN LOGIN

Interesting thing, if i start postfix first it works but when i tried start cyrus it not starting. But when i starting it directly e.g. /usr/bin/postfix start & /usr/cyrus/master they working together normal. Sorry for my poor english.:(

Offline

#10 2007-11-05 17:00:34

rcorder
Member
Registered: 2007-09-07
Posts: 17

Re: Cyrus IMAP server

ivanich wrote:

Config files i get from my other system, with these configs in gentoo all works fine.

main.cf

mailbox_transport = lmtp:unix:/var/imap/socket/lmtp

why not use 'mailbox_transport = cyrus' ?

I would take atilla's advice and head over to http://www.postfix.org/docs.html

ivanich wrote:

Interesting thing, if i start postfix first it works but when i tried start cyrus it not starting. But when i starting it directly e.g. /usr/bin/postfix start & /usr/cyrus/master they working together normal. Sorry for my poor english.:(

seems to be a conflict with the init scripts between postfix and cyrus, not your configuration.  I'll take a look at mine (cyrus-imapd) tonight and post a relevant patch to AUR if necessary.

Offline

#11 2007-11-05 17:07:51

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Cyrus IMAP server

ivanich wrote:

Sorry for my poor english.:(

No Sir, english is not my natural language too so it will be even good enough for me.:)

ivanich wrote:

main.cf

The only difference between us two seems only the mailbox_transport. If you don't filter with sieve than you can give procmail a try. Do you have a active line for lmtpunix in /etc/cyrus.conf? Here is my imapd.conf:

# Opensuse 10.1 (Mostly Defaults)
admins: cyrus root
allowanonymouslogin: no
autocreatequota: 10000
configdirectory: /var/lib/imap
drachost: localhost
dracinterval: 0
lmtp_downcase_rcpt: yes
lmtp_overquota_perm_failure: no
partition-default: /var/spool/imap
poptimeout: 10
quotawarn: 90
reject8bit: no
sasl_pwcheck_method: saslauthd
sievedir: /var/lib/sieve
timeout: 30
# My little things
allowplaintext: yes
altnamespace: yes
lmtpsocket: /var/lib/imap/socket/lmtp
sasl_mech_list: plain login
sasl_security_options: noanonymous

From where does the other lines come? /etc/sasl2/smtpd.conf or /usr/lib/sasl2/smtpd.conf?

ivanich wrote:

Interesting thing, if i start postfix first it works but when i tried start cyrus it not starting. But when i starting it directly e.g. /usr/bin/postfix start & /usr/cyrus/master they working together normal.

Sorry, but did you start for one test first cyrus and second postfix? I still think that this is the only order where it should works. It could be even a good idea to ask rcorder for his configuration.:)

Offline

#12 2007-11-05 17:09:12

ivanich
Member
From: Odessa
Registered: 2007-11-02
Posts: 9

Re: Cyrus IMAP server

seems to be a conflict with the init scripts between postfix and cyrus, not your configuration.  I'll take a look at mine (cyrus-imapd) tonight and post a relevant patch to AUR if necessary.

It would be great, waiting for your patch. Thanks

Offline

#13 2007-11-05 17:21:20

ivanich
Member
From: Odessa
Registered: 2007-11-02
Posts: 9

Re: Cyrus IMAP server

pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN LOGIN
This lines from /etc/saslauthd.conf
I started cyrus and postfix in all possible order :-)

Offline

#14 2007-11-05 17:45:54

attila
Member
Registered: 2006-11-14
Posts: 293

Re: Cyrus IMAP server

ivanich wrote:

This lines from /etc/saslauthd.conf

Oh, i have no such file on my server. There is only smtpd.conf a two locations (/etc/sasl2 and /usr/lib/sasl2) with this lines:

pwcheck_method: saslauthd
mech_list: plain login
ivanich wrote:

I started cyrus and postfix in all possible order :-)

Okay, i will be quit smile I think we can stop it for now and wait until rcorder will end his tests.

Offline

#15 2007-11-08 06:23:07

rcorder
Member
Registered: 2007-09-07
Posts: 17

Re: Cyrus IMAP server

ivanich wrote:

It would be great, waiting for your patch. Thanks

new version up, 2.3.9-3 -- http://aur.archlinux.org/packages.php?d … 1&ID=13305

I have also submitted a bug report for Postfix.  Most, if not all scripts in rc.d in Arch use /bin/pidof to determine if the daemon is already running.  Contrary to the claim in the pidof(8) man page that states that specifying a full path should allow /bin/pidof to distinguish between multiple processes with the same name, it appears that it can't handle it.  Because both Postfix and Cyrus IMAP daemons are called 'master', this caused the daemon started second to fail.

So, my new version uses /usr/bin/pgrep instead of /bin/pidof.  My bug report suggestes that the maintainer(s) of Postfix do the same.

http://bugs.archlinux.org/task/8565

Until Postfix is changed or I am advised to another method that will not impact Postfix, make sure you start Cyrus AFTER Postfix.

Offline

Board footer

Powered by FluxBB