You are not logged in.

#1 2004-12-09 11:09:38

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Maildir and /bin/mail

I have mailx installed on pacman. I don't have a mailx program. =/
I do have /bin/mail. Is that the name of the executable?

Anyway, on to the problem. I cannot get the variable for MAIL set in the system. I modified /etc/login.defs to have
QMAIL_DIR    Maildir
uncommented, but it is not changing the MAIL environment variable (export).
I did a grep -Ri "MAIL" /etc
and it only turned up login.defs as a file with that var in it.

I am at a loss. I can send mail just fine with /bin/mail, but it is not looking in the ~/Maildir for mail. Further, I don't even know if it is mailx!
I did a locate for mailx and got nada.

help. I want to be able to check mail with "mail"
roll


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#2 2004-12-09 11:47:27

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Maildir and /bin/mail

Would:

pacman -Ql mailx | grep bin 

help ?
You should also be able to put MAIL variable in your ~/.bash_profile or in something else too (/etc/profile.d/ ?).

Offline

#3 2004-12-09 12:16:16

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Maildir and /bin/mail

lanrat wrote:

Would:

pacman -Ql mailx | grep bin 

help ?
You should also be able to put MAIL variable in your ~/.bash_profile or in something else too (/etc/profile.d/ ?).

well, that yeilds /usr/bin/mail
still, I can man mail, and man mailx, but there is no mailx executable.
man mail and man mailx yield different results too...
*scratches head*

anyway, I was just wondering why the /etc/login.defs doesn't seem to be doing anything. I could probably set the MAIL var in profile, but it is getting set somewhere right now...but where??
And the thing with mailx is just nutty..lol


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#4 2004-12-09 16:08:53

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Maildir and /bin/mail

I'm sure you have latest mailx installed right ?

AFAIK mailx makefile is configured with "mail" as the name of mailx binary only. Also there is no mailx manual, I think. Locate mailx manual page file and check to which package it belongs (pacman -Qo). Perhaps it should be trashed?

Also I'm not sure what are you trying to do with /etc/login.defs?
IIRC setting mail variables in this file should give you the message about new mail when you log in. According to mailx manual:

MAIL_DIR (string)

This parameter specifies the full pathname to the directory which contains the user mailbox files. The user's login name is appended to this path to form the MAIL environment parameter - the path to the user's mailbox. Either this parameter or MAIL_FILE must be defined; if undefined some possibly incorrect default value will be assumed. See MAIL_CHECK_ENAB for related information.

So depending on your settings for mail and your smtp daemon this can generate for example /var/spool/mail/cactus and cactus is the system mailbox file for cactus user. Then you have ~/blablah your mbox directory where mailx will save sent mails etc. (as in the manual).

If the MAIL variable is not generated this could mean a bug, I think.

Now, mailx uses MAIL variable (or default) to locate your system mailbox.

MAIL  The name of the initial mailbox file to read (in  lieu
           of  the  standard  system  mailbox).  The  default  is
           /var/mail/username .

. So if you have your mail in /var/spool/mail/cactus it should read it (which is separate thing from displaying "new mail" message during login).

This looks complicated because there are very similar terms used that in fact mean something else.

The problem might be that you are storing your incoming mail not in mbox format (all emails in one file) but in maildir format (each mail is a separate file). I'm not sure if mailx can read maildir format (maildir is not MAIL_DIR).

Mailx supports -f option. If you know where your incoming mail is located you can start it with mailx -f /path/to/incoming/mail/directory to check if this works at all.
If you want to customize it more you have to create ~/.mailrc file IIRC - check mail (it should be mail everywhere not mailx IMO) manual.

I only hope this is clear enough for you :-)

Offline

#5 2004-12-09 20:40:01

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Maildir and /bin/mail

word!

I did some google scraping, and it looks like mail is not Maildir compliant. It seems mailx is, according to some, and not, according to others.  roll
I guess installing mutt would be the best. It also appears that mailcheck in bash (the "you have new mail" thing when you login) is NOT Maildir compliant. zsh is, but that doesn't help me. I suppose I will just write some kind of shell script and have it execure as part of bash rc..right after fortunemod...

$ pacman -Qo /usr/bin/mail
/usr/bin/mail is owned by mailx 8.1.1-2

pacman -Qo /usr/man/man1p/mailx.1p.gz
/usr/man/man1p/mailx.1p.gz is owned by man-pages 1.70-1

pacman -Qo /usr/man/man1/mail.1
/usr/man/man1/mail.1 is owned by mailx 8.1.1-2

so, that solves that...silly man-pages package. Maybe that one should be removed from that package?

As for what I am trying to do with login.defs. I was trying to set MAIL in it. I am curious why when I make changes to login.defs, nothing is reflected in the user logins. Is this file being called at all? Where in the process is it usually executed/called?
Good find on the default value for MAIL lanrat. I think that is why it is getting set without appearing anywhere. I just wonder what login.defs is doing....variables set in there just don't seem to be being set for users.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2004-12-10 12:10:15

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Maildir and /bin/mail

cactus wrote:

I did some google scraping, and it looks like mail is not Maildir compliant. It seems mailx is, according to some, and not, according to others.  roll

Oh yes I like this part of browsing internet docs/forums most :-)
As I understand mailx man it is not maildir compatible but I'm not 100% sure. But it looks like nail (improved mailx) might do it http://nail.sourceforge.net/ At least it supports maildir format. And it's in extra alraedy.

cactus wrote:

I guess installing mutt would be the best. It also appears that mailcheck in bash (the "you have new mail" thing when you login) is NOT Maildir compliant. zsh is, but that doesn't help me. I suppose I will just write some kind of shell script and have it execure as part of bash rc..right after fortunemod...

Using mutt is a good idea. The only thing is you need a lot of time to configure it. I've spent days and still don't have everything set up.  roll
You could use pine too if it supports maildir (or patch it to enable maildir - I saw patches somewhere...).
I used elmo too which is much easier to configure than mutt and is prettier but it doesn't work anymore with latest arch gcc and all (it compiles fine but segfaults everytime - I tried to co-operate with the developer to find the bug but so far he didn't find it).

I think the easiest would be to try nail first. It should also return values if you put some additional options which you could use to write your own mail check script (I mean run it with these options so it checks for new mail and returns number that corresponds to "new mail found" event or something like this. Then it exits without changing anything. Don't forget to set it so it won't move your read email to another directory unless you want it...).

cactus wrote:

$ pacman -Qo /usr/bin/mail
/usr/bin/mail is owned by mailx 8.1.1-2

pacman -Qo /usr/man/man1p/mailx.1p.gz
/usr/man/man1p/mailx.1p.gz is owned by man-pages 1.70-1

pacman -Qo /usr/man/man1/mail.1
/usr/man/man1/mail.1 is owned by mailx 8.1.1-2

so, that solves that...silly man-pages package. Maybe that one should be removed from that package?

Since there is no mailx binary I think yes (but that's a very minor bug). Or you can put feature request for mailx package to softlink to /usr/bin/mail as /usr/bin/mailx. Unless of course there is some reason for leaving it as it is.

cactus wrote:

As for what I am trying to do with login.defs. I was trying to set MAIL in it. I am curious why when I make changes to login.defs, nothing is reflected in the user logins. Is this file being called at all? Where in the process is it usually executed/called?
Good find on the default value for MAIL lanrat. I think that is why it is getting set without appearing anywhere. I just wonder what login.defs is doing....variables set in there just don't seem to be being set for users.

According to login.defs manual (at least the one I found with google now) it's important to have this file. Shadow programs use different variables from it:
http://www.zevils.com/cgi-bin/man/man2html?5+login.defs.
Also it's a system wide definition which can be overwritten by a user definition but I'm really not an expert here. You can try what's described here (it's for exim but that's not important since it's the same maildir format):
http://talk.trekweb.com/~jasonb/article … tification
Again, according to some people from usenet... it doesn't work big_smile

Anyway, I think you can write some nice script using nail which is doing it in a better way (colors?, number of emails displayed in prompt?  :idea: ).

Offline

#7 2004-12-11 06:55:43

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Maildir and /bin/mail

heh..good recommendations, since I already implemented some of them *wink*

I am using nail now. It works for checking mail, but it uses the wrong path to the sendmail binary that postfix provices! lol.
I have yet to mess with configuring it...not a high priority right now.

As for the link, it works with pam, and I will give it a shot.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#8 2004-12-11 19:53:39

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Maildir and /bin/mail

Example how to rebuild nail with your own path to sendmail binary:
http://www.linuxfromscratch.org/blfs/vi … lnews.html

Offline

Board footer

Powered by FluxBB