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)

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?


All times are GMT. The time now is 09:47 AM.

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.01622 seconds
  • Memory Usage 1,833KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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