LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to display the last email content with configured fetchmail ? (https://www.linuxquestions.org/questions/linux-general-1/how-to-display-the-last-email-content-with-configured-fetchmail-867926/)

Xeratul 03-11-2011 08:39 AM

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

business_kid 03-12-2011 03:32 AM

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

corp769 03-12-2011 03:37 AM

If anything, I would create a small bash script using grep and/or tail to grab the lastest emails. Just my two cents....

unSpawn 03-12-2011 03:38 AM

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.


All times are GMT -5. The time now is 07:29 PM.