vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBulletin Mail System (https://vborg.vbsupport.ru/showthread.php?t=125890)

DaNIEL MeNTED 11-15-2006 01:21 AM

This is just what I was looking for... tagging for updates!

Killsparer 11-16-2006 03:19 PM

Any news? All this progress makes me quite hopeful! :knockedout:

filburt1 11-16-2006 03:52 PM

The X-Mailer-Info might be what you're talking about:
PHP Code:

"X-Mailer-Info" => VBMS_URL

vbms_class_mail_message.php

That should describe what was used to send the message, and it's accurate that it points to the vBMS product URL.

Lionel 11-16-2006 07:34 PM

Quote:

Originally Posted by Killsparer (Post 1118688)
Any news? All this progress makes me quite hopeful! :knockedout:

you tell me. You have most of my files already and whatever problems you reported, I believe was fixed.

Killsparer 11-16-2006 07:53 PM

Quote:

Originally Posted by Lionel (Post 1118860)
you tell me. You have most of my files already and whatever problems you reported, I believe was fixed.

Eh, got your files? Did i miss a mail?
(Or perhaps i just missunderstood something.)

But i just tested the version at your forum again. The mail sent from there arrived twice again at my client.

Lionel 11-16-2006 07:55 PM

OK, then it was someone else. I get the double emails, you get the double emails, 2 other guys don't.

So all that is left is the double email and email not being html on site, when received from an alias.

It might help to know which php version everyone uses so I could narrow down that double emails issue.

Problem is I get help only once, then everyone disappears.

Killsparer 11-16-2006 09:09 PM

Quote:

Originally Posted by Lionel (Post 1118877)
OK, then it was someone else. I get the double emails, you get the double emails, 2 other guys don't.

No expert here, but could it not just be a problem with the mail-header? Both mails contain the following (adress edited out):

Quote:

To: xxxx@myclient.com
Subject: test-mail 4
MIME-Version: 1.0
From: "killsparer" <Killsparer@yourforum.com>
To: xxxx@myclient.com
Subject: test-mail 4
Date: Thu, 16 Nov 2006 16:49:24 -0500
What i mean is, that the header contains "to" and "subject" twice. Couldn't it cause the double-mails?

dodgeboard.com 11-17-2006 12:12 AM

Quote:

Originally Posted by Lionel (Post 1118877)
OK, then it was someone else. I get the double emails, you get the double emails, 2 other guys don't.

So all that is left is the double email and email not being html on site, when received from an alias.

It might help to know which php version everyone uses so I could narrow down that double emails issue.

Problem is I get help only once, then everyone disappears.

I am getting the double emails when sending to either my hotmail addy or my pop addy. What, if any information do you need from me? I'll help however I can.

Lionel 11-17-2006 12:18 AM

Later on or tomorrow, I'll look at that double emails issue.

dodgeboard.com 11-17-2006 12:23 AM

I did some test driving on the VBMS and it looks like we're almost there for a working VBMS. I want to extend a big CONGRATS to all that have worked on this. It will be a very welcomed addition to vBulletin. A HUGE thankyou to Lionel for spending so much time on this and to Filburt for helping and releasing the product as open source. Way to go guys!

dodgeboard.com 11-17-2006 09:25 PM

Quote:

Originally Posted by Killsparer (Post 1118917)
No expert here, but could it not just be a problem with the mail-header? Both mails contain the following (adress edited out):



What i mean is, that the header contains "to" and "subject" twice. Couldn't it cause the double-mails?


This is a good point. Mine are the same; (2) To: lines, (2) subject: lines
Noticing also in the header that the emails are only milliseconds behind each other. Almost like the CC line and the TO lines are getting joined, but creating two TO: lines in the header. ???

Perhaps something in the email header creation is fubar? Dupe table entries?

dodgeboard.com 11-17-2006 09:50 PM

Ok, so I think we are onto something here. When I send it with a subject line "this is a subject line"

I get this in the subject line on the preview panel of Outlook;

this is with a subject line this is with a subject line

But when I double click on the email to show it in a seperate window, it only shows one, so Outlook is dealing with the duplicate entry and excluding one of the subject line entries in the header.

So the header duplicating the subject line and duplicating the TO: line is the reason why we get two emails. Now, we need to figure out why the header is being compiled this way for some users and not all of them. I tried a theory; logginginto your forums using cookies and without- both methods resulted in dupe emails.

Lionel, do you have...or can you get...header from one of the users that does not get the dupe emails?

DaNIEL MeNTED 11-17-2006 10:00 PM

Technically its the duplication of the TO: line.

With the caveat that I have not looked at the code...

The protocol requires that each recipient be identified individually. When you send an email with 3 people in the "to:" the server actually breaks that down into 3 "RCPT TO: X@X.com" commands that are sent to the server on the other end of the communication... assuming the code it is going to acheive the same thing.

dodgeboard.com 11-17-2006 10:19 PM

Well, look this over Daniel and see if you can spot something that would be causing this.

PHP Code:

function vbms_api_send_message(
        
$to$subject$bbcode$attachments false$xpriority VBMS_XPRIORITY_NORMAL$savecopy true,
        
$addsignature true$reformatsignature true$testonly false$previewtype false$userid 0)
{
    
// prep fields
    
$to trim($to);
    
vbms_adjust_userid($userid);
    
    if (
$attachments === false)
    {
        
$attachments = array();
    }
    
    if (!empty(
$to) and is_array($attachments) and $userid 0)
    {
        global 
$DB_site$bbuserinfo$vboptions$vbulletin;
        
        
// get missing data if not the current user
        
$permissions vbms_get_permissions_by_userid($userid);
        
        
// set priority to normal if no permission
        
if ($xpriority != VBMS_XPRIORITY_NORMAL and !$permissions[VBMS_PERMISSIONS_CAN_USE_PRIORITIES])
        {
            
$xpriority VBMS_XPRIORITY_NORMAL;
        }
        
        
// do attachment permission checks
        
if (!empty($attachments))
        {
            if (!
$permissions[VBMS_PERMISSIONS_CAN_SEND_ATTACHMENTS])
            {
                return 
vbms_api_result::create_fail_instance("vbms_no_attachment_send_permissions");
            }
            else if (
sizeof($attachments) > $permissions[VBMS_PERMISSIONS_MAX_ATTACHMENT_COUNT])
            {
                return 
vbms_api_result::create_fail_instance("vbms_too_many_attachments");
            }
            else if (
$permissions[VBMS_PERMISSIONS_MAX_ATTACHMENT_FILESIZE] > 0)
            {
                
// check bytes used
                
$totalbytes 0;
                foreach (
$attachments as $attachment)
                {
                    
$totalbytes += $attachment['filesize'];
                }
                
                if (
$totalbytes $permissions[VBMS_PERMISSIONS_MAX_ATTACHMENT_FILESIZE])
                {
                    
$given vb_number_format($totalbytes1true);
                    
$allowed vb_number_format($permissions[VBMS_PERMISSIONS_MAX_ATTACHMENT_FILESIZE], 1true);
                    return 
vbms_api_result::create_fail_instance("vbms_attachments_too_large", array($given$allowed));
                }
            }
            
            
// check extensions
            
$allowedexts vbms_get_valid_attachment_extensions();
            foreach (
$attachments as $attachment)
            {
                
$extension file_extension($attachment['filename']);
                
                if (!
in_array($extension$allowedexts))
                {
                    return 
vbms_api_result::create_fail_instance(
                            
"vbms_denied_attachment_extension",
                            array(
vbms_grammatical_implode($allowedexts)));
                }
            }
        }
        
        
// load the signature, if necessary
        
if ($addsignature)
        {
            if (
$userid != $bbuserinfo['userid'])
            {
                
$user $DB_site->query_first(
                        
"SELECT signature
                        FROM " 
TABLE_PREFIX "usertextfield
                        WHERE userid = 
$userid");
                
$signature $user['signature'];
            }
            else
            {
                
$signature $bbuserinfo['signature'];
            }
        }
        
        
// load alias and username, if necessary
        
if ($userid != $bbuserinfo['userid'])
        {
            
$user $DB_site->query_first(
                    
"SELECT username, vbms_alias
                    FROM " 
TABLE_PREFIX "user
                    WHERE userid = 
$userid");
        }
        else
        {
            
$user $bbuserinfo;
        }
        
        
$to vbms_converttos($to);
        
        
// -----------------------------------------------------------------------
        // construct a mail object and send it
        // -----------------------------------------------------------------------
        
        // construct
        
$object = new vbms_mail_message();
        
        
// set fields
        
$object->set_subject($subject);
        
$object->set_from($user['vbms_alias'], $user['username']);
        
$object->set_message_bbcode($bbcode);
        
$object->set_recipients($to);
        
$object->set_xpriority($xpriority);
        
        
// apply signature/trailer options
        
$object->apply_options($signature$rewritesignature,
                
$permissions[VBMS_PERMISSIONS_REQUIRE_TRAILER],
                
$permissions[VBMS_PERMISSIONS_ABUSE_LEADER]);
        
        
// add attachments
        
foreach ($attachments as $attachment)
        {
            
$object->add_attachment(
                    
$attachment['filename'], $attachment['data'],
                    
$attachment['mimetype']);
        }
        
        if (
$previewtype !== false)
        {
            global 
$vbphrase$stylevar;
            
            
$html $object->construct_message_html($previewtype);
            
            
print_output($html);
            return 
vbms_api_result::get_void_success_instance();
        }
        else
        {
            
// send it
            
$result $object->send($testonly);
            if (
$result !== true)
            {
                return 
vbms_api_result::create_fail_instance("vbms_senderror",
                        array(
trim($result)));
            }
            else
            {
                
// update floodcheck dateline
                
if ($permissions[VBMS_PERMISSIONS_SEND_FLOODCHECK] > 0)
                {
                    
$vbulletin->db->query(
                            
"REPLACE INTO " TABLE_PREFIX "vbms_sendfloodcheck
                            (userid, dateline)
                            VALUES
                            (
$userid, " TIMENOW ")");
                }
                
                
// add to sent messages (and increment quota)
                
if ($savecopy)
                {
                    
$bytes sizeof($bbcode);
                    
$bbcode addslashes($bbcode);
                    
                    
$from addslashes("\"" $user['username'] . "\" <" .
                            
$user['vbms_alias'] . "@" .
                            
$vboptions['vbms_todomain'] . ">");
                    
$subject addslashes($subject);
                    
$message addslashes($bbcode);
                    
$messageid vbms_get_first_available_messageid();
                    
$DB_site->query(
                            
"INSERT INTO " TABLE_PREFIX "vbms_message
                            (messageid, format, userid, folderid, xpriority,
                            dateline, readflag, fromname, subject, message)
                            VALUES
                            (
$messageid, \"bbcode\", $userid, " .
                            
VBMS_FOLDER_SENTMESSAGES ", $xpriority,
                            " 
TIMENOW ", 1, \"$from\", \"$subject\",
                            \"
$message\")");
                    
vbms_api_adjust_quota_usage($bytes$userid);
                }
                
                return 
vbms_api_result::get_void_success_instance();
            }
        }
    }
    else
    {
        return 
vbms_api_result::get_invalid_arguments_instance();
    }



dodgeboard.com 11-17-2006 11:00 PM

POP accounts seem to be handling the dupe subject line issue better than IMAP like hotmail.

subject line on sent message: testing things out

Hot mail shows: testing things out testing things out

POP accounts show: testing things out

Lionel 11-17-2006 11:03 PM

interesting. I have only one subject line every time, but the email shows the to as
Quote:

recipient@email.com;recipient@email.com
thus the double emails.

I'll take a closer look at function vbms_api_send_message()

Lionel 11-17-2006 11:35 PM

I have been debugging every step of the send process and at every instance it echo only one email address on the screen.

DaNIEL MeNTED 11-17-2006 11:49 PM

Quote:

Originally Posted by dodgeboard.com (Post 1119633)
Well, look this over Daniel and see if you can spot something that would be causing this.

PHP Code:

        $to vbms_converttos($to); 


Not sure what that function is doing...

But bear in mind I'm not a coder... just a bit of a M$ mailserver guru.

The duplicated subject line isn't the issue... the duplicated mail address is...

dodgeboard.com 11-17-2006 11:51 PM

Agreed! But the fact that both are getting duplicated may give us a better idea of where to look in the code.

I am not a coder either, but a guru of all sorts.

DaNIEL MeNTED 11-17-2006 11:54 PM

how is $to being built?

Lionel 11-17-2006 11:55 PM

Guess what. I managed to get only one email, but I do not know if that is breaking something else.

In vbms_class_mail_message.php: function construct_mime_message(), in the $headermap = array I simply commented out the
Quote:

//"To" => $this->to,
which I noticed was being called again in the function below

function send($testonly = false)

$result = mail($this->to, $this->subject, $this->html, $headers);

dodgeboard.com 11-17-2006 11:56 PM

You rock MAN!! I'll do some more testing on your system.

Lionel 11-17-2006 11:56 PM

Quote:

$to = vbms_converttos($to);
don't touch this function, it has nothing to do with it, that deals with the aliases.

dodgeboard.com 11-18-2006 12:00 AM

welp, that fixed it for me, both POP and IMAP. Everything else seems okay... so far.

Will do some more testing...

Lionel 11-18-2006 12:01 AM

Quote:

Originally Posted by dodgeboard.com (Post 1119697)
welp, that fixed it for me, both POP and IMAP. Everything else seems okay... so far.

Will do some more testing...

Like I said, we need to do some intensive testing, I am not sure if that breaks something else, such as multiple recipients :tired:

dodgeboard.com 11-18-2006 12:03 AM

try commenting out this as well...

PHP Code:

"Subject" => $this->subject

To see if it fixes the double subject issue

I still get an echo on IMAP emails in the subject line

dodgeboard.com 11-18-2006 12:04 AM

Quote:

Originally Posted by Lionel (Post 1119699)
Like I said, we need to do some intensive testing, I am not sure if that breaks something else, such as multiple recipients :tired:

Multiple recipients is working ok

Lionel 11-18-2006 12:04 AM

Quote:

Originally Posted by dodgeboard.com (Post 1119701)
try commenting out this as well...

PHP Code:

"Subject" => $this->subject

To see if it fixes the double subject issue

I still get an echo on IMAP emails in the subject line

I'll try, although I haven't got that double subject issue.

dodgeboard.com 11-18-2006 12:05 AM

you'll only notice it on Hotmail...POP email ricipients seem to correct it.

Lionel 11-18-2006 12:06 AM

anyway, commenting it out did not hurt. Try it

Lionel 11-18-2006 12:07 AM

If nothing else is broken, the last major issue is alias to alias does not receive html

dodgeboard.com 11-18-2006 12:07 AM

Quote:

Originally Posted by Lionel (Post 1119703)
I'll try, although I haven't got that double subject issue.


Okay- that fixed it on the subject line issue as well. and I still see the subject line (but only once on both pop and IMAP. headers look perfect now!!

You da man!!

DaNIEL MeNTED 11-18-2006 12:16 AM

Rather than that what happens if you change:

PHP Code:

$result mail($this->to$this->subject$this->html$headers); 

PHP Code:

$result mail($headers$this->html); 

I don't see why the code is constructing the header then defining the TO: and Subject: a second time?

Lionel 11-18-2006 12:17 AM

ok, here are my files

You need to make 2 small templates changes

in VBMS_FILTERS add this in the form action

Quote:

<input type="hidden" name="do" value="addfilter" />
same for VBMS_OPTIONS. Add
Quote:

<input type="hidden" name="do" value="addoptions" />
Now, we have not tested attachments at all.

working 3.60 version here

Lionel 11-18-2006 12:18 AM

Quote:

Originally Posted by DaNIEL MeNTED (Post 1119711)
Rather than that what happens if you change:

PHP Code:

$result mail($this->to$this->subject$this->html$headers); 

PHP Code:

$result mail($headers$this->html); 

I don't see why the code is constructing the header then defining the TO: and Subject: a second time?

That does not send the mail at all.

dodgeboard.com 11-18-2006 12:19 AM

I've tested attachments and they seem to be working ok

Lionel 11-18-2006 12:21 AM

One more thing. I am on a redhat server so I hardcoded it to force NOTLS.

Lionel 11-18-2006 12:22 AM

Dodgeboard, I am going to send you an email to your alias. Check for html. I will be sending you smilies.

DaNIEL MeNTED 11-18-2006 12:22 AM

Quote:

Originally Posted by Lionel (Post 1119714)
That does not send the mail at all.



:confused:

Like I said... I'm not a coder. I looked up the reference for the PHP mail() function -

Quote:

Function usage : mail([RECIPIENT],[SUBJECT],[MESSAGE],[EXTRAHEADERS], [EXTRAPARAMS]);
So that means you need to define TO and SUBJECT when calling mail(). Doing it again in the additional header information in $header is going to cause mail() to parse the to and subject twice.

So you've definately got it...

Lionel 11-18-2006 12:23 AM

what is your username/alias?


All times are GMT. The time now is 09:30 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.01784 seconds
  • Memory Usage 1,933KB
  • 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
  • (9)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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