How do I extract attachments from mails arriving at my postfix mailbox and preferably send the content of the attachment to another email account? I am interested in being able to acquire/read the content of the attachment on ubuntu terminal.
extracting attachments from mail that is coming to my postfix inbox
email;postfix;fetchmail
Install procmail if not already installed. In your postfix configuration ( /etc/postfix/main.cf ) make sure you have a line:mailbox_command = procmail -a $EXTENSIONin your ~/.procmailrc insert the following (you will need a different matching pattern)::0* ^Subject:.*some_text_to_match| /usr/local/bin/your_processing_programIn your_processing_program extract the attachments and forward them e.g. with a python or ruby program.How to display the attachments in terminal depends on the attachment content. If it is text you could write it to the end of a file and use tail -f in the terminal.