We are exploring a way to improve on the PHP mail return value telling you nothing about whether the email gets off to the intended recipient. One step, here at RJM Programming, is to verify if the email has immediately been sent off according to our Exim mail server logs.
We are turning to a crontab operated (ie. scheduled) call to a new …
- Korn Shell script called snapshotexim.ksh … which looks out for the existence of a …
- file in our Apache web server’s Document Root called snapshotexim.txt
… to, in our MAMP local Apache web server wooooorrrrrlllllddd would work with either …
echo '/Applications/MAMP/htdocs/ "2022-12-20 11:4[01]"' > snapshotexim.txt
ksh ./snapshotexim.ksh # may populate /Applications/MAMP/htdocs/snapshotexim.php
… or …
echo '' > snapshotexim.txt
ksh ./snapshotexim.ksh /Applications/MAMP/htdocs/ "2022-12-20 11:4[01]" # may populate /Applications/MAMP/htdocs/snapshotexim.php
… methodologies to place a relevant “slice” (dated 2022-12-20 11:40 or 2022-12-20 11:41) of the Exim mail server log into a file in our Apache web server’s Document Root called snapshotexim.php for ongoing local work to follow.
We prefer the first way because our future PHP interfacing can better write out “the intelligence” into snapshotexim.txt itself.
Up with crontab, in a Korn Shell procedure that runs every minute, we place (code like) …
if [ -f "$HOME/snapshotexim.txt" ]; then
if [ -f "/etc/init.d/snapshotexim.ksh" ]; then
ksh /etc/init.d/snapshotexim.ksh
fi
fi
… ready for our journey of discovery to continue!
Did you know?
If you are thinking of implementing a solution of this ilk, within the next phase of the procedures we’ll tackle into the future, you will need a PHP reader of snapshotexim.php above, via file_get_contents or HTML and Javascript and Ajax reader such as eximsnapshot.php as some sort of starting point.
If this was interesting you may be interested in this too.