WordPress.org

Ready to get started?Download WordPress

Forums

ThreeWP Email Reflector
[resolved] Hotmail empty messgae (15 posts)

  1. dark_yodaman
    Member
    Posted 2 years ago #

    Hi,

    this plugin is really great. I search for such functionallity a lot of time, then I found this. THX.

    But I have a problem.
    I have the mentioned problem with empty messages in hotmail. But I only have a webhosted server, so I can't do anything with the IMAP konfiguration.

    Is there a workaround or something else?

    Thank you.

    Grz
    Daniel

    http://wordpress.org/extend/plugins/threewp-email-reflector/

  2. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    Use another IMAP server, is my best bet.

  3. dark_yodaman
    Member
    Posted 2 years ago #

    I can only use this IMAP server and I can't change anything there. My organisation pays for it and want to use it.

    Do you figured out, which configuration property of the IMAP server is responsible for this fault? Maybe I can ask my Support t fix it, but they have to know which config it is.

    THX

  4. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    The closest I've gotten to a solution to the problem is editing the DNS table to that the MX gets its own TXT value.

  5. dark_yodaman
    Member
    Posted 2 years ago #

    I try to use different values for the MX entry of DNS. But there is no difference :(

    I also ask Microsoft for a solution of this Problem.
    They tell the following:

    Sie sollten nach der “filename” Linie einen Wagenumbruch (carriage return) einfügen. Das Hinzufügen eines Wagenumbruchs sollte der Mail erlauben ohne Probleme von Hotmail empfangen zu werden.

    Free transalated it means this:

    You should insert an carriage return after the line "filename". Inserting a carriaage return should permit the Mail to be received without problems by Hotmail.

    Maybe this helps you. I can't find any "filename" line in the mail-source. I'm waiting for another answer from Microsoft.

  6. dark_yodaman
    Member
    Posted 2 years ago #

    did you find any solution?

    can you tell me what I have to write to the MX record?

    Microsoft tells me that they are working to find a soultion, but this is also weeks ago...

    thanks

  7. dark_yodaman
    Member
    Posted 2 years ago #

    Hey...

    I found the reason why messages are empty ... Thats not a problem of the reciever or the IMAP Server or the DNS Record...

    it's in file "ThreeWP_Email_Reflector.php" in the method: queue_message();

    There are much more headres to remove than you do...
    I cahnged the variable $headertoremove follwoing:

    $headers_to_remove = array('to', 'delivered-to', 'reply-to', 'bcc', 'cc', 'subject', 'precedence',
    			'X-policyd-weight', 'Received', 'X-Yahoo-Newman-Property', 'X-Yahoo-Newman-Id',
    			'X-YMail-OSG', 'X-Mailer', 'Message-ID', 'Date', 'MIME-Version', 'DKIM-Signature', 'DomainKey-Signature',
    			'In-Reply-To', 'References');

    This reduces the Problem... But it is not the final solution.

    There is a problem with multipart EMails:
    Content-Type: multipart/alternative; boundary="-1952966989-559050069-1322135886=:10677"
    this is after processing in the middle of the header but it has to be at the beginning of the body.
    How can I extract this line and add it to the body

    grz

  8. dark_yodaman
    Member
    Posted 2 years ago #

    i have found a soultion...
    i will post it tomorrow...

  9. dark_yodaman
    Member
    Posted 2 years ago #

    Hi,

    sorry that may solution takes so long time...
    But here it is:
    I introduced a new function:

    /**
    		Copy a headerline, including any lines below that belong to the header.
    	**/
    	protected function copy_header( $headers, $header_to_copy )
    	{
    		$returnValue = array();
    
    		$header_to_find = $this->strtolower( $header_to_copy ) . ':';
    
    		$just_skipped = false;
    		$header_half_found = false; // this is set to get also the next line
    		$lines = array_filter( explode( "\n", $headers ) );
    		foreach ( $lines as $line )
    		{
    			if ($header_half_found)
    			{
    				$returnValue[] = $line;
    				$header_half_found = false;
    				continue;
    			}
    			if ( $just_skipped )
    			{
    				if ( $line[0] == ' ' || $line[0] == "\t" )
    					continue;
    				else
    					$just_skipped = false;
    			}
    
    			if ( strpos( $this->strtolower($line), $header_to_find ) === 0 )
    			{
    				$returnValue[] = $line;
    				if(strrpos($line, "; ", -2) !== false || strrpos($line, ";", -1) !== false )
    				{
    					$header_half_found = true;
    				}
    			}
    			else
    				$just_skipped = true;
    		}
    		return implode( "\n", $returnValue ) . "\n\n";
    	}

    and here is my changed process queue method:

    protected function queue_message( $options )
    	{
    		$msgno = $options['msgno'];
    		$settings = $options['settings'];
    
    		// Fetch the message
    		$structure = $options['structure'];
    
    		// Reports = undeliverable. Too bad. Don't queue it.
    		if ( $structure->subtype == 'report' )
    			return;
    
    		$subject = $options['headerinfo']->subject;
    		$subject = iconv_mime_decode($subject,0,"UTF-8");		// mb_encode_mimeheader leaves underscores, therefore imap_utf8
    		if ( $settings->subject_line_prefix != '' )
    		{
    			$prefix = $settings->subject_line_prefix;
    			if ( strpos( $subject, $prefix ) === false )
    				$subject = $prefix . $subject;
    		}
    		if ( $settings->subject_line_suffix != '' )
    		{
    			$suffix = $settings->subject_line_suffix;
    			if ( strpos( $subject, $suffix ) === false )
    				$subject .= $suffix;
    		}
    		mb_internal_encoding('UTF-8');
    		$subject = mb_encode_mimeheader( $subject, 'UTF-8' ) ;
    
    		$headers = trim( $options['header'] );
    		$headers_to_copy = array('From', 'Content-type');
    		foreach ( $headers_to_copy as $header_to_copy )
    			$header[] = $this->copy_header($headers, $header_to_copy);
    
    		// Remove stuff from the header that would conflict with our new headers.
    		$headers_to_remove = array('to', 'delivered-to', 'reply-to', 'bcc', 'cc', 'subject', 'precedence',
    			'X-policyd-weight', 'Received', 'X-Yahoo-Newman-Property', 'X-Yahoo-Newman-Id',
    			'X-YMail-OSG', 'X-Mailer', 'Message-ID', 'Date', 'MIME-Version', 'DKIM-Signature', 'DomainKey-Signature',
    			'In-Reply-To', 'References', 'X-RocketYMMF', 'Content-type', 'From');
    		foreach ( $headers_to_remove as $header_to_remove )
    			$headers = $this->remove_header( $headers, $header_to_remove);
    
    				// Add our reply to.
    		$headers = "Reply-To: " . $settings->reply_to . "\n" . $headers;
    		// Our message is just bulk.
    		$headers = "Precedence: bulk\n" . $headers;
    		$headers = $header[0].$header[1].$headers;
    
    		$headers = str_replace("\n\n", "\n", $headers);
    		$headers = str_replace("\r\n", "\n", $headers);
    		$headers = trim( $headers );
    
    		$body = "";
    		$body = $body.$options['body'];
    		$body = str_replace("\n\n", "\n", $body);
    		$body = str_replace("\r\n", "\n", $body);
    		$body = trim($body); 
    
    		$mail_data = array(
    			'headers' => $headers,
    			'body' => $body,
    			'reply_to' => array( $settings->reply_to => $settings->list_name ),
    			'subject' => $subject,
    		);
    
    		$readers = array_filter( explode("\n", $settings->readers) );
    
    		foreach($readers as $reader)
    		{
    			$reader = trim( $reader );
    			if ( !is_email($reader) )
    			{
    				$this->log( 'queue', sprintf(
    					$this->_( '<em>%s</em> is not a valid email address in <em>%s</em>.' ),
    					$reader,
    					$settings->list_name
    				) );
    				continue;
    			}
    
    			$this->log( 'queue', sprintf(
    				$this->_( '<em>%s</em> added to mail queue for <em>%s</em>.' ),
    				$reader,
    				$settings->list_name
    			) );
    			$mail_data['to'] = array($reader);
    			$this->sql_add_to_queue(array(
    				'mail_data' => $mail_data,
    			));
    		}
    	}

    The Problem wasn't Hotmail... it was that a boundary was set in two lines and the code abvoe fix it.
    A User has also reported problems via sending withz Mozilla Thunderbrid and this is also fixed...

  10. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    What exactly does this line do?

    $header[] = $this->copy_header($headers, $header_to_copy);

    $header isn't defined anywhere.

  11. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    Also: Why would one want to remove from, received, date and in-reply-to?

  12. dark_yodaman
    Member
    Posted 2 years ago #

    This line
    $header[] = $this->copy_header($headers, $header_to_copy);
    copy the requested header field in the next array field of $header[]...
    so in $header[0] is "From" and in d $header[1] is "Content-type"

    I' not sure if you have to define the variable in php before you use ist...

    I want to remove all the headers because there are problems in Hotmail and other Mail-CLients when recieving blank lines between the header lines... with rempoving all unnecessary, and adding the really improtant things, this will be avoided...

    I do this fix only that it works, so maybe there are better ways to do the same thing...

  13. jon.m.downey
    Member
    Posted 2 years ago #

    Thank you! Your fix worked. It still seems to kick out blank messages for mail.com but not sure I care at this point.

    I couldn't get it to work at all prior to your fix.

  14. jon.m.downey
    Member
    Posted 2 years ago #

    I updated this plugin and now have some strange behavior.

    When viewing messages in Gmail or on an Android smartphone, the messages include the header information. This also happens with msn mail.

    When viewing the messages in Yahoo mail client or Thunderbird, the messages are fine and headers are not displayed.

    I tried reverting back to the old version but then it does not work at all.

    I have a ton of users who have grown to rely on this and and getting lots of complaints.

    Thanks.

  15. edward mindreantre
    Member
    Plugin Author

    Posted 2 years ago #

    You'll have to send me some example messages so I can see what the problem is. Original (before reflection) also help.

    edward@mindreantre.se

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic