Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-04-2017, 07:14 PM   #1
Registered: Nov 2017
Posts: 37

Rep: Reputation: Disabled
Unhappy mailx listing users with unread mail!

Hello there, I'm itching for some help with figuring out how to list the users in /var/spool/mail/ directory that have unread mail.
How would this even be possible considering I do not have access to other user's mail list?

Thanks for any help!
Old 12-04-2017, 08:49 PM   #2
LQ Newbie
Registered: Nov 2017
Posts: 14

Rep: Reputation: Disabled
mailx listing users with unread mail!

Try: lsmbox (or look into its source code)
Old 12-06-2017, 12:54 AM   #3
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,480

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
The unread flag is either set or clear. You can write a script to plow through each users email until it finds a set 'unread' flag, make note of the user, and continue on until every user's status as you define it is determined.

You can write the names to a file one at a time as you go, or all at the end when you're done. But without access to the emails it might be tough.


linux, mailx

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to nark a message as "Unread" in mailx ?? techie_san778 Linux - Server 1 06-30-2013 01:53 PM
[SOLVED] How to send a mail in HTML format using mailx or mail or sendmail commands vishnu_knl Linux - Newbie 8 04-05-2012 11:00 AM
Listing all users who currently have mail in inbox ben1173 Linux - Newbie 1 10-26-2010 12:55 AM
mutt unread mail but none shown moob8 Linux - Software 2 10-19-2007 05:50 PM
Unread mail in evolution Barserk Linux - Software 4 10-03-2005 06:54 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration