Answer the question
In order to leave comments, you need to log in
How to get direct access to emails on the server?
There is a server (VPS) on linux, it has ssh access, the VestaCP web muzzle is installed to the apache server.
Letters come to the mail, for some automation of internal processes, it became necessary to parse letters (standard ones) for the appearance of various kinds of information there.
Question : how to get direct access to these emails? how to give them to Apache to be torn to pieces by php scripts?
As I understand it, these letters are received as they are stored in a separate file (I had a test sendmail once put sent letters in a folder with the .msg format a long time ago), maybe you can write some script that would copy them to a folder upon receipt that the site can access?
Thanks in advance for the replies.
Answer the question
In order to leave comments, you need to log in
it is logical to parse them through php-imap
and not to fence the idiotic way that you have in mind.
Maybe not look for crutches, but take pop3 to pick up letters directly in php?
if letters come to this server, look in the /var/mail directory
It's better not to parse letters directly to /var/spool/mail, but simply to receive them from the script as a user. Then they will be given correctly, marked as read, it will even be possible to delete unnecessary ones and collect the necessary ones. Making your own mail base parser in /var is a more cumbersome option.
Thanks for the answers, completely out of my head imap_open
Never before had such a task, and therefore blunted.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question