# postfix / Courier-IMAP .maildir problem

## schpanky

Ok, I am assuming I am overlooking something stupid here... (at least I hope)

I have postfix and Courier-IMAP installed. I can send users mail, and I see it show up in their $HOME/.maildir/new folder.

This is great, but I see no mail when I connect to IMAP, and if I do

```

$ mail

No mail for schpanky

```

....well, you see what happens.

Why is it telling me there is no mail when I can see it in the directory?

Thanks for the help.

~schpanky

----------

## Ateo

To better assist you, post the last handful of text in /var/log/maill. You shouldn't need to post the entire log.

----------

## schpanky

hadn't noticed this before......

 from /var/log/mail:

```

Feb 15 16:12:01 [authdaemond] failed to connect to mysql server (server=mysql.example.com, userid=admin): Unknown MySQL Server Host 'mysql.example.com' (1)

Feb 15 16:12:01 [imapd-ssl] LOGIN FAILED, method=PLAIN, ip=[::ffff:128.237.227.250]

Feb 15 16:12:01 [imapd-ssl] authentication error: Input/output error

```

so I'm guessing I have to do some more config......

I was following this HOW-TO

and was just about to start the Cyrus-sasl section.

----------

## langthang

in your authdaemonrc limit the authentication method you use, ie: authmodulelist="authpam" or authmodulelist="authmysql" , from your log, it looks like you dont have authmysqlrc setup.

----------

## schpanky

that seems to have gotten me in....

thanks!

----------

## schpanky

k... still having problem where "mail" command says "No mail for <user>" even though there is mail in ~/.maildir/new

any suggestions for this problem?

----------

## langthang

try `mail --file ~/.maildir`

----------

## schpanky

results:

```
 # mail --file ~/.maildir

mail: invalid option -- -

usage: mail [-eIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-s subject]

            to-addr [...] [-- sendmail-options [...]]

       mail [-eIiNnv] -f [name]

       mail [-eIiNnv] [-u user]

```

so, logically I tried 

```
# mail -f ~/.maildir

mail: /root/.maildir: Is a directory

```

----------

## langthang

look like your mail is different than my mail, so you need to man mail.

```
# equery b $(which mail)

[ Searching for file(s) /usr/bin/mail in *... ]

net-mail/mailutils-0.6 (/usr/bin/mail)

$ mail --file ~/.maildir

"/home/langthang/.maildir": 4 messages 4 new

>N   1 root                                 13/512   test

 N   2 root                                 13/512   test

 N   3 root                                 13/512   test

 N   4 tvan@mar.localhost                   13/509   test

?
```

----------

## schpanky

hmmmm...

```

# equery b $(which mail)

[ Searching for file(s) /bin/mail in *... ]

mail-client/mailx-8.1.2.20040524-r1 (/bin/mail)

```

definately using a different mail....

does yours also do command-line mailing?

----------

## langthang

> does yours also do command-line mailing?

Yes, you can use it for cron jobs too.

```
# crontab -e

8 10 * * *     /usr/local/bin/pflogsumm.pl -d yesterday /var/log/mail.log 2>&1 | /usr/bin/mail -s "`uname -n` daily mail stats" postmaster

langthang@localhost ~ $ mail langthang@gentoo.org

Cc:

Subject: test

test

.

langthang@localhost ~ $

Feb 16 10:44:29 localhost postfix/smtpd[4060]: connect from localhost[127.0.0.1]

Feb 16 10:49:15 localhost postfix/smtpd[4060]: timeout after EHLO from localhost[127.0.0.1]

Feb 16 10:49:15 localhost postfix/smtpd[4060]: disconnect from localhost[127.0.0.1]

Feb 16 10:52:35 localhost postfix/anvil[4062]: statistics: max connection rate 1/60s for (smtp:127.0.0.1) at Feb 16 10:44:29

Feb 16 10:52:35 localhost postfix/anvil[4062]: statistics: max connection count 1 for(smtp:127.0.0.1) at Feb 16 10:44:29

Feb 16 10:52:35 localhost postfix/anvil[4062]: statistics: max cache size 1 at Feb 1610:44:29

Feb 16 13:26:44 localhost postfix/pickup[5642]: C19CA394494: uid=1000 from=<langthang>

Feb 16 13:26:44 localhost postfix/cleanup[5748]: C19CA394494: message-id=<20050216212644.C19CA394494@localhost.localdomain>

Feb 16 13:26:44 localhost postfix/qmgr[27363]: C19CA394494: from=<langthang@localhost.localdomain>, size=335, nrcpt=1 (queue active)

Feb 16 13:26:45 localhost postfix/smtp[5750]: C19CA394494: to=<langthang@gentoo.org>,relay=mail.gentoo.org[156.56.111.197], delay=1, status=sent (250 OK id=1D1Wf8-0004vq-38)
```

----------

