The default sender name on our site includes an apostrophe, and since upgrading MimeMail to the latest version the sender name is now showing up in email clients with a backslash preceding the apostrophe.

It looks like this backslash is added in mimemail_address(), where the name is sent through the addslashes() function. Unfortunately, this seems not to help either for single or double quotes - in both cases, the backslash still appears when the email is received, and in addition the string is truncated after the first double quote character.

As a stopgap solution, I've simply removed the call to addslashes() function, and this solves the problem. But there may be scenarios where it's still necessary, I just don't know what they are!

Comments

litzastark created an issue. See original summary.

MrPeanut’s picture

Thanks. Removing the `addslahes()` function from mimemail.inc seemed to fix the issue.

TR’s picture

Status: Active » Postponed (maintainer needs more info)

and since upgrading MimeMail to the latest version ...

As a stopgap solution, I've simply removed the call to addslashes() function

Well, first, addslashes() was added to the code by commit 1e4d16d73f30 on 19 Nov 2005, so there's no way that was the cause of your problem that showed up recently. And removing addslashes() would be the wrong thing to do for that reason.

Second, I can't reproduce this. I'm not sure what you mean by "The default sender name on our site includes an apostrophe". Drupal doesn't have a default sender name - it has a site name and a default email address, both set at admin/config/system/site-information.

Here's what I tried. Please tell me how to modify this procedure to reproduce your problem.

Using the mimemail_example module to send out an email, I tried two things:

  1. Specifying a "Sender name" with an apostrophe on the mimemail_example form
  2. Resetting my site name to include an apostrophe then using mimemail_example with a blank "Sender name"

Both of these worked and the apostrophe displayed properly (without a backslash) in my email client.

Now looking at the raw message source, there *is* a backslash, because that's what RFC2822 says you have to do - a name like

My site's name

has to be encoded as "My site\'s name" (including the double quotes and backslash) when it appears in the raw header, because an apostrophe is an illegal character to use in the header. So Mime Mail is doing the right thing here according to the RFC, and at least *my* email client correctly displays this correctly.

So while there may still be a bug here, I don't have enough information to figure out what that might be. What I need is:

  1. Exactly what string you have that uses an apostrophe - where did you enter that string.
  2. How are you sending the email - what module.
  3. What happens if you use the mimemail_example module to send the message - do you still have the problem?
  4. What does the raw email header look like - I need to see if it agrees with the RFC.

If the problem is with your email client, I can't help you.

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Feel free to reopen this issue if you are still having this problem and can provide the information asked for in #3.