# problem with fetchmail/procmail/mutt

## thegarbageman

I am having a problem reading my mail with mutt.  I am using ssmtp, fetchmail and procmail.  I am using fetchmail to retreive messages from a POP account, each of which are ending up as a file named msg.???? in my ~/.maildir folder.  When I run mutt, it does not display a list of these messages, as I imagine they need to be placed in the ~/.maildir/new folder.  I have read both the Gentoo Desktop Config Guide and have read every forum thread with both "mutt" and "fetchmail" in the search results.  And I have searched Google.  Does anyone know what I have missed?

----------

## rac

Moving from Off The Wall, which is a zany discussion forum, to Networking and Security, as I think email qualifies as a networking issue.

----------

## blunted

I'm also having this issue. 

I read that the way you specify the folder the mail should delivered to is important (the / on the end of IN-gentoo is supposed to mean I use the maildir format). My procmail recipe is as follows...

```
:0

* ^TO_gentoo

IN-gentoo/

```

Each new e-mail procmail delivers is a single file, which would suggest that procmail is trying to deliver the mail in MH format, maybe as a backup method because I haven't configured something properly. I told fetchmail to use procmail as a mda but I suspect (?) that won't work if postfix has been using the .maildir  :Confused: . Do I need to set up postifx to use procmail as a preprocessor or should procmail be able to do the job?  :Confused: 

----------

## thegarbageman

add this to ~/.procmailrc  (At least this is how I took care of it)

```
DEFAULT=$HOME/.maildir/new

```

Apparently you can't use "~" in place of "$HOME".  Procmail won't accept it.   :Rolling Eyes: 

I haven't installed postfix at all, BTW.

----------

## Xor

this may work.... but it's playin wrong... this wourld mean that "new" is a mailbox file... in fact it's a subdir in a maildir... thich in general you don't have to bother with.... as said before just append a / at the end of your maildir and all should be fine.... I use postfix-smtp/courier-imap/mutt/fetchmail/squirrel/procmail (on OpenBSD) and it work's real fine....

----------

## scottro

Sounds a bit wacky there.

I have a doc post called Mutt and the Single User which might be of use at

https://forums.gentoo.org/viewtopic.php?t=1085

It's not for use with Postfix, but still might have some value--somwhere in the middle is a part about Procmail folders and such

Scott

----------

## adv

Could you please post your .procmailrc, .muttrc and .fetchmailrc files?

Some of the key things to have in your .procmailrc file would be:

```

MAILDIR=$HOME/Maildir/

```

and make sure each receipe ends with a / such as :

```

:0c

* ^From.*bugzilla-daemon

$MAILDIR/.Lists.Bugzilla/

```

Then for your .muttrc file, make sure you specify:

```

set spoolfile=~/Maildir

set mbox_type=Maildir

```

That's all the help I can give you for now until your post your config files.

A

----------

## blunted

Specifying $MAILDIR in my procmail recipies for each rule fixed the problem, I'll have to wait and see if my next gentoo email get's delivered to the right place. General email does now.

Before

```
:0

* ^TO_cygwin

cyg/

:0

* ^TO_gentoo

gen/

:0

* ^TO_.*.

```

After

```
:0

* ^TO_cygwin

$MAILDIR/cyg/

:0

* ^TO_gentoo

$MAILDIR/gen/

:0

* ^TO_.*.

$MAILDIR/

```

Using :0c makes the mail get delivered in the msg.xxx format, so I left that off. Thanks adv.

----------

## zpiro

Im using procmail fetchmail ssmtp and mutt.

Im using the same ssmt.conf and revaliases files.

Same with .procmail and .fetchmail files....

as i were with gentoo 1.2

Ive modified them after what has been sugested here, and hasnt worked for me. im still getting mail in the msg.xxx format. or MH format?

So The only things thats different is that, it worked with gentoo 1.2 for me.

And when i installed gentoo  1.4_rc1 it broke.

----------

## zojas

I had this problem too! the solution for me was to note that the procmail emerge was failing to create a /etc/procmailrc file.

here's its contents:

```
# Use maildir-style mailbox in user's home directory

DEFAULT=$HOME/.maildir/

```

in my ~/.procmailrc, I had 

```
MAILDIR=$HOME/.maildir

```

I tried putting the '/' at the end of MAILDIR in my ~/.procmailrc and it didn't fix it. but the /etc/procmailrc did!!

----------

## ArturoC[R2]

 *Quote:*   

> I tried putting the '/' at the end of MAILDIR in my ~/.procmailrc and it didn't fix it. but the /etc/procmailrc did!!

 

Rather than add a procmailrc to /etc with the DEFAULT var in it,   I added   "DEFAULT=$HOME/.maildir/   line to my  .procmailrc   

Works  :Smile: 

----------

