M
M
Mikhail Repka2015-09-03 11:27:52
linux
Mikhail Repka, 2015-09-03 11:27:52

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

5 answer(s)
P
Puma Thailand, 2015-09-03
@mikefrost

it is logical to parse them through php-imap
and not to fence the idiotic way that you have in mind.

R
Rikcon, 2015-09-03
@Rikcon

Maybe not look for crutches, but take pop3 to pick up letters directly in php?

R
Ruslan Fedoseev, 2015-09-03
@martin74ua

if letters come to this server, look in the /var/mail directory

S
Saboteur, 2015-09-03
@saboteur_kiev

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.

M
Mikhail Repka, 2015-09-03
@mikefrost

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 question

Ask a Question

731 491 924 answers to any question