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: 0
|
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 1442 times)
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #14941 is a reply to message #14860] |
Tue, 25 November 2003 20:31 |
Squeebee
Messages: 110 Registered: November 2003
Karma: 0
|
Senior Member |
|
|
Ok, here's my latest work.
I have modified the code to hold an array of mailing list addresses. As each message comes in the header is parsed for a To: or Cc: header and the array is searched on these values, which are then used to determine which numeric argument to send to maillist.php.
So if the array has:
mylist.myhost.com
yourlist.myhost.com
Then it will call maillist 1 or maillist 2 accordingly.
I have also removed the command-line arguments of the script as you no longer really need them, since one email address can now handle multiple lists.
I am releasing my version under the GPL if blackops does not object, and have attributed you(blackops) in the copyright notices.
Anyway, I hope this is useful...
-
Attachment: popfud.php
(Size: 4.37KB, Downloaded 1495 times)
[Updated on: Tue, 25 November 2003 20:32] Report message to a moderator
|
|
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17335 is a reply to message #14970] |
Fri, 26 March 2004 13:36 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
hi there,
I didn't try the code yet, but I must say it's a great idea to have it done this way. Searched the web for all mailinglist forums, but this fudforum seemed to be the easiest to install for a noobie like me. Phpbb also has some mailinglist script(m2f/cm2f), but that's a nogo on the ported version for phpnuke
Mailgust didn't work for me, so...this fudforum is great. But the procmail delivered me headaches. Searched for days, and now there is this great news, u guys GOT A SCRIPT to make it work without it!!!!
Tnx, tnx, tnx...Fudforum should have this option included by default. I will try it instantly...
Greetings,
yeroen
|
|
|
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17340 is a reply to message #17338] |
Fri, 26 March 2004 14:20 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
hm,
not so simple as I first thought
I uploaded the script to: http://geestbeest.ath.cx/fudforum2/scripts/popfud.php
When I launch it from the browser, it says:
Fatal error: Call to undefined function: imap_open() in F:\www\FUDforum2\scripts\popfud.php on line 44
The commandline involved is:
$mbox = imap_open ($mb, $usr, $pwd) or exit("Invalid server, username, or password.\n");
I'm not sure, but can it be a pathproblem? I had several errors, installing scripts, which were not in my serverroot.
yeroen
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17342 is a reply to message #17341] |
Fri, 26 March 2004 16:04 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
ow,
Now, I don't want to be the noobie-whiner, and it seems there are ALOT of extra fine proggies, which work greatly under linux.
But...for the sake of the non-techies/dumbass windows-user masses(including me), isn't there another function to access the popserver via this script, without installing extra requirements?
Tnx so far for your support,
yeroen
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17345 is a reply to message #17343] |
Fri, 26 March 2004 17:52 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
well,
u helped me alot allready though. guess the module pop3.php, which phpnuke uses, does the same thing as the imap-option in php. I'm just playing with the options, to try implement them in this great script, which I got from here. I have the php-file in an attachment. Don't know if it's any good, but so far I see new options!
maybe its possible to implement it within the included pipefunction?
Well, hope u can help me with the code...
Yeroen
-
Attachment: pop3.php
(Size: 11.04KB, Downloaded 1139 times)
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17352 is a reply to message #14860] |
Fri, 26 March 2004 22:22 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
hi there,
I replaced all imap-functions, with those of the pop3.php. The code seems to be errorfree, but it does nothing
It runs for about 20 secs in the browser, and after that, it says "ready". Nothing really happened in fudforum though.
I'll try to fix it myself, but my knowledge only reaches the "grab and steal"-altitude. Maybe some1 can take a look at it?
I suspect that the program doesn't know in which fudmaillist to put the e-mails 2. It also doesn't delete the e-mails, for some reason.see the attachments for pop3.php, and fudphop.php.
paiz,
yeroen
-
Attachment: fudphop.php
(Size: 2.62KB, Downloaded 1113 times)
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #17356 is a reply to message #17355] |
Sat, 27 March 2004 02:19 |
yeroen
Messages: 11 Registered: March 2004 Location: Delfzijl , The Netherland...
Karma: 0
|
Junior Member |
|
|
Sigh,
Just can't get it RIGHT !!!
I found out, that the maillist-script wasn't running at all. Because I don't have cron, and I want to run the script from another php-script, I thought about include(maillist.php), which will get it running. But there are no parameters included, so maillist, is bugging me for a forum_id :S
I can't find out what I have to change in maillist.php, to make it work. Im tired...
so..work for tommorow is: exporting the scriptNum-variable somehow :S
I don't know anymore. gotta sleepppppzzzzzzzzzzzzzzzzzzzz
need hwwwaaaeeeeelp btw,
yeroen
|
|
|
|
|
|
|
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #18258 is a reply to message #18257] |
Fri, 14 May 2004 22:10 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
The reasons the instructions are *nix specific is because Windows system is really not well suited for such tasks. While it is possible to make it work, it is not exactly pleasant.
Windows does not have an easy automated mechanism for running a certain application every X amount of minutes/seconds/hours. So, your first task is to find a windows tool that will allow you to do just that.
Windows also does not handle e-mail in the same way *nix system do, so you cannot use procmail or similar. You need a separate script that can talk to POP3 or IMAP server and retrieve the message from those servers. The popfud.php script supposedly talks with POP3, but I didn't not write and can't say anything about it's usability.
Once something had retrieved the entire message (headers & message text) this data needs to be piped to the maillist.php who will then use this data to import a message into the forum.
FUDforum Core Developer
|
|
|
|
|
|
|
Re: Mailing List Functionality w/crontab, instead of .procmailrc or .forward [message #18263 is a reply to message #18262] |
Fri, 14 May 2004 23:54 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
FUDforum doe not come with mailing list manager. It comes with functionality that allows messages from a mailing list to be posted to the forum and vice versa.
The problem if you can call it that, is that Windows lacks utilities that are standard on *nix that allow messages to be imported relatively simply. Since Windows lacks these utilities the process is far more complicated as you are quickly discovering.
Consequently these utilities need to be substituted by something else that would be of use on only Windows OS. Given that fact, I have little interest of spending time developing these utilities.
FUDforum Core Developer
|
|
|
|
|
|
|
|