Operating System - HP-UX
1832525 Members
8738 Online
110043 Solutions
New Discussion

how to deal with Spaces in an email address

 
SOLVED
Go to solution
Scott Palmer_1
Trusted Contributor

how to deal with Spaces in an email address

Does anyone know how to deal with spaces in an email alias?
the email alias is on Exchange and I am trying to send an email to the alias.
An example of the alias is:
IT FOOBAR-TESTING@foo.com

Regards
Scott Palmer
15 REPLIES 15
Ivan Ferreira
Honored Contributor

Re: how to deal with Spaces in an email address

Try using mail "IT FOOBAR-TESTING@foo.com".
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sandman!
Honored Contributor

Re: how to deal with Spaces in an email address

How about quoting the string that contains spaces..."IT FOOBAR-TESTING"

regards!
A. Clay Stephenson
Acclaimed Contributor

Re: how to deal with Spaces in an email address

AS with all whitespace in scripting the answer is quotes. "XXX YYY@ZZZ.com"
If it ain't broke, I can fix that.
Scott Palmer_1
Trusted Contributor

Re: how to deal with Spaces in an email address

Quoting doesnt seem to fix the problem
sendmail sees the spaces as white space and inserts a comma. if i add the sendmail flag -oobool (to start using old style headers) then I can quote the word address and that is fine, but If i use the sendmail with a -v i see that the space is getting translated to a period.
sendmail -v -oobool "IT FOOBAR-TESTING@foo.com" comes out to be IT.FOOBAR-TESTING@foo.com

Regards
Sandman!
Honored Contributor

Re: how to deal with Spaces in an email address

Does escaping it with a backslash work?

IT\ FOOBAR-TESTING@foo.com
Scott Palmer_1
Trusted Contributor

Re: how to deal with Spaces in an email address

No it doesn't, it just sends two emails,
one for "IT\" and one for "FOOBAR-TESTING"

this to me is a perplexing problem, and probably a sendmail configuration issue.

Regards
Sandman!
Honored Contributor

Re: how to deal with Spaces in an email address

Look in your /etc/mail/sendmail.cf and search for the "O BlankSub=." parameter and try tweaking it until you are able to send mail out.

regards!
Sandman!
Honored Contributor

Re: how to deal with Spaces in an email address

Yet another thing you can do is to put the address in single quotes instead of double quotes...

'IT FOOBAR-TESTING@foo.com'
Scott Palmer_1
Trusted Contributor

Re: how to deal with Spaces in an email address

Been there too, same results.
I have tried quoting the whole address with single and double quotes. I have tried quoting the title infront of the @ with both single and double quotes. The same strange behavior, it is as if sendmail is ignoring the quotation marks unless i put the -oobool option on, and then the space is replaced with a period.

Scott
Wayne Patton_1
Advisor
Solution

Re: how to deal with Spaces in an email address

Check out this web page.

http://en.wikipedia.org/wiki/E-mail_address

If it's correct, then a SPACE is not a valid character for an email address. It points to RFC 2822 which for me is very difficult to read. But if the wikpedia summary is accurate, then a space is not a valid character to use, and you should get the email aliases changed to use valid characters.

-wayne
Jeff_Traigle
Honored Contributor

Re: how to deal with Spaces in an email address

That's kind of what I was thinking too, Wayne. I've never known spaces to be valid in the username portion of email addresses. Of course, with the way things change over time, I don't always trust my memory or what I knew as fact once upon a time either. :)
--
Jeff Traigle
Jeff_Traigle
Honored Contributor

Re: how to deal with Spaces in an email address

Might also look at the following:

http://www.faqs.org/rfcs/rfc822.html

It explains the replacement of . for spaces in section 6.2.
--
Jeff Traigle
Sandman!
Honored Contributor

Re: how to deal with Spaces in an email address

Scott,

Set parameter "O BlankSub=" in your /etc/mail/sendmail.cf; quote the address on the command line and use the -oobool switch.

regards!
Scott Palmer_1
Trusted Contributor

Re: how to deal with Spaces in an email address

Comments and folding white
space SHOULD NOT be used around the "@" in the addr-spec.

The sendmail.cf seems to work even though the mail is rejectd as unknow sender. However I think i shall make the network folks conform to the standards.

Thanks for All the help

Regards

Scott Palmer
Scott Palmer_1
Trusted Contributor

Re: how to deal with Spaces in an email address

Comments and folding white space SHOULD NOT be used around the "@" in the addr-spec.

this comes from the RFC2822, I think i will make the Microsoft Exchange folks comply with the standard.

Thanks Again for the quick responses

Scott Palmer