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 eximsnapshotphp as some sort of starting point.
If this was interesting you may be interested in this too.