Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text in the emails is not being tagged with it's MIME type causing some newer email programs to handle emails incorrectly #41

Open
ktadd opened this issue Feb 15, 2020 · 2 comments

Comments

@ktadd
Copy link

ktadd commented Feb 15, 2020

When Simplemail encodes the text in the emial before sending it is not tagging the text with the MIME identifier. This causes some email programs, like OE Classic on Windows to not know how to handle the email and it complains about improper MIME encoding..

The text should be tagged with the following MIME type descriptor as follows:
----==bound7220517ddb----
Content-Type: text/plain; charset=ISO-8859-1
Content-Description: 1st text

1st line of text in email message

The two Content- lines shown above are missing which is why some email programs may have issue with it. Please add the MIME descriptor for the text portions of the emails. Note that if I add a second text message to the same email it does not get the MIME descriptor either. The mostly causes a problem with you have a multi part email. Like when sending the text and having a picture attached to the email. That tends to be the case where other email programs can get confused if the text doesn't have it's MIME descriptor.

@ktadd ktadd changed the title Text in the emails is not being tagged with it's MIME type causing some newer email programs to handle emails properly. Text in the emails is not being tagged with it's MIME type causing some newer email programs to handle emails incorrectly Feb 15, 2020
@ktadd
Copy link
Author

ktadd commented Feb 15, 2020

Looking at the source code I could see in mail.c that the body text is only MIME encoded if it's not, the only part in the mail, not 7-bit or there is a description added. I would suggest that the body text should always be MIME encoded if the mail is a multi-part email. I verified that if add a description to the body text, so that the body text is MIME encoded, than the Windows email program (OE Classic) can read email from Simplemail with attachments properly.

Here is the code segment I am referring to:
From mail.c
static int mail_compose_write(FILE *fp, struct composed_mail *new_mail)

if (convtext)
   {
	body = encode_body((unsigned char*)convtext, strlen(convtext), new_mail->content_type, &body_len, &body_encoding);
/* encode as mime only if body encoding is not 7bit or a content description was given */
	if ((body_encoding && mystricmp(body_encoding,"7bit")) || new_mail->content_description)
	{
        	if (new_mail->to) fprintf(ofh,"MIME-Version: 1.0\n");
	        fprintf(ofh,"Content-Type: text/plain; charset=%s\n",unicode?"utf- 
                8":best_codeset->name);

	/* Write the Content Description out */
	        if (new_mail->content_description && *new_mail->content_description)
	        {
		        char *cd;
		        if ((cd = encode_header_field_utf8("Content-Description",new_mail- 
                        >content_description)))
		        {
		                fputs(cd,fp);
			        free(cd);
		        }
	        }
        }
        free(convtext);
}

@ktadd ktadd closed this as completed Feb 15, 2020
@ktadd ktadd reopened this Feb 15, 2020
@ktadd
Copy link
Author

ktadd commented Feb 15, 2020

Hmm....seems as if I accidentally closed this issue. re-opening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant