Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #14860] |
Sat, 22 November 2003 19:44 |
blackops
Messages: 12 Registered: July 2003
Karma:
|
Junior Member |
|
|
I have written a script that logs into a POP server and grabs one message at a time, routing them through mailinglist.php, until the POP account has no more new messages. You can use this script to enable mailing list integration by completing the following steps. The benefit is that you do not need .procmailrc support to work with a mailing list.
- Enable mailing list integration for a given forum
- Create a POP account that will only be used as a dummy subscriber to the mailing list you want to integrate
- Use this script, scheduled by crontab, to access the POP account on a regular basis to download new messages from the mailing list and import them into the forum (every 15 minutes, or so, should do it).
HOW IT WORKS:
This script creates a temp file, logs into a POP server, downloads one message at a time, storing it in the temp file, and pipes the contents of that file into maillist.php. It expects two command-line arguments: POP_account_name and list_id.
Example from the command line:
php -q /home/virtual/site2/fst/var/www/html/test/fmail.php f-general-user 2
The code is attached. Notice the few places I have <TEXT>. Please replace those occurrences (including the "<" and ">") with the actual values.
-
Attachment: fudmail.php
(Size: 1.25KB, Downloaded 1448 times)
|
|
|