Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Sending email to an address that contains an single quote

 
SOLVED
Go to solution
Dan Herron
Advisor

Sending email to an address that contains an single quote

Am trying to use the MAIL utility to send to an address that contains a single quote with the following resulting error message:

MAIL file_name "dan'OHerron@kittles.com"
%MAIL-E-USERSPEC, invalid user specification 'DAN'OHERRON@KITTLES.COM'

I have tried using an apostrophe, but with the same results.

I have tried "escaping" the apostrophe with a back slach \, but no luck.

I have tried three single quotes. The email appears to go out but I get the following response back that shows no single quote in the email address:

"The following recipient(s) could not be reached:
DANOHERRON@kittles.com on 2/22/2010 2:08 PM"

The RFC for email address syntax indicates the apostrophe and single quote are valid characters.

Does anyone know how to get this to work?

Thanks,
Dan Herron

13 REPLIES 13
Jim_McKinney
Honored Contributor

Re: Sending email to an address that contains an single quote

With MultiNet's SMTP both \' and \s can be used to replace an apostrophe in an email address. I thought that the same was true for all the stacks but you seem to have found otherwise. You might want to give the \s construct a try.
Dan Herron
Advisor

Re: Sending email to an address that contains an single quote

No luck with \s

MAIL file_name "danO\sHerron@kittles.com"
%TCPIP-E-SMTP_BADADDR, recipient address is illegal; unparsed string: \@
Hoff
Honored Contributor

Re: Sending email to an address that contains an single quote

This looks to be a long-standing parser bug in the MAIL syntax recognition and in the SMTP logic; a divergence from the RFC.

IIRC, there are two hunks of code that can be involved here, one within mail that parses the parameter and decides how to dispatch the address and one hunk of code over in the SMTP code that actually has to do something with the address parameter.

Barring a creative hack (and I can't think of one off-hand) or a fix from HP and (if you're using a third-party stack) potentially from whomever provided your IP stack, then you're probably stuck.

This bug goes back at least a decade, IIRC.
John McL
Trusted Contributor

Re: Sending email to an address that contains an single quote

Your first attempt, a single quote, is consistent with putting an single quote in a DCL string. Your second attempt was equivalent to having a null symbol between the 2nd and 3rds apostrophe (i.e. "''A'" without the A) and the error message was consistent with this.

You talk of apostrophes and single quotes. Do I take it that one is vertical and would be the same at each end of a quoted passage and the other is angled or like a "6" and at the end of the string would be a rotated form of this?

Have you tried a \single quote (rather than \apostrophe)? Have you also tested whether this also fails (a) in a distribution list or (b) where it is defined as a symbol (e.g. recip="dano'herron" and then use mail file 'recip'?

I'm trying to work out whether it's the DCL parser that might be mangling the recipient name into something different before SMTP gets it.
RBrown_1
Trusted Contributor

Re: Sending email to an address that contains an single quote

I think that DCL is doing it to you. Try it with 5 quotation marks beginning and end:

$ MAIL file_name """""dan'OHerron@kittles.com"""""


Hoff
Honored Contributor

Re: Sending email to an address that contains an single quote

An isolated apostrophe within a double-quoted string is not altered by DCL; this preservation is expected and documented behavior, and this is why you need to double the leading apostrophe within a double-quoted string to trigger a substitution within a double-quoted string.
John Gillings
Honored Contributor
Solution

Re: Sending email to an address that contains an single quote

Dan,
Have you tried SFF? I tried to send a message to the sample address. It bounced with:

"danO'Herron@kittles.com
The recipient's e-mail address was not found in the recipient's e-mail system. "

but as you can see, it appears the apostrophe got beyond OpenVMS.

SFF is "Send From File". You format a file with mail parameters and send it with TCPIP$SMTP_SFF.EXE. See TCPIP documentation for details.

For example

TESTSFF.COM
$ CREATE SFF.TXT
$ DECK
MAIL FROM:
RCPT TO:
DATA
From: your.address@yourcompany.com
To: danO'Herron@kittles.com
Subject: Test to address with apostrophe using SFF
Dan,
This message is using the OpenVMS SFF (Send From File) mechanism. I'm not
sure if it gets around your apostrophe problem.

Let me know if it works.

John Gillings
$ EOD
$ MCR TCPIP$SMTP_SFF SFF.TXT

A crucible of informative mistakes
Dan Herron
Advisor

Re: Sending email to an address that contains an single quote

John,

I will give SFF a try. It is pretty clear from your example that it will work.
The danO'herron@kittles.com email address in my posts is (obviously) a bogus email address (to protect the innocent). Your SFF attempt clearly made it through to our email server.

Thanks,
Dan
RBrown_1
Trusted Contributor

Re: Sending email to an address that contains an single quote


Using the correct number of quotation marks appears to get to your mail server too.

$ MAIL file_name """""dan'OHerron@kittles.com"""""
%MAIL-E-NOSUCHUSR, no such user dan'OHerron@kittles.com
$
RBrown_1
Trusted Contributor

Re: Sending email to an address that contains an single quote

>>Using the correct number of quotation marks appears to get to your mail server too. <<

Never mind, my mistake. It definitely does not get to your mail server.
Phil.Howell
Honored Contributor

Re: Sending email to an address that contains an single quote

Have you tried replacing the single quote with %27

Phil
Dan Herron
Advisor

Re: Sending email to an address that contains an single quote

Replacing the single quote with %27 yielded the following bounce-back:

The following recipient(s) could not be reached: 27HERRON@kittles.com on 2/24/2010 8:54 AM
Dan Herron
Advisor

Re: Sending email to an address that contains an single quote

Will be trying SFF.