LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-12-2003, 04:02 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-14.2 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 501

Rep: Reputation: 31
read mail headers from command line


I'm looking to try and obtain a list of all e-mail currently residing in my mail box.

What I wish to do is as follows:

Retrieve a list of e-mails from the mail server, then using this information, create a simple web page that I can then visit and check what mail is waiting there. It will actually be a wap page, as I intend on checking from my mobile.

I've already got a couple of scripts in use that allow me to check page counter values etc from my mobile, so I intend on simply modifying the scripts, but I first need to obtain the list.

All help is appreciated...
 
Old 04-12-2003, 04:29 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
it would be

mail -H > filename

the list will be output to, and overwrite the file "filename"
 
Old 04-12-2003, 06:19 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
"mail: invalid option -- H"
Sup, D? :-]
 
Old 04-13-2003, 12:17 AM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
that is strange

looks like a version specific option
[david@www david]$ mail -H
mail: invalid option -- H
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]

[david@www david]$ mail -i
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/david": 4 messages 3 unread
>U 1 forum@linuxquestions Sat Apr 12 17:12 44/1692 "Reply to post 'noob question on slackware'"
U 2 forum@linuxquestions Sat Apr 12 17:33 44/1715 "Reply to post 'US Robotics Serial modem problem'"
3 forum@linuxquestions Sat Apr 12 17:34 45/1747 "Reply to post 'read mail headers from command line'"
U 4 forum@linuxquestions Sat Apr 12 23:04 44/1739 "Reply to post 'Partition Help'"
&

david@zeus:~$ mail -
mailx version nail 10.4 1/19/03. Type ? for help.


david@zeus:~$ mail -H
>U 1 david@zeus.domain Sat Apr 12 23:05 36/1412
N 2 david@domain.com Sat Apr 12 23:15 13/662




-i seems to work
 
Old 04-13-2003, 07:21 AM   #5
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-14.2 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 501

Original Poster
Rep: Reputation: 31
Hi there,

My intention was not to actually retrieve any mail from the remote mail server, but rather a list of all mailbox content.
 
Old 04-13-2003, 02:53 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
mail -H does that on mine

mail -H > mymailheaders

cat mymailheaders
>U 1 david@localhost.lo Sat Apr 12 23:05 36/1412
U 2 david@dcphillips.n Sat Apr 12 23:15 14/672

Last edited by DavidPhillips; 04-13-2003 at 03:31 PM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command-line mail to read KMail messages daihard Linux - Software 3 12-05-2004 01:29 PM
Shell Script to read 500files from the command line saravanan1979 Programming 1 09-22-2004 10:44 AM
How can I read pdf files at the command line? hansi umayangan Linux - General 8 09-02-2004 08:27 AM
Command read line library thrix Linux - Newbie 1 01-31-2004 11:11 PM
linux scripting help needed read from file line by line exc commands each line read atokad Programming 4 12-26-2003 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:17 AM.

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