How can I have all new messages to a particular email address automatically saved to a file like /mail/testing.txt
Is there a way to pipe it to a script that can write the file, for example? Thanks!
How can I have all new messages to a particular email address automatically saved to a file like /mail/testing.txt
Is there a way to pipe it to a script that can write the file, for example? Thanks!
Not certain what the long-term objective is, but rather than worrying about a script, what not take a simpler route and create a new mail account (called archive, for example). Then create a forwarder so any mail addressed to the primary account also forwards to the "archive" mailbox.
In short, yes.Originally Posted by TechGuy
Email filters in cPanel can be set to pipe email to a script (Perl, PHP or whatever you fancy).
Using PHP, the process of reading mail in from STDIN is really really straightforward and the process of then appending the email contents to a file is dead simple if you want to store absolutely everything. On the other hand, if you want to store only the body of emails, and in a human-readable format, you've got more of a challenge on your hands, but it's by no means impossible.