Mail - stops listing after 34 lines with a "?"

Hope all is well with you and yours.

I have a quick unix/Linux mail question.

I need to get some data from all received mail and load it into the PostgreSQL DB. I use fetchmail to get them from a remote server and they go to /var/mail/abruck

There are 2 lines that I need from each email: Date and Subject.

When I just type "mail" to get the mail content, I get exactly what I want:

U 1 Dispatch Team Tue Oct 17 11:55 192/11778 (FOLLOW-UP) 1 - Emergency Work Order# WO-0003342 at (Ranch) | ETA NEEDED - CRM:01136317
U 2 Dispatch Team Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO-0003304 SCHEDULED for 8/8/2017 4:30 PM (Wents) - CRM:01136334
U 3 Dispatch Team Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO-0003304 SCHEDULED for 8/9/2017 4:00 PM (Wents) - CRM:01136338
......
U 33 Dispatch Team Tue Oct 17 11:55 187/11550 (FOLLOW-UP) 2 - Critical Work Order# WO-0002897 at (Calas) | ETA NEEDED - CRM:01136469
U 34 Dispatch Team Tue Oct 17 11:55 190/11725 (FOLLOW-UP) 1 - Emergency Work Order# WO-0003342 at (Ranch) | ETA NEEDED - CRM:01136473

?

except that it stops after 34 lines with a "?"

How can I get ALL the emails without stopping every 34 lines with a "?". I want go > it all into one file.

Greatly appreciate your time and efforts ...

All the Best!

/var/mail/abruck is a directory - the mail file(s) there are text files. You can list the file
with ls and view the file with vi.

So if you employ grep on the file to return just the lines you want from the file, you can get any set of values you need.

One weeny - fetchmail simply adds new emails to end of the mail text file.
The mail clients marks unread items as read. You are not using mail to read them anymore. Nothing gets marked as read.

If you want to see just the latest ones, rename that existing mail text file every business day to something else like mailfile_[yesterday's date] You can then go in the /var/mail/abruck directory and clean up old files by ancient dates on them. Then use touch to create a new files. You can also simply truncate the file if you do not care about older emails.

Thank you for that.

I solved the issue (partly) with "mail -H" but:

When I do mail on the command line, I get:

abruck@abruck-LX6810-01:~$ mail
"/var/mail/abruck": 2610 messages 2610 unread
>U   1 Dispatch Team      Tue Oct 17 11:55 189/11578 (FOLLOW-UP) 2 - Critical Work Order# WO-0002897 at (Callaway Villas) | ETA NEEDED - CRM:01136292
 U   2 Dispatch Team      Tue Oct 17 11:55 208/12950 (FOLLOW-UP) 1 - Emergency Work Order# WO-0002643 at (The Gateway at Lubbock) | ETA NEEDED - CRM:01136294
 U   3 Dispatch Team      Tue Oct 17 11:55 191/11725 (FOLLOW-UP) 1 - Emergency Work Order# WO-0003342 at (River Ranch) | ETA NEEDED - CRM:01136299

and when I did mail -H , I get:

>U   1 Dispatch Team      Tue Oct 17 11:55 192/11778 (FOLLOW-UP) 1 - Emergency
 U   2 Dispatch Team      Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO
 U   3 Dispatch Team      Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO

Half the line is missing...

Any ideas?