Discussion:
CentOS 6, cyrus-imapd 2.3.16-15.el6, postfix 2.6.6-8.el6, procmail 3.22-25.1.el6_5.1, squirrelmail 1.4.22-5.el6
Robert Heller
2018-06-21 13:58:15 UTC
Permalink
I am having trouble getting this all to work properly together.

I have a CentOS 6 server, that is mostly a webserver and one main E-Mail
account (mine), plus a couple of E-Mail accounts that use procmail to do spam
filtering and then forward thing along. I also run Mailman for some mailling
lists. Everything is working, except cyrus-imapd. I have postfix set up to
use procmail to deliver mail to me, through the filter and forward accounts
and to Mailman. I would like to add a *few* webbased e-mail accounts using
Squirrelmail and (local for now) imapd. But I cannot figure out how to either
get cyrus-imapd to either access the local mail spool (/var/spool/mail) or to
get procmail to deliver to imap spool (/var/spool/imap). The postfix config
says that you can only use mailbox_command or mailbox_transport, but not both.
I want to use procmail + /var/spool/mail for some E-Mail accounts and (I
guess) deliver + /var/spool/imap for others.

Additionally, there appears to be some "permission" problem with the imapd
mailboxes. When I forcably use deliver to try to deliver mail (manually
calling the deliver program, it says the mailboxes don't exist. cyradm says
they do, but cannot reconstruct them or make sub mailboxes (permission
denied). Very strange. What am I missing?

Here is a listing of the permissions in /var/spool/imap:

/var/spool/imap:
total 8
drwxr-x--- 3 cyrus mail 4096 May 12 2016 h
drwxr-x--- 3 cyrus mail 4096 Jun 14 18:24 m

/var/spool/imap/h:
total 4
drwxr-x--- 3 cyrus mail 4096 May 12 2016 user

/var/spool/imap/h/user:
total 4
drwxr-x--- 2 cyrus mail 4096 Jun 14 17:44 heller

/var/spool/imap/h/user/heller:
total 12
-rw-r-x--- 1 cyrus mail 4 Jun 14 17:44 cyrus.cache
-rw-r-x--- 1 cyrus mail 167 May 12 2016 cyrus.header
-rw-r-x--- 1 cyrus mail 96 Jun 14 17:44 cyrus.index

/var/spool/imap/m:
total 4
drwxr-x--- 3 cyrus mail 4096 Jun 14 18:24 user

/var/spool/imap/m/user:
total 4
drwxr-x--- 2 cyrus mail 4096 Jun 17 09:09 mickymouse

/var/spool/imap/m/user/mickymouse:
total 12
-rw-r-x--- 1 cyrus mail 4 Jun 17 08:34 cyrus.cache
-rw-r-x--- 1 cyrus mail 175 Jun 14 18:24 cyrus.header
-rw-r-x--- 1 cyrus mail 96 Jun 17 08:34 cyrus.index
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
Adam Tauno Williams
2018-06-21 20:10:46 UTC
Permalink
Squirrelmail and (local for now) imapd.  But I cannot figure out how
to either get cyrus-imapd to either access the local mail spool
(/var/spool/mail)
You can't. Cyrus virtuously replaces /var/spool/mail. Postfix
delivers mail into Cyrus, which stores it - and the **ONLY** way mail
is accessed is via Cyrus (IMAP, POP, JMAP).

You should configure Postfix to deliver to Cyrus via LMTP (local mail
transport protocol).

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

[***@aleph ~]# fuser -u /var/lib/imap/socket/lmtp
/var/lib/imap/socket/lmtp:  4611(cyrus) 23327(cyrus)
mailboxes.  When I forcably use deliver to try to deliver mail
(manually  calling the deliver program, it says the mailboxes don't
exist.  cyradm says  they do, but cannot reconstruct them or make sub
mailboxes (permission denied).  Very strange.  What am I missing?
I haven't used deliver in decades. Using LMTP avoids all the hazards
of old-school 'file processing'
Albert Shih
2018-06-21 20:35:45 UTC
Permalink
Le 21/06/2018 à 13:28:38-0400, Robert Heller a écrit

Sorry when I answer you I forget to put the mailing list on CC, Maybe they
are other answers...

So I add info-***@lists.andrew.cmu.edu on cc for this answer. Hope you
don't mind.
Le 21/06/2018 à 09:58:15-0400, Robert Heller a écrit
Post by Robert Heller
I am having trouble getting this all to work properly together.
I have a CentOS 6 server, that is mostly a webserver and one main E-Mail
account (mine), plus a couple of E-Mail accounts that use procmail to do spam
filtering and then forward thing along. I also run Mailman for some mailling
lists. Everything is working, except cyrus-imapd. I have postfix set up to
use procmail to deliver mail to me, through the filter and forward accounts
and to Mailman. I would like to add a *few* webbased e-mail accounts using
Squirrelmail and (local for now) imapd. But I cannot figure out how to either
get cyrus-imapd to either access the local mail spool (/var/spool/mail) or to
get procmail to deliver to imap spool (/var/spool/imap). The postfix config
I'm pretty sure you cannot do that.
Post by Robert Heller
says that you can only use mailbox_command or mailbox_transport, but not both.
I want to use procmail + /var/spool/mail for some E-Mail accounts and (I
guess) deliver + /var/spool/imap for others.
I'm not sure that's a good idea to use postfix + procmail + cyrus.
I thinking of what you asking, well, maybe you can do that (event I find
that a little strange inside the procmailrc:

SHELL="/bin/bash"
SENDMAIL="/usr/sbin/sendmail -oi -t"
LOGFILE="/var/log/procmail.log"
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"
DELIVER="/usr/local/cyrus/deliver -d $LOGNAME"

# If it's for me
:0
* To: poweruser@\.*
$DEFAULT

# deliver to other user
:0 w
| $DELIVER

I didn't test it (I don't use procmail anymore)
I think that would be much better to use
postfix + sieve + cyrus.
I don't say sieve is better than procmail, just say it's integrated.
If I use sieve instead of procmail, what happens with my existing UNIX Mail
accounts? Does this mean I *have* to use imap to access ALL E-Mail on my
server? I don't want to do that. I use QWK to access my personal mail,
currently delivered to /var/mail/spool via procmail and use procmail recipies
to pre-process it. I need to do this in part because I have dial-up internet
and cannot relaistly use a (so called) "modern" E-Mail client like
Thunderbird, since I don't really have enough bandwidth for that. Part of my
procmail recipies involve stripping off attachments (so I don't have to
download large attachment over a dialup connection) and to strip off HTML
Well as I know you cannot do that with sieve.
(since I don't use [and refuse to use] a HTML capable E-Mail client).
Well, I'm also in the exact situation than you, but I use mutt as main
E-Mail client. It's working very well thought imap (whatever the server
is), and you can also use offlineimap to synchronise a local copy of your
email. So you can use mutt online by connecting to your imap server and you
can also use offlineimap to get a local copy so you can access your email
when you're offline.

And yes mutt work well on very low bandwidth connection.

Regards.
--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
xmpp: ***@obspm.fr
Heure local/Local time:
Thu Jun 21 21:27:11 CEST 2018
Robert Heller
2018-06-21 21:23:31 UTC
Permalink
Le 21/06/2018 à 13:28:38-0400, Robert Heller a écrit
Sorry when I answer you I forget to put the mailing list on CC, Maybe they
are other answers...
don't mind.
At this point I have given up on cyrus-imapd. It just can't do what I want to
do. I replaced it with dovecot, which I probably should have installed in the
first place, if I had known what dovecot was.
Le 21/06/2018 à 09:58:15-0400, Robert Heller a écrit
Post by Robert Heller
I am having trouble getting this all to work properly together.
I have a CentOS 6 server, that is mostly a webserver and one main E-Mail
account (mine), plus a couple of E-Mail accounts that use procmail to do spam
filtering and then forward thing along. I also run Mailman for some mailling
lists. Everything is working, except cyrus-imapd. I have postfix set up to
use procmail to deliver mail to me, through the filter and forward accounts
and to Mailman. I would like to add a *few* webbased e-mail accounts using
Squirrelmail and (local for now) imapd. But I cannot figure out how to either
get cyrus-imapd to either access the local mail spool (/var/spool/mail) or to
get procmail to deliver to imap spool (/var/spool/imap). The postfix config
I'm pretty sure you cannot do that.
Post by Robert Heller
says that you can only use mailbox_command or mailbox_transport, but not both.
I want to use procmail + /var/spool/mail for some E-Mail accounts and (I
guess) deliver + /var/spool/imap for others.
I'm not sure that's a good idea to use postfix + procmail + cyrus.
I thinking of what you asking, well, maybe you can do that (event I find
SHELL="/bin/bash"
SENDMAIL="/usr/sbin/sendmail -oi -t"
LOGFILE="/var/log/procmail.log"
DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir/"
DELIVER="/usr/local/cyrus/deliver -d $LOGNAME"
# If it's for me
:0
$DEFAULT
# deliver to other user
:0 w
| $DELIVER
I didn't test it (I don't use procmail anymore)
I think that would be much better to use
postfix + sieve + cyrus.
I don't say sieve is better than procmail, just say it's integrated.
If I use sieve instead of procmail, what happens with my existing UNIX Mail
accounts? Does this mean I *have* to use imap to access ALL E-Mail on my
server? I don't want to do that. I use QWK to access my personal mail,
currently delivered to /var/mail/spool via procmail and use procmail recipies
to pre-process it. I need to do this in part because I have dial-up internet
and cannot relaistly use a (so called) "modern" E-Mail client like
Thunderbird, since I don't really have enough bandwidth for that. Part of my
procmail recipies involve stripping off attachments (so I don't have to
download large attachment over a dialup connection) and to strip off HTML
Well as I know you cannot do that with sieve.
(since I don't use [and refuse to use] a HTML capable E-Mail client).
Well, I'm also in the exact situation than you, but I use mutt as main
E-Mail client. It's working very well thought imap (whatever the server
is), and you can also use offlineimap to synchronise a local copy of your
email. So you can use mutt online by connecting to your imap server and you
can also use offlineimap to get a local copy so you can access your email
when you're offline.
And yes mutt work well on very low bandwidth connection.
Regards.
--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
Thu Jun 21 21:27:11 CEST 2018
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
Loading...