vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - Email Integration (New threads/replies by email) (https://vborg.vbsupport.ru/showthread.php?t=151222)

Cyricx 08-28-2007 05:37 PM

No, it's something I haven't been able to incorporate yet.

The biggest brainfart is how I'm going to have people define prefixes when they are sending a new thread without it being a pain in the ass.

Cyricx 08-28-2007 05:39 PM

I'll be lookin for beta testers very soon as I'm going to rewrite the regex from the ground up.

So far 2.3 will have:
  • Memory saving code fix for bbcode parser - DONE 8/28!
  • vbmail for posts of threads and replies from forums - DONE 8/28!
  • select which folder emails pull from per email address - DONE 8/28!
  • Added error message for what forum is causing the error when manually running the cron job - DONE 8/28!
  • Added userid to the display output for the autosubscription script - DONE 8/28!
I'm currently working on vbmail to be used for the cronjob and for a userinterface for forumsubscriptions. The interface skeleton code was provided by Ed. I've almost got it reformated to be able to handle mass appeal :)

edit - o yeah... duh. to be a beta tester PM me please and I'll reply with the url and logins for the test site.

AyeCapn 08-28-2007 05:53 PM

Quote:

Originally Posted by Cyricx (Post 1327503)
No, it's something I haven't been able to incorporate yet.

The biggest brainfart is how I'm going to have people define prefixes when they are sending a new thread without it being a pain in the ass.

parse it from the subject line?

cgmckeever 08-28-2007 06:13 PM

RE: subject prefixes

Well - I may have come up with a workaround for the email replies --
it pulls a default prefix for the forum and applies it accordingly -- works in my test cases.

If you could give me a hint how to change the out bound email subjects both via a forum post and a email response, that would be HUGE


FIRST:
update the product-threadprefix_english.xml in two spots:

Code:

// product-threadprefix_english.xml
if (!verify_thread_prefix($this->info['forum'], $this->info['threadprefix']))
{
    // added to get default prefix - cgmckeever
    $this->thread['threadprefix'] = return_default_prefix($this->info['forum']);

    // removed for email integration - cgmckeever
          //$this->error('nothreadprefix');
          //$return_value = false;
}

SECOND:
add a lookup function in functions_threadprefix.php:

Code:

// includes/functions_threadprefix.php               
// returns the first prefix of a forum
function return_default_prefix($foruminfo){
  $prefixes = explode("\r\n", trim($foruminfo['threadprefix']));
  // print $prefixes[0];
  return $prefixes[0];
}


Cyricx 08-28-2007 06:47 PM

Quote:

Originally Posted by AyeCapn (Post 1327514)
parse it from the subject line?

I can totally do that for replies, and can start off the prefix with the new threads that start from the forums. But concern is how do you assign prefixes to new threads started from email? :)

The only way I can think of would be requiring the person to put like

(this is the prefix) Email title

in the subject line, but that way they would have to know all the prefixes to know which one to choose :(


Quote:

Originally Posted by cgmckeever (Post 1327532)
RE: subject prefixes

Well - I may have come up with a workaround for the email replies --
it pulls a default prefix for the forum and applies it accordingly -- works in my test cases.

If you could give me a hint how to change the out bound email subjects both via a forum post and a email response, that would be HUGE

I'll have to work this into the next beta. If you tack on the prefix to the subject line, it will continue to grow and grow and grow and eventually if the thread gets 20 replies, your subject line will become nothiing more then the prefix repeating itself :)

The default prefix is a great idea though!! For forums that require a threadprefix, I can have it use the default one. I'll work this into the next version provided the regex's don't make my brain explode :)

cgmckeever 08-28-2007 06:53 PM

Quote:

Originally Posted by Cyricx (Post 1327553)
I'll have to work this into the next beta. If you tack on the prefix to the subject line, it will continue to grow and grow and grow and eventually if the thread gets 20 replies, your subject line will become nothiing more then the prefix repeating itself :)

The default prefix is a great idea though!! For forums that require a threadprefix, I can have it use the default one. I'll work this into the next version provided the regex's don't make my brain explode :)

Thats a good point on the repeating PREFIX
how does the code handle the current prefix when a user hits reply?

Cyricx 08-28-2007 06:56 PM

Disregards it when it sends out the email right now. It doesn't prefix the title in the emails.

I did it that way til I could determine a good method to assign prefixes to newthreads from email.

I think I'll go with the default method.. maybe I'll work it into the forum manager so you can select which prefix to assign to new threads started from email. Hmmm much to think on :)

cgmckeever 08-28-2007 07:25 PM

I must be doing something wrong then, because mine definitely prefixes the titles

[Development-t-9] Why is there no user prefix

Any ideas?

Cyricx 08-28-2007 07:31 PM

Your forums do. But the emails do not, to keep them from repeating themselves indefinately.

As I mentioned, I did it this way til I could determine how I would assign prefixes for new threads from emails :)

Most likely the next version will support thread prefixes. It entirely depends on how severe rewriting the regexs will be.

If they take a long time then I'll release 2.3 without the thread prefix support and work on that for 2.4. As right now, the regexs take priority :)

But I will definately have support for thread prefixes soon! As I use those as well on my forums :)

cgmckeever 08-28-2007 07:57 PM

Quote:

Originally Posted by Cyricx (Post 1327582)
Your forums do. But the emails do not, to keep them from repeating

That is the subject line that is sent via email ---
maybe we aren't on the same page here. But the title definately gets a prefix slapped onto it
when it is sent to the email recpts.


UPDATE: maybe the EI script is using the parent (top level) title -- ?
in that case, you never have to worry about the growing subject. The sendder can change the title and it always rverts back to the originating parent thread ??

Cyricx 08-28-2007 08:10 PM

I'll have to check into the code. I'll check it out when I start on the vbmail handling for the cron job.

cgmckeever 08-28-2007 08:18 PM

Thanks -- side note.....

in the cron script, you may want to change:
$fromaddress = $letter->sender[0]->mailbox ."@".$letter->sender[0]->host;
to:
$fromaddress = $letter->reply_to[0]->mailbox ."@".$letter->reply_to[0]->host;
if(strlen($fromaddress) == 0) $letter->sender[0]->mailbox ."@".$letter->sender[0]->host;

the script fails for gmail sent as another user ... such as when I send from my company profile in gmail, the script still sees me as host=gmail.com

Cyricx 08-28-2007 08:20 PM

Quote:

Originally Posted by cgmckeever (Post 1327626)
Thanks -- side note.....

in the cron script, you may want to change:
$fromaddress = $letter->sender[0]->mailbox ."@".$letter->sender[0]->host;
to:
$fromaddress = $letter->reply_to[0]->mailbox ."@".$letter->sender[0]->host;

the script fails for gmail sent as another user ... such as when I send from my company profile in gmail, the script still sees me as host=gmail.com

It's supposed to fail :)

That's what keeps people from pretending they are someone else :)

If I didn't have that check in there, you could set your reply to address in gmail or yahoo as the admins email address and you would show to the forums as posting as the admin :)

To avoid that security loop hole, it checks who the actual domain is that is sending the email :)

Just use your true gmail address for your account and you will be fine.

cgmckeever 08-28-2007 08:30 PM

Quote:

Originally Posted by Cyricx (Post 1327627)
It's supposed to fail :)

That's what keeps people from pretending they are someone else :)

If I didn't have that check in there, you could set your reply to address in gmail or yahoo as the admins email address and you would show to the forums as posting as the admin :)

To avoid that security loop hole, it checks who the actual domain is that is sending the email :)

Just use your true gmail address for your account and you will be fine.


The only issue is, that if I really want to post as the ADMIN, I could just set up a whole profile in thunderbird or outlook and truly send as that person. Then the script will still pass the tests and post as a fake author.

So, putting that test in limits people who use services like gmail but have multiple profiles.

Cyricx 08-28-2007 08:49 PM

Quote:

Originally Posted by cgmckeever (Post 1327636)
The only issue is, that if I really want to post as the ADMIN, I could just set up a whole profile in thunderbird or outlook and truly send as that person. Then the script will still pass the tests and post as a fake author.

So, putting that test in limits people who use services like gmail but have multiple profiles.

You would have to have the password to login to the domain.

With yahoo I can go to the options, type whatever email name I want, and that would show up as me. I wouldn't need any passwords.

With outlook and thunderbird you have to have the password.

This is also why the error email that gets sent to you for the incorrect email address shows you the address that the modification sees you as having and has a link to update your email address :)

Your solution, doesn't require that people have a password or any access to the mailbox.

I'm not saying the method I'm using is perfect security... but it at least requires that you are on sending from the same domain as the email your trying to fabricate.

I'm sorry but I will not remove this feature for anything less then a more secure method.

Removing the prime security feature to me, is just not wise even if it's not the perfect method.

cgmckeever 08-28-2007 09:11 PM

Quote:

Originally Posted by Cyricx (Post 1327646)
You would have to have the password to login to the domain.

With yahoo I can go to the options, type whatever email name I want, and that would show up as me. I wouldn't need any passwords.

With outlook and thunderbird you have to have the password.
.

I dont need a password to send an email from a yahoo (or other webmail account) that is not mine -- PM me your email address and I will demonstrate this. Thus, anyone can get around the simple 'from' check ..

That is why I am saying it is not a security feature, it is reducing the usability actually more so than any security feature.

cgmckeever 08-28-2007 10:40 PM

If you add this code (in all spots cron and product xml) right after text_subject is defined, the EmailIntegration script will handle the custom prefixes _and_ use a default one if none is found - it seemed to already take into account the original prefixing anyhow [\$foruminfo[title_clean]-t-\$threadinfo[threadid]]:

Code:

// prefix code - cgmckeever

// use default
if (strlen($threadinfo[threadprefix]) == 0){
  $prefixes = explode("\r\n", trim($foruminfo['threadprefix']));
  $threadinfo[threadprefix] = $prefixes[0];
}
                                                       
// wrap the prefix
if (strlen($threadinfo[threadprefix]) != 0){
  $threadinfo[threadprefix] = str_replace('{1}',$threadinfo[threadprefix],$vbulletin->options['prefixmarkupalt']);
  $threadinfo[threadprefix] = str_replace(' ',' ',$threadinfo[threadprefix]);
  // get rid of built in prefix
  $text_subject = trim(str_replace("[\$foruminfo[title_clean]-t-\$threadinfo[threadid]]",'',$text_subject));
  $text_subject = trim("\$threadinfo[threadprefix] " . $text_subject);
}

// end prefix code - cgmckeever


Cyricx 08-29-2007 10:17 AM

Quote:

Originally Posted by cgmckeever (Post 1327663)
I dont need a password to send an email from a yahoo (or other webmail account) that is not mine -- PM me your email address and I will demonstrate this. Thus, anyone can get around the simple 'from' check ..

That is why I am saying it is not a security feature, it is reducing the usability actually more so than any security feature.

I emailed you an address for my test site and my admin address there to try to fake :)
Good luck! :)

Quote:

Originally Posted by cgmckeever (Post 1327700)
If you add this code (in all spots cron and product xml) right after text_subject is defined, the EmailIntegration script will handle the custom prefixes _and_ use a default one if none is found - it seemed to already take into account the original prefixing anyhow [\$foruminfo[title_clean]-t-\$threadinfo[threadid]]:

Code:

// prefix code - cgmckeever
 
// use default
if (strlen($threadinfo[threadprefix]) == 0){
  $prefixes = explode("\r\n", trim($foruminfo['threadprefix']));
  $threadinfo[threadprefix] = $prefixes[0];
}
 
// wrap the prefix
if (strlen($threadinfo[threadprefix]) != 0){
  $threadinfo[threadprefix] = str_replace('{1}',$threadinfo[threadprefix],$vbulletin->options['prefixmarkupalt']);
  $threadinfo[threadprefix] = str_replace(' ',' ',$threadinfo[threadprefix]);
  // get rid of built in prefix
  $text_subject = trim(str_replace("[\$foruminfo[title_clean]-t-\$threadinfo[threadid]]",'',$text_subject));
  $text_subject = trim("\$threadinfo[threadprefix] " . $text_subject);
}
 
// end prefix code - cgmckeever



I'll get this into the next live version! :)

Thank you!

Cyricx 08-29-2007 11:25 AM

Remember all, I am looking for beta testers!! be sure to PM me if you would like to help test the next version because I'll be rewriting the regexs in the upcoming version!

cgmckeever 08-29-2007 02:40 PM

OK - although the THREAD PREFIX script has its place, I didn't like the need for it to be installed to get the EI prefix to work.

You need to add a DB field ei_prefix:

Code:

ALTER TABLE forum ADD ei_prefix VARCHAR( 50 ) NULL;
This needs to be manually changed since I dont want to tinker with the EI admin script and keep this as simple to reimplement when changes to the EI codebase are made. (HINT HINT)

The below snippet needs to be added to the EI cron and product files right after:
Code:

$text_subject = replace_template_variables($text_subject);

Code:

// prefix code - cgmckeever
// check for ei_prefix defined
if (strlen($foruminfo[ei_prefix]) != 0){
  // get rid of built in prefix
  $text_subject =  trim(str_replace("[\$foruminfo[title_clean]-t-\$threadinfo[threadid]]",'',$text_subject));
  $text_subject = trim("\$foruminfo[ei_prefix] " . $text_subject);
}
// end prefix code - cgmckeever


Cyricx 08-29-2007 07:01 PM

Thanks!! I'll be adding this into the next version :)

Also note that I added an option to disable strict email checking for those like yourself that want to just check the "reply to" address.

cgmckeever 08-30-2007 01:45 AM

AWESOME
:up:

vrwired 08-30-2007 03:59 AM

i a little haze on this but i've run cron before --> what i'm missing here is what command (which script to call - emailintegration.php?) to run...

Cyricx 08-30-2007 11:44 AM

If you go to your admincp-> Scheduled Tasks -> Scheduled Task Manager ->

You should see Email Integration in that list of cron jobs. Click "Run Now" for the email integration and if there are any errors connecting to the mailbox, you will see them displayed there.

If there are not, your good to go and can setup the remaining forums with the same settings (but a different mailbox for each forum) and your good to go! :)

Piggo 09-01-2007 12:44 PM

Quote:

Originally Posted by Cyricx (Post 1327646)
-----
With yahoo I can go to the options, type whatever email name I want, and that would show up as me. I wouldn't need any passwords.
------
I'm not saying the method I'm using is perfect security... but it at least requires that you are on sending from the same domain as the email your trying to fabricate.

I'm sorry but I will not remove this feature for anything less then a more secure method.

Removing the prime security feature to me, is just not wise even if it's not the perfect method.

In what version was this added?
Because I was (unfortunately) successfully able to spoof the from-email, and post a message as a different user in my currently installed version (I think 2.1).
This security issue is the main reason I have not gone full scale yet with this mod, as I feared anyone could post as anyone else, providing they knew the other person's email addy.

cgmckeever 09-01-2007 08:10 PM

Quote:

Originally Posted by Piggo (Post 1330093)
In what version was this added?
Because I was (unfortunately) successfully able to spoof the from-email, and post a message as a different user in my currently installed version (I think 2.1).
This security issue is the main reason I have not gone full scale yet with this mod, as I feared anyone could post as anyone else, providing they knew the other person's email addy.

Piggo, I'll let Cyricx answer this more authoritatively -

I'm using this mod to mimic a mailing list, but also have the ability for users to search and post via the forum interface. The spoofing of users is intrinsic of mailing lists, and is something that I am comfortable with, seeing that I moved away form a mailing list - and came from that security level.

With that being said, the same issue exists for Yahoo groups, as someone can post as another user if they know the other users email address.

All in all, I think this plugin adds a great feature set, is well maintained, and is progressing well. Its honestly the major reason we moved from a pure mailing list environment.

-

TRR 09-02-2007 12:08 AM

Quote:

Originally Posted by Cyricx (Post 1319146)
This must be something specifically with godaddy. One of the sites I used to help build was hosted on a VPS (Virtual Private Server) with westhost and it allowed IMAP to be enabled.

I really want this feature but I am on godaddy as well; any suggestions for a host that can support this mod (imap already enabled)?

gonecountry 09-02-2007 12:47 PM

OK I have installed and reinstalled followed all directions completely, I have also tried pop3 imap localhost etc all variations. The hack is just not working right if I create a thread in an email and send it, it posts to the forum but I'm not getting a email when a thread is replied to. Please advise, thanks.

cgmckeever 09-02-2007 05:17 PM

@gonecountry - just making sure that you have subscribed to instant notification for the forum (not the thread)

Cyricx 09-04-2007 11:59 AM

Quote:

Originally Posted by cgmckeever (Post 1330341)
Piggo, I'll let Cyricx answer this more authoritatively -

I'm using this mod to mimic a mailing list, but also have the ability for users to search and post via the forum interface. The spoofing of users is intrinsic of mailing lists, and is something that I am comfortable with, seeing that I moved away form a mailing list - and came from that security level.

With that being said, the same issue exists for Yahoo groups, as someone can post as another user if they know the other users email address.

All in all, I think this plugin adds a great feature set, is well maintained, and is progressing well. Its honestly the major reason we moved from a pure mailing list environment.

-

Thanks CGMC! :)

Also another note to the code, is your email address is COMPLETELY hidden with this modification. The email that people get has the address for the forum's email box. When you reply back, any instances of your email in the message or anything that is sent to the forum to add the thread is removed! Or the next build will also actually replace any appearances of your email address with a link to the form to email a user :)

One of my biggest complaints about yahoo is that my personal email address is seen by EVERYONE on the list. Which makes the security hole that also exists in yahoo insane in how easily someone could exploit it if they really really wanted to. At least with the vb code, they would have to have you email them directly first!


Quote:

Originally Posted by TRR (Post 1330430)
I really want this feature but I am on godaddy as well; any suggestions for a host that can support this mod (imap already enabled)?

Be sure to ask if they are not wanting to install IMAP (not needed), or just not wanting to enable the imap functions (needed).

Alot of hosts will not want to install IMAP, which is fine. We just need php compiled with the imap functions enabled.

popmyzit 09-05-2007 07:59 AM

Hello,
getting Error Number: 1064 on new registrations

Invalid SQL:

REPLACE INTO vb_subscribeforum (userid, emailupdate, forumid)
VALUES (0, 1, );

database error.

Can someone help?
cheers

Cyricx 09-05-2007 11:36 AM

Quote:

Originally Posted by popmyzit (Post 1332723)
Hello,
getting Error Number: 1064 on new registrations

Invalid SQL:

REPLACE INTO vb_subscribeforum (userid, emailupdate, forumid)
VALUES (0, 1, );


database error.

Can someone help?
cheers

It would appear that in the usergroup manager you have autosubscribed turned on, but did not specify the forumids that the user should automatically be subscribed to.

popmyzit 09-05-2007 12:28 PM

Hello,
thanks for responding
I have actually put YES for subscribe and added a forumid in the field. I will double check this

however this may be happening despite that data in the fields... can anyone else check this?

thanks :)

popmyzit 09-05-2007 12:55 PM

Ok, i think it was trailing , comma in forum ids.

but now i am getting:

Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:110/pop3/notls}INBOX in /includes/cron/emailintegration.php on line 111

Warning: imap_headers(): supplied argument is not a valid imap resource in /includes/cron/emailintegration.php on line 114

Warning: imap_close(): supplied argument is not a valid imap resource in /includes/cron/emailintegration.php on line 1213

Done

any ideas? I think its the username what do you put there?

j14nsx 09-05-2007 05:36 PM

Apologies if my problem has already been answered. I have looked.

I have installed this mod, and it is working fine. However the emails I am receiving are not displaying as html. Other emails from other sender I can read as html, so it's not my Outlook 2007 setup.

I get text that looks like raw html.

Aside from this, works great!

USI_Garrett 09-11-2007 01:47 PM

Sorry if this is a basic question, but I can't quite figure it out. In the latest set of instructions, it says that I should import the product file "product-emailreplyint.xml". Where do I import it to? Is there there anything special I should use to import it (i.e. Impex)? Once again, sorry if this has already been addressed in the thread.

Thanks in advance.

USI_Garrett 09-11-2007 01:51 PM

Wow, nevermind. Figured it out. Looking forward to getting this mod up and running.

linnov 09-16-2007 10:33 PM

I have an automatted post in a forum I have this set on using the following code

Code:

<?

// chdir('./forums');
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
require_once('./includes/functions_databuild.php');

$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);

$forumid = 209;
$postuserid = 3;
$userid = 3;
$username = 'linnov';
$pagetext = 'Testing 123 ';
$title = 'Test Post ';
$allowsmilie = '1';
$visible = '1';

$threadinfo = fetch_threadinfo($postthreadid);
$foruminfo = fetch_foruminfo($threadinfo['forumid']);

$threaddm->do_set('forumid', $forumid);
$threaddm->do_set('postuserid', $postuserid);
$threaddm->do_set('userid', $userid);
$threaddm->do_set('username', $username);
$threaddm->do_set('pagetext', $pagetext);
$threaddm->do_set('title', $title);
$threaddm->set('allowsmilie', $allowsmilie);
$threaddm->set('visible', $visible);
$threaddm->save();

build_forum_counters($forumid);

?>

The problem is the email is not generated so I'm thinking I need to call some other function within the script in order for the email to occurr

It does email if I create a new thread from within the forum.

Anyone have any ideas?

FleXy 09-17-2007 02:29 PM

great mod, but I can not find information how user can define himself by mail...
This plugin use email address to know "user login"? I mean "to know who wrote by mail" ?

If yes, it's not secure, because anybody can send letters from any email address. I mean i can send email from support @ microsoft [dot] com etc.
email is WRONG choose to define user. So it's loophole for spammers....

p.s. sorry for my english.

silurius 09-20-2007 04:54 PM

I think FleXy is referring to email spoofing?

At some point it would be great to see information about how best to bridge this with a Mailman listserv (perhaps adopting some of the development from the NNTP Gateway add-on) as well as with the vBulletin calendar and any event management add-ons related to that area.

But these are all bonuses, really. This is a great add-on, Chris. I expect this will greatly ease some of the phobias members of the particular community I'm working with, many of whom are technically and cognitively challenged, have about using internet applications. Even though my own work in this case is not-for-profit I still intend to paypal you when my site launches.


All times are GMT. The time now is 04:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02427 seconds
  • Memory Usage 1,892KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete