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:
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!
Last edited by Scott; 10-17-2017 at 05:56 PM..
Reason: Please use code tags, and don't paste rich-text, it's a pain to tidy up. Thanks.
/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.
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Hi Folks,
As per the subject, the following command is not working as expected.
echo $variable | mail -s "subject" "xxx@xxx.com"
Could anyone figure it out whats wrong with this. I am using AIX box.
Regards, (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)