Log in

View Full Version : Discussion: Forum participation by email


JamesUS
03-22-2001, 05:27 PM
I've decided to try and construct this hack but would like some input first if possible :)

From other threads and my own ideas, here is how I think it should work:

User subscribes to the forum(s) that he/she would like to participate in via email. They then receive emails on every new thread and post in that forum.
To reply, they simply hit reply in the email client. The userid and encrypted password would be stored in the subject line of the email (hence would still be there after reply). These would then be matched to the user's email address when the mail reaches vB.

To start a new thread I am not sure of yet, we either have:
-there is a link in all mails "start a new thread in this forum"
-an initial email when joining contains links to start threads in all of the forums
-send mail to "generalchat@vbulletin.com" for example.

On the vB side, mail would go to a POP mailbox on the server. This would be checked every x minutes through a cron job - if anyone has any better ideas as to how to do that please let me know - I'd rather avoid cron if possible but can't see any other way.

03-22-2001, 05:41 PM
I'm not sure I understand. So, a member would actually be able to post to the Forums via an e-mail? If this is the case, this is a very cool idea!!!

03-22-2001, 05:44 PM
Yes that is true - there have been a couple of discussions on this in the past.

Many users prefer the newsgroup style stuff (ie email) rather than web-based forum access so I have decided to give this hack a go.

03-22-2001, 05:52 PM
Sounds good to me. I'd definitely be interested in this hack as it would definitely prove beneficial to those people that are still (in this day and age) afraid of "the web" but not too afraid to use an e-mail client.

03-22-2001, 06:08 PM
It is not that people are afraid. TO many, email is easier to use than a web-based solution.

03-22-2001, 06:26 PM
I know this would be EXTREMELY popular on our board as long as they can subscribe to certain forums. With over 5000 posts a day, that's a lot of email!

03-22-2001, 06:44 PM
I agree with Me2Be

I would never use that feature, bacuase say there was 10 posts a day in the forum, and thats small, it would still annoy me having all that email

I would read every one at first, but get tired of it and start deleting without reading.

Imagine there was 1 post with 100 replies

I would not want 100 emails in my inbox about one thing....

My normal email would get lost in it.

The only solution would be to get an email only for this

But then I could just go to the forums instead and read all posts with their replies together

So...... I don't see much point in it, and wouldn't use it ever.....

But thats just my 2 cents

Peace out

03-22-2001, 08:43 PM
i believe that that would be the best way to go aobut it. Connect to the pop3 bobx and check for new mails. it is much better than piping all the email throught a script.
is there any way that it can be done like

$subject=Email posting
$body=i like this email posting stuff.

but that might be to complicated. are you going to do it so that the subject line tells where the post should go? or the email adress says where to go.

i don't think that the user will get every email posted in a particular forum. i think that the user should be able to post from his/her email. and when someone replies to his/her email they will get the replies. and instaed of having to go to the forum the user should be able to reply to the email instead of having to go the forums to post.

i don't think that it should be an email discussion list, but a way for users to post/reply via email.

03-23-2001, 05:14 AM
In the past there have been requests for a full discussion list by email so I will do both :)
I think the Subject has to determine where the post goes - it could also go at the bottom of the mail under a seperator of some sort but the subject is easier.

03-23-2001, 09:35 AM
I just wanted to add I think this is a great idea.... I would certainly use a hack like this.

03-23-2001, 11:32 AM
The only problem is moderating the pop3 account. I am looking into a similar solution that would use a daemon to monitor incoming email. However since we use qmail, it would not be necessarily portable to other systems.

This daemon would call a PHP script everytime a new message arrives and feed it the message. This would then put the message in the database properly. Using a CRON job can cause your messages to get out of sync and create confusing threads. The best way to do it automatically is through a daemon.

There would be no reason to send the userid with the message because you will have the email address in the "Sender" field of the email. If it isn't an address from a valid vBulletin user you simply send back a auto-response saying that the message wasn't allowed and send it to /dev/null. This is the same way YahooGroups (formerly eGroups) works.

Basically I see a clean header looking like:
#XXXXXXX This is the thread Subject

Where the XXXXXX represents the Threadid. There is really no reason for anything else to be included. With the Threadid you can put it where it belongs and with the email address in the "Sender" field you can match it with the user.

03-23-2001, 11:53 AM
If only the senders email is checked users can easily fake someone else's ID; Just configure their email-address in you mail program as your email adress...

03-23-2001, 02:12 PM
Originally posted by Mas*Mind
If only the senders email is checked users can easily fake someone else's ID; Just configure their email-address in you mail program as your email adress... VERY good point...

03-23-2001, 04:06 PM
Another point to consider: You could do something similar to Yahoo! Groups / eGroups where the to field determines where it goes. e.g. This forum is called vBulletin Code Hacks. To send a post via email to it, address the email to vbulletin_code_hacks@vbulletin.com and that would help sort them on the way in. For a site with hundreds of forums (ascifi.com comes to mind), that could either be a help (pre-sorting makes it a little more efficient) or a hinderance (too many addresses to keep track of), but for a site like this or like SPF, it wouldn't be too bad.

03-23-2001, 04:08 PM
Originally posted by tubedogg
Another point to consider: You could do something similar to Yahoo! Groups / eGroups where the to field determines where it goes. e.g. This forum is called vBulletin Code Hacks. To send a post via email to it, address the email to vbulletin_code_hacks@vbulletin.com and that would help sort them on the way in. For a site with hundreds of forums (ascifi.com comes to mind), that could either be a help (pre-sorting makes it a little more efficient) I actually like that idea - I have over 140 forums and this would make it much cleaner!

03-23-2001, 04:14 PM
Really we don't need to think about Forums on a reply. The forumid simply doesn't matter since the post is attached to a created thread so for 90% of incoming mails this is irrelevant.

Using a full-featured email program, you can direct them to a "Catch-All account" that will be watched to and have emails pulled from it.

AS far as the email and password thing, eGroups doesn't require this and is able to catch it so there must be a way to do it. Granted they handle it in the email daemon because most scripts would be too "stupid" and could be fooled.

How does MajorDomo handle these things? Anyone pull it apart yet?

03-23-2001, 07:37 PM
Having email participation is interesting, but it should be configurable by forum.

I have forums where I want to send email to subscribers containing the contents of messages posted, however I want them to have to come back to the site to participate in the discussion.

I also have forums where participation by email would be great in both directions, and the forum would act principally as an archive.

I bought vBulletin in the first place because I did not want to just run MailMan mailing lists and MHonArc list archives on my site. I could have done that without spending a dime on vBulletin...

03-29-2001, 02:36 AM
This hack is definately a "thumbs up"...

I would use this feature to include our Email mailing lists with the web-based forums. It's also a very good way to archive email mailing lists and digestified formats.

We currently have two mediums and I'd like to integrate them both seamlessly. This is a perfect hack for that.

-- Mike

03-29-2001, 04:10 PM
I, too, would be able to make great use of this. I actually have a user that has worked up his own script that will post to the forum although it's not easily expandable. Some type of integrated solution would be great!

Let us know if there's any progress on this . . .

03-29-2001, 04:28 PM
I'm going to give this a shot during the school holidays (week after next), so watch out for a release in a few weeks :)

03-29-2001, 04:44 PM
Originally posted by JamesUS
I'm going to give this a shot during the school holidays (week after next), so watch out for a release in a few weeks :)

Easter Holidays?

03-29-2001, 05:28 PM
Yup :)

Sarge
04-10-2001, 05:40 AM
Easter is coming up!
IS this still a go?

MrLister
04-10-2001, 12:58 PM
add restrictions so only like 100 e-mails per day to one user.

JamesUS
04-10-2001, 01:31 PM
Yes I still plan to do it but I doubt it will be done any time particularly soon - it is a major hack to make.

Sarge
04-10-2001, 02:59 PM
this could double the size of my board!

dons
04-10-2001, 10:14 PM
The ability to receive a digest goes hand and hand with this I think. dcs

chrispadfield
04-12-2001, 10:44 AM
i did start this a while ago, and got somewhere but not very far. Just in case this is any use to James:


<?

require("./admin/global.php");

function pop3_open($server, $port)
{
global $POP3_GLOBAL_STATUS;

$pop3 = fsockopen($server, $port);

// Maybe some people need something like:
// $pop3 = fsockopen($server, $port, &$errno, &$errstr, 30);

if ($pop3 <= 0) return 0;

$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

return $pop3;
}

function pop3_user($pop3, $user)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "USER $user\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

return 1;
}

function pop3_pass($pop3, $pass)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "PASS $pass\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

return 1;
}

function pop3_stat($pop3)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "STAT\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

if (!eregi("+OK (.*) (.*)", $line, $regs))
return 0;

return $regs[1];
}

function pop3_list($pop3)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "LIST\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

$i = 0;
while (substr($line = fgets($pop3, 1024), 0, 1) <> ".")
{
$articles[$i] = $line;
$i++;
}
$articles["count"] = $i;

return $articles;
}

function pop3_retr($pop3, $nr)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "RETR $nr\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

$i = 0;
while (substr($line = fgets($pop3, 1024), 0) != ".\r\n")
{
$data[$i] = $line;
$i++;
}
$data["count"] = $i;

return $data;
}


function pop3_dele($pop3, $nr)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "DELE $nr\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;


return 1;
}

function pop3_quit($pop3)
{
global $POP3_GLOBAL_STATUS;

fputs($pop3, "QUIT\r\n");
$line = fgets($pop3, 1024);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] = substr($line, 0, 1);
$POP3_GLOBAL_STATUS[$pop3]["LASTRESULTTXT"] = substr($line, 0, 1024);

if ($POP3_GLOBAL_STATUS[$pop3]["LASTRESULT"] <> "+") return 0;

return 1;
}


// end of class.. this is where it starts :)



### CONNECT TO POP3 SERVER


// so we are connecting
$pop3 = pop3_open("mail.techuk.com", "110");
if (!$pop3) {
printf("[ERROR] Failed to connect to localhost<BR>\n");
return 0;
}

// with thus username
if (!pop3_user($pop3, "testing@ascifi.com")) {
printf("[ERROR] Username failed!<BR>\n");
return 0;
}

// and this password
if (!pop3_pass($pop3, "****")) {
printf("[ERROR] PASS failed!<BR>\n");
return 0;
}


### END OF CONNECTION


### FIND OUT HOW MANY ARTICLES - FUTURE LOOP

// finding out how many articles there are. if none giving error message i think
$articles = pop3_list($pop3);
if (!$articles) {
printf("[ERROR] LIST failed!<BR>\n");
return 0;
}


$listit = pop3_list($pop3);

$numrows = count ($listit);
for ($count = 0; $count < $numrows; ++$count) {

echo HtmlSpecialChars($listit[$count]);
echo "<br>";
}


### END OF ARTICLE COLLECTION

// re-fresh $count
$count = 0;

### PROCESS THE EMAIL ###

// first lets retrieve the email
$data = pop3_retr($pop3, 8);

// start loop on email array
$numrows = count ($data);
for ($count = 0; $count < $numrows; ++$count) {

// create variables from the whole message
$message .= HtmlSpecialChars($data[$count]);
$message_html .= HtmlSpecialChars($data[$count]);
$message_html .= "<br>";

// check to see if divide, if so tell script we are no dealing with the body
if ($data[$count] == "\r\n") {
$stop = "1";
}


## we are doing header stuff here ##
if ($stop != "1") {
$header2 .= $data[$count];

// first lets get the subject

if (eregi("Subject:", $data[$count], $arr)) {
$subject = substr($data[$count],9);

echo "<b>have found the subject</b><br>";
} else {
echo "failed to find the subject<br>";
}

// second the return email address

$foo = 'From: "Chris Padfield" <chris@freeontheweb.com>';

if (eregi("<([^>]*)>",$data[$count],$arr)) {
$email = $arr[1];

echo "<b>have got email</b><br>";
} else {
echo "failed to get email<br>";
}

## now we are creating the body ##
} elseif ($stop == "1") {


$body2 .=$data[$count];
}


// end the email array loop
}

### EMAIL HAS BEEN PROCESSED ###


### CHECK TO SEE IF USER IS BANNED ###

// first check to see if this user has been banned.

if ($email == "banned") {

echo "sorry.. you are banned ....";

} elseif ($ip == "banned") {

echo "sorry.. you are banned ....";

} else {


### END OF USER BANNING CHECK ALTHOUGH } CONTINUES TO END ###



### WHAT DO WE DO BASED ON SUBJECT ###

// first if empty:

if ($subject == "") {

echo "Uh oh, the subject is empty";

} elseif ($subject == "help") {

echo "ar... we need to send help now";

} elseif ($subject == "new thread") {

echo "we now need to start a new thread";

} elseif ($subject == "Subscribe") {

echo "we need to subscribe them to this forum";

} elseif ($subject == "Unsubscribe") {

echo "we need to unsubscribe them to this forum";

} elseif ($subject == "daily") {

echo "we need to change settings to daily";

} elseif ($subject == "instant") {

echo "we need to change settings to instant";

} else {

// now a "command" so probably a post (or an error). Need to extract info from subject.

$delimiter == "**";


if (eregi("([[:digit:]]{1,})",$subject,$arr)) {

$threadno = (trim($arr[1]));
echo $threadno;

} else {

echo "Serious problem... did not match anything at all! Send back email with error message";

}


// end of subject matching
}

// end of email and ip address check
}

### END OF SUBJECT PROCESSING ###







#### done parsing, lets do some printing of found variables

echo "<b>Subject:</b><br>";
echo subject;
echo "<P>";
echo "<b>Email:</b><br>";
echo $email;
echo "<P>";
echo "<b>Clean Subject</b><br>";
echo $threadno;
echo "<P>";
echo "<B>Message Html</b><br>";
echo $message_html;
echo "<P>";
echo "<B>Header:</b><br>";
echo $header2;
echo "<P>";
echo "<b>Body:</b><br>";
echo $body2;



?>

JamesUS
04-12-2001, 04:11 PM
Thanks Chris - much appreciated :)
I will go through it properly a little later on :)

writhe
07-19-2001, 07:42 PM
JamesUS-

Did you ever write the hack? I'm looking into setting up a bulletin board but am desperate to have your email support as a feature. Please let me know if it is finished, will be finished soon, or if someone else has already done so.

Ivan
07-20-2001, 04:43 PM
I think most people read message board only once a day.

They would like to receive the daily report of all new messages from the selected threads or forums for the appropriate time. That wouldn't get much resources from the server.

Also, don't forget about undelivered mail when user's e-mail account isn't working anymore. The script must gather statistics about all mail returning back and automatically remove subscriptions from those accounts that don't reply for the selected period of time.

RobAC
07-20-2001, 04:46 PM
Here's an idea.....would it be possible to use tubedogg's Community Bulletin Generator hack as a base....add in the option to allow the user to choose either a daily, weekly or monthly receipt and tie it into a cron job? :D :D

chrispadfield
07-20-2001, 05:02 PM
sending emails is the easiest bit, it is allowing for replies that is the hardest. All the work i had done was on sorting out replies. I am currently working on this pop3 class for another project and there is a chance i will have a go at it again when that is finished.

The community bulletin generator can be run as cron (if php is stored in apache you need to run it throuh a lynx command (thanks sitepointforums.com !).

Ivan
07-21-2001, 07:10 AM
The board could send an e-mail with
nicely formatted html-attachment, maybe zipped.

html page could consist of tables for every
thread with colors but without graphical elements.

And three or more links at the bottom of every table:
post message, post thread, remove subscription
like

<a href="mailto:forum@forum.com?subject=act=pm|||userid=1|| |userpassword=777777|||threadid=1">post message</a>

A user could download this e-mail and then write his answers offline.
That would reduce his Internet access costs and attract more dialup
users to the forum.

Ivan
07-21-2001, 05:37 PM
By the way, why do you need pop3 module?

You can simply add the new entry in aliases file for sendmail like:
forum: "|/home/forum/emailarrive.sh"

When the new e-mail arrives it's piped to the shell program that can parse it.

chrispadfield
07-22-2001, 03:19 AM
Originally posted by Ivan
By the way, why do you need pop3 module?

You can simply add the new entry in aliases file for sendmail like:
forum: "|/home/forum/emailarrive.sh"

When the new e-mail arrives it's piped to the shell program that can parse it.

you probably don't, but i can't program in shell so php was going to be the way i would do it. also, not everyone uses sendmail, i for instance use qmail.

Glen C
08-28-2001, 12:45 AM
bump/subscribe ;)

DiscusPro has this feature, which is very handy. You can subscribe by "forum" to receive each post in your mailbox. Very handy, especially if you have a spare POP box.

rawnet
01-19-2002, 02:23 PM
Hi James,

Just wondering if you ever managed to achieve this?

It is a massive job - looks like you were interested in doing it almost a year ago now, but was wondering if you followed it up. I wish vBulletin would integrate this kind of functionality as an option - it would boost it to a position that could not be contended by any other forum software.

Some people get confused about email notification and do try replying via email - it is much easier and quicker than logging into the web and should increase the number of posts dramatically.

BustaCap
02-10-2002, 04:41 AM
I would be really interested in this hack as well. Is there hope of an eventual release?

JamesUS
02-12-2002, 03:40 PM
I would absolutely love to do something like this...but I just haven't had the time this last year. I will see what I can come up with in the next few weeks, as it should be a tad easier than it would have been last year when it would have been based on vB 1.1.x.

Though I'm still slightly reluctant to do any major hacks before v3 is at least in private beta, as the whole vB backend is changing around with the new release.

BustaCap
02-13-2002, 02:42 AM
I'm glad to hear that this project may still happen. Given the level of interest shown here I'm sure it would be a popular hack.

BillP
03-08-2002, 02:53 PM
I'd be interested in a SUBSET of this hack.

I run a mailing list. I'd like to archive the posts into a READ ONLY vBulletin forum. So my email list users could use the search functions of vBulletin to read through the archives.

Features I'd like to see include obfuscation of email addresses, in order to prevent spiders from using them for spam.

What we really need is a command line utility to inject a thread or post. Maybe the logic for "new thread or append to old" is in the utility, or not.

What I would do, if I had the time and expertise, is base the thread on the subject line automatically, and that's about it. A single forum for a mailing list, read only, with straight email injection based on subject line.

BillP
03-08-2002, 07:52 PM
Originally posted by nicksaunders
and the command-line thing is a good idea, but simple-minded users ;) might not be able to use it...

It wouldn't be for use by end users!

vbull-injector@mydomain.com would be a user in the mailing list subscription. He gets a copy of each post to the list.

vbull-injector is aliased as a pipe to a command line. This is the way Majordomo and MailMan (list managers) handle mail. The injector program would do the same.

I'll probably end up doing this myself. This subset is so easy in comparison to the application you are discussing here. No authentication is necessary. Just the "threading" piece, which is simple enough to do via SQL.

N!ck
03-08-2002, 10:08 PM
oh, come on bill... no making false quotes ;)

Stylez
03-09-2002, 03:48 PM
i would be very interested in this, as its a great idea. it might actually get some of my board members to subscribe to a forum =p.

mashby
06-25-2002, 02:46 AM
I run a web site for Palm User Groups (aka PalmPilots, PDAs, etc.). We host these groups for free and offer support and assistance in helping them run their local organization. Given our position, we are constantly facing the issue of mailing list vs. online forum.

Some users prefer mailing lists, some prefer online forums. It's a discussion that we have time and time again. Then there's the small group that want both. :) The hurdle I'm faced with is that we have to try and support any one, if not all of these options. The one that I've not really supported has been e-mail lists and those PUGs have turned to Yahoo Groups.

In the last year, I've become more and more familiar with vBulletin and have truly fallen in love. :knockedout: and I'm constantly amazed by what can be done with it and I'm really interested in this thread.

======================
E-mail vs Forums
======================
Pro E-mail: Those who prefer mailing lists, appear to like the fact that they can easily participate in discussions simply by using e-mail. No need to log-in to a web site, browse various forums, etc.

Pro Forum: Those who prefer forums like the fact that threads are organized and that you can review all posts when it's convenient, etc. Of course we all here don't have go on how great forms are here. :D

======================
Can We Get The Best Of Both Worlds?
======================
So can this elusive hack bridge the two and create the best of both worlds? Allow those users who prefer e-mail to post and respond via e-mail and those users who prefer to use forums to access vB as normal? I'd like to think so, but has this hack taken any form?

I noticed this thread (https://vborg.vbsupport.ru/showthread.php?s=&threadid=35247) regarding the E-mail gateway support and it would appear that this hack could be a start. However, I don't know any site that is using this with e-mail.

======================
Throw A Bone
======================
Anyone know if there's a way to merge the best of Yahoo Groups and the best of vBulletin into one total solution? Any help on this subject would be most appreciative.