The site function mail () PHP sent letters. The function itself returned true, but the letters did not go to the post office. These letters are very important, and I would like to receive them somehow.

Is it possible that somewhere on the server there are logs of sent letters?

To send a letter, a POST request was sent to the server, in the variables of this POST request there was all the necessary information for the letter.

Is there somewhere on the server logs of all POST requests?

Found access.log, but there is only the date of the request and the IP address, but there is no request data itself. Is it possible to find somewhere more detailed logs so that you can recover lost letters?

Distribution: CentOS

  • By default, the http server, of course, does not save the contents of requests. do you know how the mail system is configured on the machine where your php code was executed? - aleksandr barakin
  • Alas, I don’t really understand the server settings, so I don’t know how the server is set up and where it is stored. SSH access to the server is, trying to find the logs of the letters - walik
  • The most reasonable thing in your case is to contact the server administrator. because I’m afraid I’m not able to make a clear algorithm, how to find out all this, and unfortunately I don’t have time for interactive communication with step-by-step questions. Perhaps the value of the letters is sufficient to use the services of a freelancer. - aleksandr barakin
  • to make it clearer: at least two options for setting up the mail server are possible: 1. he tries to send letters himself. 2. he sends letters to another smtp-server (the so-called smarthost). in the first variant of the letter (if not much time has passed since the moment of their sending - approximately several hours) most likely still are in the mailqueue of the local server. in the second case (with the same caveat about time), they are most likely located in mailqueue smarthost. - aleksandr barakin
  • We most likely have the first option, but since the moment of sending the letters, alas, more than a couple of hours have passed since the letter was sent yesterday. - walik

1 answer 1

There are at least two options for configuring the mail server:

  1. he tries to send letters himself. in this case, the letters, if they were not received by the "receiving" server, are most likely still in the mail queue of the local server.

    You can view the minimum information about the letters (ID, addressee, time spent in the queue, etc.) contained in the queue using the command:

    $ sudo mailq 

    Unfortunately, there is no universal command for obtaining more information on a specific letter: it depends on the smtp-server implementation.

    for exim , for example:

     $ sudo exim -Mvb идентификатор 

    for postfix , for example:

     $ sudo postcat -q идентификатор 
  2. he forwards emails to another smtp server (also called smarthost ). in this case, they are most likely in the smarthost mail queue, and their contents should be addressed to the owners of this smarthost .