LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-17-2016, 10:55 PM   #1
bittus
Member
 
Registered: Aug 2006
Posts: 153

Rep: Reputation: 16
Unhappy BASH script to extract mails from a mailbox file


Trying to extract the mails from a mailbox file with bash script. The mailbox file can be opened using mailx and am able to see the mails in it.

Mailx utility requires interaction to display the mails. Want to check if there is a way to silently do the operations using mailx from a bash script.

Last edited by bittus; 02-17-2016 at 10:57 PM. Reason: improvize
 
Old 02-17-2016, 11:02 PM   #2
bittus
Member
 
Registered: Aug 2006
Posts: 153

Original Poster
Rep: Reputation: 16
Got it working!!!

Posting a solution for anyone who is looking for this:

Quote:
echo "type *" | mail -f <mailbox_file>
NOTE: This will print all the mails in that mailbox.

Last edited by bittus; 02-17-2016 at 11:21 PM.
 
Old 02-18-2016, 12:36 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you need to do this automagically look for a Procmail recipe as that can be hooked into the Local Delivery Agent (LDA) process?
 
  


Reply

Tags
mailx



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
sending mails with port number 587 bash script help cli Linux - Newbie 4 03-23-2015 09:56 PM
Bash script to move spammy mails cameleon666 Linux - Software 4 12-11-2014 03:19 AM
How do I extract data from nmblookup in bash shell script? utahnix Linux - General 23 10-12-2009 04:28 AM
how to extract paragraphs from file in BASH script followed by prefix ! , !! and !!! nabmufti Programming 4 02-10-2008 09:23 AM
bash script extract name transfer & to right folder gizmo1007 Programming 2 12-15-2007 05:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:57 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