Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

With my setup all my mail goes into /home/vmail/(site.com)/(username)/new/

Of course this is great, but the "mail" command only reads it if its in /home/vmail/new, how do I read mail with the 'mail' command if it's all in virtual directories?

If this is not possible, how could I read that mail?

share|improve this question
add comment

1 Answer

You are not saying what your "mail" command is... So I will have to guess. For example, on most of my systems, "mail" is a simple SMTP relay, not a mail reader...

My guess: the "mail" command you refer to is based on unix accounts, you seem to be using a virtual mail system with one unix account and many virtual mail accounts so this will not be possible without some work. Other clients like courier-imapd/courier-popd support this out of the box, but I very much doubt that any command line email reader will.

One hack that might work would be to create symlinks to all the "/new/" (and "/cur/" if you want read mail too) directories from "/home/vmail/new/" named after each account it is for. You could also automate this:

  • /home/vmail/site_com_username -> /home/vmail/site.com/username/new/
  • /home/vmail/site2_com_user2 -> /home/vmail/site2.com/user2/new

That is your assuming your current "mail" command looks for mail in "/home/vmail" (dubious - often they look for a ".maildir" mailbox) and that it understands mail subdirectories. If not, then get one that does support this.

share|improve this answer
    
Have you looked into the mail command on your systems? You might be surprised! –  mattdm Dec 12 '10 at 5:10
    
Some of them have mailx (a popular choice on most Linux distros), some of them have it symlinked to sendmail (or postfix), some of them have nothing at all, etc.. How is this "surprising"? AFAIK, on *nix systems the norm is to have "mail" provide a sendmail like interface (for things like cron etc). mailx if it is installed may provide more than this, but it is still based on unix user accounts, so the comment above stands. Or am I missing something? We are talking about mail retrieval, not delivery, right? –  totaam Dec 12 '10 at 13:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.