diff --git a/docs/docs/guide/msgs/ftn/magimail.md b/docs/docs/guide/msgs/ftn/magimail.md index 48fe274..3ecc048 100644 --- a/docs/docs/guide/msgs/ftn/magimail.md +++ b/docs/docs/guide/msgs/ftn/magimail.md @@ -67,3 +67,39 @@ TODO. AREA "HPY_GEN" 637:1/999.0 JAM "/path/to/MagickaBBS/msgs/hpy_gen" EXPORT %637:1/100.0 GROUP A + +## Example magitoss.sh + + #!/bin/sh + cd /path/to/MagickaBBS/ftn + ../utils/magimail/bin/magimail toss + +## Example magiscan.sh + + #!/bin/sh + cd /path/to/MagickaBBS/ftn + ../utils/magimail/bin/magimail scan + +## Watching for New Mail + +When new mail is created on your bbs, a semaphore file is touched. So, you need to run a script that watches for changed semaphores and runs `magiscan.sh`. + +On Linux and FreeBSD this can be accomplished with inotifytools. On other platforms, an alternative called [FSWatch](https://github.com/emcrisostomo/fswatch) is available. + +## Example watchmail.sh (inotifytools) + + #!/bin/sh + + cd /path/to/MagickaBBS + + touch mail.out + + while inotifywait -e close_write mail.out; do ./ftn/magiscan.sh;done + +## Example watchmail.sh (fswatch) + + #!/bin/sh + + touch /path/to/MagickaBBS/mail.out + + /usr/local/bin/fswatch -o /path/to/MagickaBBS/mail.out | xargs -n1 -I{} /path/to/MagickaBBS/ftn/magiscan.sh