You are not logged in.

#1 2008-08-13 01:52:24

colbert
Member
Registered: 2007-12-16
Posts: 809

Trying to set up mutt/console mail

I am at the wiki and specifically here: http://wiki.archlinux.org/index.php/Mutt#Sorting_Mail

I have getmail working with my Gmail, and just tried to set up procmail but it didn't seem to work. Where it indicates to create and edit the .procmail file, it doesn't specify where to put this file? I just put it in ~/.getmail/  as a best guess. I edited the file and ran getmail which continues to work but there is no sorting. Then in console I saw:

You have new mail in /var/mail/bobby

But I'm confused at this point as it's not sorting or I can't see how it is. I have ~/mail set up as per the wiki as well as /mail/cur, tmp and new. :?

TIA for any help smile

Offline

#2 2008-08-13 02:01:10

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Trying to set up mutt/console mail

typically when dealing with dot files like .procmailrc, it goes in ~. However programs may specify a different place to put them, such as .getmail and .mutt. Although with getmail, you can technically put .getmailrc files in ~ and specify that at the command line. I suspect the reason getmail and mutt does this is because with getmail some people have many email accounts, and keeping it in one place is convenient. For mutt, you can split up your configuration file, which I suppose can be convenient (not sure what's wrong with putting tons of comments muttrc).

Also, procmail is a separate program anyway, it wouldn't be in another program's configuration.

Offline

#3 2008-08-13 02:09:46

smurnjiff
Member
Registered: 2007-06-25
Posts: 211

Re: Trying to set up mutt/console mail

See if my posts on this help you: http://antonyjepson.wordpress.com/2008/ … g-up-mutt/
and
http://antonyjepson.wordpress.com/2008/ … ail-setup/

Last edited by smurnjiff (2008-08-13 02:10:02)

Offline

#4 2008-08-13 03:24:06

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Trying to set up mutt/console mail

Thanks guys, and smurnjiff I have followed your blog posts but still cannot get it working. Here's my relevant files/settings (only have one gmail account):

.mutt/muttrc

set realname='Me'

set sendmail="/usr/bin/msmtp"

set edit_headers=yes
set folder=~/mail
set mbox=+mbox
set spoolfile=+inbox
set record=+sent
set postponed=+drafts
set mbox_type=Maildir

mailboxes +inbox +others

~/.procmailrc

MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/inbox/
LOGFILE=$MAILDIR/log

:0:
* ^To: someone@email.org
foldername

~/.msmtprc

# gmail
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from email@gmail.com
user email@gmail.com
password something
tls on
tls_starttls on
tls_trust_file ~/.certs/Equifax_Secure_Certificate_Authority_DER.cer

I run mutt and get this at the bottom of the mutt screen:

---Mutt: (no mailbox) [Msgs:0]---(date/date)---------------------------------------------------------------------------------------------------------------(all)---
/home/bobby/mail/inbox: No such file or directory (errno = 2)

However if I do mkdir ~/mail/inbox I get this in mutt:

---Mutt: (no mailbox) [Msgs:0]---(date/date)---------------------------------------------------------------------------------------------------------------(all)---
/home/bobby/mail/inbox is not a mailbox.

sad

Last edited by colbert (2008-08-13 03:24:51)

Offline

#5 2008-08-13 10:49:46

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Trying to set up mutt/console mail

Did you create /home/bobby/mail? Since it is not a mail folder, you should create it by hand.
Procmail is in charge of creating the mbox/maildir into it, but only actually when some mail is processed to end up there. Please also note that the way in which you name the destination in the procmail rule determines the kind of mail format, so that /home/bobby/mail/inbox/ (with the final /) creates a maildir, while foldername without final / creates an mbox.


Mortuus in anima, curam gero cutis

Offline

#6 2008-08-13 17:25:46

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Trying to set up mutt/console mail

Yes I have /home/bobby/mail, and I changed the .procmailrc line:

DEFAULT=$MAILDIR/inbox/

to

DEFAULT=$MAILDIR/inbox

But I run mutt and still I get this "/home/bobby/mail/inbox is not a mailbox" error sad

EDIT: And in ~/mail I can see in folder inbox some messages and it appears procmail is sorting them fine, just can't open mailbox with Mutt though.

Last edited by colbert (2008-08-13 17:29:22)

Offline

#7 2008-08-13 18:36:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Trying to set up mutt/console mail

For starters, fdm is far better than getmail+procmail, if you ask me

Secondly, the shell mail check actually uses the MAIL envvar, so try setting that in your bashrc

Offline

#8 2008-08-13 18:45:02

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Trying to set up mutt/console mail

Okay I just downloaded fdm, do you have a guide or something on how to use it? I just checked the wiki and couldn't find it.

And what is the MAIL envvar I should put in my bashrc? Not sure what that means smile

Offline

#9 2008-08-14 01:35:22

smurnjiff
Member
Registered: 2007-06-25
Posts: 211

Re: Trying to set up mutt/console mail

You don't need to switch to fdm as you have a working configuration already.  You just need to create the appropriate directories.

mkdir ~/mail/inbox/cur
mkdir ~/mail/inbox/new
mkdir ~/mail/inbox/tmp

or, if you're using a good shell

mkdir ~/mail/inbox/{cur,new,tmp}

Now move all the mail messages into ~/mail/inbox/cur and you should be good to go.

You might want to schedule getmail to run every half an hour or something.  A good entry is this

*/30 * * * * /usr/bin/getmail --rcfile ~/.getmail/getmailrc

Replace ~/.getmail/getmailrc with your getmailrc file.

Use 'crontab -e' to edit your crontab.

Offline

#10 2008-08-14 08:03:35

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Trying to set up mutt/console mail

Procmail should create both moboxes and maildirs on its own. But since you finally choose to let it create mboxes, then mbox_type in .muttrc should not be maildir as above.


Mortuus in anima, curam gero cutis

Offline

#11 2008-08-14 21:21:20

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Trying to set up mutt/console mail

Okay I have it working now! I didn't have cur/new/tmp in mail/inbox, that was it. Also I had to change in my getmailrc:

path = ~/mail/inbox

for destination under type = Maildir. So now it sees my inbox as the maildir for Gmail account.

Now how can I have a script send me an email? ie., I have a script that checks if certain processes are running and I'd like it to email me if they aren't (stuff like mythbackend) just in case when I am away from home, how would I do this, with this kind of script:

if pidof processname; then
restart process command
else
exit
fi

Like have it email me that the process is not running? Thx smile

Offline

#12 2008-08-15 08:42:19

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Trying to set up mutt/console mail

Please note that in this way procmail is not used at all, you are actually using getmail as a MDA (not a criticism, it can be a nice choice).
You can echo what you like directly to your MTA, something like:

echo "mythbackend is dead" | sendmail someone@something.org

With msmtp you have to rely on your remote ISP, you can not deliver local mail. If you want to deliver local mail, then you need a full MTA (postfix for example) or a light one with specific local mail support (esmtp comes to mind).

Last edited by patroclo7 (2008-08-15 08:44:42)


Mortuus in anima, curam gero cutis

Offline

#13 2008-08-15 16:25:23

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Trying to set up mutt/console mail

I don't want to confuse things so I actually made a thread here about the script and am resulting with some mail problems/confusion: http://bbs.archlinux.org/viewtopic.php?pid=407251 smile

Offline

#14 2009-02-23 00:38:20

yvonney
Member
Registered: 2008-06-11
Posts: 671

Re: Trying to set up mutt/console mail

@phrakture

thank you SOooooo much for the lead/comments on fdm.

I was doing the:

taking 10 times as long to decide packages/strategy to use, compared to the time it takes actually set it up and figure it out having finally decided   um   ....thing!  if that makes sense....

fdm... for me, the way to go....

um,   still. I expect!


best wishes to all.

Last edited by yvonney (2009-02-27 17:30:12)

Offline

Board footer

Powered by FluxBB