FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Mailing list integration help?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Mailing list integration help? [message #12058] Sun, 27 July 2003 08:50 Go to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
I am trying to implement mailing list integration on a site where the client uses a shared hosting setup that does not allow the use of procmail, etc., to process incoming mail. Basically, the shared mail server is inaccessible to the client's account.

The feature to send new posts from a forum to the mailing list works fine, but, obviously, new messages to the mailing list do not get posted to the forums. Is there any way to make this work (some sort of email alias, or something?) without being able to pipe the incoming mail to maillist.php?

This may sound like a stupid question, but I just want to make sure I exhaust all possibilities, before I tell my client this won't work. Thanks in advance! Smile
Re: Mailing list integration help? [message #12064 is a reply to message #12058] Sun, 27 July 2003 17:19 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
maillist.php is pretty flexible in the way it can accept a message. To put it simply, you can pipe the entire message to the maillist.php script and it'll work.
So you could do something like this:
<?php
exec
("cat message | php -q maillist.php [list_id]");
?>


FUDforum Core Developer
Re: Mailing list integration help? [message #12107 is a reply to message #12064] Mon, 28 July 2003 19:35 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
Thanks for the quick reply. I know that procmail isn't the only way to pipe the messages. I guess my real problem probably stems from a lack of *NIX knowledge.

If my mail server is on a different machine, and the messages are received there, and then delivered...and I don't have access to that machine...I do not know of a way to get the contents of those messages routed to a place from which I can pipe them into maillist.php. I'm pretty sure the answer is, "You can't," but I wanted to try. Smile

Thanks again.

[edit]
BTW, I think FUDForum is great. Flexible and well-written. A worthy competitor to the more popular forums out there.

[Updated on: Mon, 28 July 2003 19:40]

Report message to a moderator

Re: Mailing list integration help? [message #12110 is a reply to message #12107] Mon, 28 July 2003 19:57 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I am guessing that to fetch the messages from the remote server you use POP3 or IMAP. The solution then is to write a simple POP3 or IMAP fetch code that would fetch the message and pipe it to the maillist.php script. PHP has an imap extension that could make this very easy to implement using PHP.

FUDforum Core Developer
Re: Mailing list integration help? [message #12111 is a reply to message #12110] Mon, 28 July 2003 20:00 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
Ah...yes, that is exactly what I was looking for. In other words, if I set up an alias that sends messages to the actual mailing list, as well as a pop account, I could grab the messages from the pop account on a regular basis and populate the forum threads. Excellent. Thanks for the suggestion! I'll reply back with my status when I've given it a try.

Thanks.

[Updated on: Mon, 28 July 2003 20:01]

Report message to a moderator

Re: Mailing list integration help? [message #12128 is a reply to message #12111] Tue, 29 July 2003 20:01 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
Okay. I decided how I will do this. I will create a POP account for the forum, and that POP account will subscribe to the mailing list. I will then set up a cron to periodically fetch the mail from the forum's POP account to populate the forum for that mailing list.

Do you have any suggestions for where to look to find guidance for setting up such a shell-level POP fetch? Thanks!
Re: Mailing list integration help? [message #12139 is a reply to message #12128] Tue, 29 July 2003 22:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Look at various php libraries that import mail from pop3

FUDforum Core Developer
Re: Mailing list integration help? [message #12140 is a reply to message #12128] Tue, 29 July 2003 22:11 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
Okay. I have written a PHP script that reads a message and outputs the header+body. If I cat that result into maillist.php with the proper ID number, then the message shows up as a new post in the forum.

The only catch is, every single message seems to show up as a new post, even if it is a reply to a previous message...that doesn't seem like it's the intended result. Any suggestions?

[Updated on: Tue, 29 July 2003 22:11]

Report message to a moderator

Re: Mailing list integration help? [message #12142 is a reply to message #12140] Tue, 29 July 2003 22:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Hmm sounds like your messages are missing a header that helps the forum identify replies. Make sure that ALL headers are included in the data that you pass.

FUDforum Core Developer
Re: Mailing list integration help? [message #12143 is a reply to message #12142] Tue, 29 July 2003 22:18 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
Messages: 12
Registered: July 2003
Karma: 0
Junior Member
Okay, so this is based on the actual mail headers. It looks like my code was actually working, but I wasn't sending true replies (long story...basically erroneous testing procedures).

Thanks so much for the feedback. I'll post my complete solution when I'm done with it.

...and I'll ask more questions in this thread if I hit any more speedbumps! Smile
Re: Mailing list integration help? [message #14787 is a reply to message #12058] Thu, 20 November 2003 20:46 Go to previous messageGo to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
Ok, I have a question, I can easily make code to dump a single message out to this board from a POP3 server, but how do I pipe multiple messages to the mailinglist.php script? What will it be looking for as far as multiple messages are concerned? Or is it looking for one call for each message?
Re: Mailing list integration help? [message #14789 is a reply to message #14787] Thu, 20 November 2003 22:01 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The maillist script expects you to give it 1 message at a time...

FUDforum Core Developer
Re: Mailing list integration help? [message #14792 is a reply to message #12058] Thu, 20 November 2003 22:14 Go to previous messageGo to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
Ok, I am getting the pieces together for a POP3 import script.

Re: Mailing list integration help? [message #14824 is a reply to message #14792] Fri, 21 November 2003 18:24 Go to previous messageGo to next message
blackops is currently offline  blackops   United States
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. Here is the code. Notice the few places I have <TEXT>. Please replace those occurrances (including the "<" and ">") with the actual values.

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

[EDIT: instead of pasting script contents, attached script as file.]
  • Attachment: fudmail.php
    (Size: 1.25KB, Downloaded 576 times)

[Updated on: Fri, 21 November 2003 18:26]

Report message to a moderator

Re: Mailing list integration help? [message #14826 is a reply to message #14824] Fri, 21 November 2003 18:32 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Please reports this in the hacks forums, where people who maybe looking for similar code would be looking for it.

Thanks.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Email notification question
Next Topic: remove 'update' button
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 11 21:20:49 GMT 2024

Total time taken to generate the page: 0.02567 seconds