Author Topic: Can't get my message in RC ?  (Read 5617 times)

Offline ChPortos

  • Newbie
  • *
  • Posts: 8
Can't get my message in RC ?
« on: January 10, 2007, 04:28:40 AM »
Hi everybody !

I've got an issue when I try to use any webmail client (I tried SquirrelMail and RoundCube so far) : I can't get my message in my Inbox !
Actually, what I can do :
 - send messages through SMTP (and they are well received)
 - read my message directly on the server (with the command "mail" I can read them)
 - login RoundCube and use the database

So, why RoundCube (or SquirrelMail) can't recover my messages if they are well received on the server ?

I installed courrier-imap and configured it.

Please help !

Regards,
Ch'Portos.

Offline NaiosKae

  • Jr. Member
  • **
  • Posts: 40
Re: Can't get my message in RC ?
« Reply #1 on: January 11, 2007, 04:31:22 AM »
Hi,

Wich smtp server are you using (it is your smtp server that manage mail delivery) ?

by default postfix and exim deliver mail in /var/spool/mail/user at mbox format

If you are in this case, try to change smtp server either to deliver in $home/Maildir at maildir format or to use procmail

in case using procmail editing the $home/.procmailrc file like following will make new mails available to your webmail (and of course you can add rules to filter and order your mails directly at delivery), don't forget to run "maildirmake $home/Maildir"

# .procmailrc
# routes incoming mail to appropriate mailboxes
PATH=/usr/bin:/usr/local/bin
MAILDIR=$HOME/Maildir  # all mailboxes are in .mailspool/
DEFAULT=$HOME/Maildir/new
LOGFILE=$HOME/log/logmail
SHELL=/bin/sh

if you want to get you current mails available on imap server use mb2md tool (which will convert your mbox to an imap spool) "mb2md -s /var/mail/user"

Offline spwbot

  • Jr. Member
  • **
  • Posts: 13
Re: Can't get my message in RC ?
« Reply #2 on: January 11, 2007, 08:12:16 AM »
That is because your inbox is not in the correct path, like NaiosKae said. PRocmail is a good idea to bypass the problem, but... try to use Dovecot, is a very nice and secure imap server. Easy to setup.


Offline ChPortos

  • Newbie
  • *
  • Posts: 8
Re: Can't get my message in RC ?
« Reply #3 on: January 16, 2007, 04:16:06 AM »
Actually, it seems that my received messages are not stored in the correct place.
If I look into /var/mail/user I can find all my messages, whereas they should be in /home/user/Maildir/ (as configured in courier-imap) where RoundCube looks

I don't know where I shoul change something :
- /etc/postfix/main.cf ?
- /etc/courier/imapd ?
- somewhere else ?
to have my messages delivred into /home/user/Maildir/ instead of /var/mail/user

Thanks for your help

Regards,
Ch'Portos.

Offline ChPortos

  • Newbie
  • *
  • Posts: 8
Re: Can't get my message in RC ?
« Reply #4 on: January 16, 2007, 04:18:05 AM »
I forgot to say that when I do mb2md -s /var/mail/user I retrieve all my messages, but I would have to do that every time !

Regards,
Ch'Portos.

Offline jpingle

  • Jr. Member
  • **
  • Posts: 77
Re: Can't get my message in RC ?
« Reply #5 on: January 16, 2007, 09:45:48 AM »
That part of mail delivery is still a function of the MTA, in your case postfix. There is a setting in postfix' main.cf that you need to change:

Code: [Select]
# DELIVERY TO MAILBOX
#
# The home_mailbox parameter specifies the optional pathname of a
# mailbox file relative to a user's home directory. The default
# mailbox file is /var/spool/mail/user or /var/mail/user. Specify
# "Maildir/" for qmail-style delivery (the / is required).
#
home_mailbox = Mailbox

You need to change that to:
Code: [Select]
home_mailbox = Maildir/

Offline ChPortos

  • Newbie
  • *
  • Posts: 8
Re: Can't get my message in RC ?
« Reply #6 on: January 16, 2007, 10:53:16 AM »
My home_mailbox line was already set to Maildir/ (with the "/" as written in the help above)

When I try to send an e-mail to user@domain.xxx, when I log on console mode on the server, I can read the message You have new mail in /var/mail/user. Shouldn't it be in /home/user/Maildir/ ?

Regards,
Ch'Portos.

Offline jpingle

  • Jr. Member
  • **
  • Posts: 77
Re: Can't get my message in RC ?
« Reply #7 on: January 16, 2007, 02:00:16 PM »
Did you restart postfix after making that change?

If you have that set, and mail is still being delivered to /var/mail/user, then postfix is probably not the program receiving mail. Perhaps you also have sendmail running and did not shut that off before activating postfix?

Offline ChPortos

  • Newbie
  • *
  • Posts: 8
Re: Can't get my message in RC ?
« Reply #8 on: January 17, 2007, 08:14:08 AM »
Thanks jpingle for your idea, but it don't seem that sendmail is installed nor running (I tried /etc/init.d/sendmail stop, but sendmail doesn't exist)

Anyone have another ideaa ?

Ch'Portos.

Offline ChPortos

  • Newbie
  • *
  • Posts: 8
[Almost Solved] Re: Can't get my message in RC ?
« Reply #9 on: January 17, 2007, 08:49:58 AM »
I think I found what was wrong : Procmail was'nt configured ...

I simply created a file called .procmailrc in each user's homedir in which I put
Code: [Select]
SHELL=/bin/bash
MAILDIR=$HOME/Maildir/
DEFAULT=$MAILDIR
ORGMAIL=$MAILDIR
LOCKFILE=$HOME/lockfile.lock
ASSASSINLOCK=$HOME/assassin.lock
DEFAULT=$HOME/Maildir/
JUNKMAIL=$HOME/Maildir/.junkmail/
TRASH=$HOME/Maildir/.Trash
NEWBIE=$HOME/Maildir/.LinuxNewbie/
EXPERT=$HOME/Maildir/.LinuxExpert/
VIRUS=$HOME/Maildir/.virus/
BITBUCKET=/dev/null
LOGFILE=/var/log/procmailrc.log
VERBOSE=yes
LOGABSTRACT=al
and it's ok, mail are well put in /home/user/Maildir instead of /var/mail/user.

Is it a good solution or only a temporary one ?

Ch'Portos.

Offline jpingle

  • Jr. Member
  • **
  • Posts: 77
Re: Can't get my message in RC ?
« Reply #10 on: January 17, 2007, 09:21:00 AM »
That may work, as long as you know to do that for each new user as well. Depending on your setup this can likely be automated via a file in a skel directory, or done via a global procmail config file.

Postfix was probably handing the mail off to procmail instead of delivering it directly, so if you disable procmail in your postfix config, it may also work that way. (Comment out the mailbox_command setting in main.cf) You do not necessarily need procmail, unless you have a specific task that requires it. It can be handy, but it's not required.