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 03-11-2011, 08:39 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,653

Rep: Reputation: 255Reputation: 255Reputation: 255
how to display the last email content with configured fetchmail ?


Hi,

I would like to see the last received IMAP email and its content with Fetchmail. Is it possible? that would be great...

Regards
 
Old 03-12-2011, 03:32 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,144

Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
No. Fetchmail is just that - a mail fetcher. These programs in linux do one thing and do it well. You can experiment endlessly with little scripts using tail or tee (two other programs that do one thing and do it well). We'll grant you a tinkerer's license for a short period to see if you like what you get :-P
 
1 members found this post helpful.
Old 03-12-2011, 03:37 AM   #3
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
If anything, I would create a small bash script using grep and/or tail to grab the lastest emails. Just my two cents....
 
Old 03-12-2011, 03:38 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Fetchmail retrieves, modifies and forwards email. It forwards messages to a MTA running a local MDA like procmail to finally deliver those messages. Procmail can modify messages on delivery using recipes. These recipes can do anything the shell can do, including running external scripts and applications, but recipes work only on messages that are in the process of being delivered (or being piped through), not on messages that are already delivered.

Fetchmail and procmail allow you to log (verbosely) what messages are received and where they are delivered. If 0) all fetchmail and procmail processes are configured to log, if 1) you know the log locations and if 2) the logs aren't being truncated or logrotated while you search you can 'tac|grep' log files to determine the last delivered message and its location. That doesn't mean you're through because displaying the message should be done with care taking into account 0) Privacy laws, 1) the confidential nature of a message if any, 2) the message format (TNEF, MIME multiparts, GnuPG) and 3) contents should be displayed passively, that is without interpreting message contents.
 
  


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
bash: outputing the email content of the last email received? Xeratul Programming 1 03-01-2011 11:39 AM
[SOLVED] Email output of Cron command, sends email but no content? the182guy Linux - Newbie 4 05-28-2010 09:52 AM
why my email content can't display correctly? lzyking Linux - Software 4 05-08-2003 09:01 PM
How do I: convert my fetchmail email file to separate email files? ancientt Linux - Software 1 02-03-2003 02:14 PM

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

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