question:
Is it possible not to send an email to the to-recipient seen by the CC/BCC-recipients ?
In other words: Is it possible to send an email via CC or BCC but not to the to-recipient (i.e. the recipient in the 'to' header field) ?
example:
Andrew wants Bob to receive either one of these emails without actually sending it to Alice:
from: Andrew
to: Alice
or
from: Andrew
to: Alice
cc: Bob
Is that possible?
I poorly understand the subject matter, but from my readings it appears as though the sender (Andrew) had to use different recipients for the to
and envelope-to
fields, but I don't know how this can be achieved.
Does the sender (Andrew) inevitably have to set up his own mail server to achieve this or is there an easier solution?
To
,From
,CC
and evenBCC
are just headers in the email. You can put in whatever you want, at least if you use a library that gives you control over the headers in your email.Let's do a very simple example using telnet to send an email.
First, look up which email servers handle mail for a domain (here gmail.com), e.g., with
host
:I'll use the first given email server, gmail-smtp-in.l.google.com. As per RFC 5321 you can connect to a mail server and send an email like this:
Each line starting with numbers is the SMTP server's reply. A code in the 200s is ok, a 400 is a temporary error, and a 500 a permanent error.
Next you say "hello", or rather, the "extended hello" (ehlo) and the server replies with all the extensions it supports:
Then you tell the server you want to send an email, using the
mail from:
command, and telling it the SMTP envelope sender email address. If the server accepts the email, it again replies with something that starts with a 200s code.Then you give the SMTP envelope recipient, and the server accepts again with a 200s code:
Next is the
data
command which the server acknowledges with a 354 code, telling you to enter the message:The email is made up of headers, then a blank line, and then the body of the email. The example below is very simplistic, but should work. You specify a
From:
header, aTo:
, maybe aCC:
orBCC:
(sic!) header, and of course aSubject:
,Date:
, and others.Here you see 4 headers (
From
,To
,CC
, andSubject
), followed by the empty line that separates headers and email body, and then the body, which is just that one line.End the email with a single dot on a line by itself:
The server now has accepted the message and should either deliver or bounce it. You can now send another email (start over with
mail from:
above) or end the dialog:As you can see, I've entered
[email protected]
as the SMTP envelope recipient email address. This is the one that matters, this is where the email actually gets sent. Nothing prevents you from adding people to theCC:
orBCC:
lines without ever specifying arcpt-to:
for them. They will not get the email, but it will look to the recipients that actually do get the email, that these people should also receive it. Nothing prevents you from adding a different email address in theTo:
header than what you used in thercpt-to:
command.Usually, a MUA will add a
To:
orCC:
header that matches the SMTP envelope address, but that is not required. Not having some of these headers, or having headers not match the SMTP envelope commands, may get you some spam points, however.You don't need a user name or password in many cases. And this is intentionally. For example, you are a gmail user and want to send something to someone on yahoo.com. You will need your gmail user name and password to log in to your gmail account, but you don't need an account with yahoo.com to send email to someone with a yahoo.com account. If you were required to have a login with each email server you could ever want to send to, you'd have to have an insane amount of user names and passwords! This is an advantage of email, it's open, it's free, everybody can run a server and send and receive email.
Du kannst Dir die Welt machen, wie sie Dir gefällt. ;-)
If this whole thing sounds odd, keep in mind that email is an almost 50 years old system, with security, attachments, and non-ascii characters being bolted on over the years, with a constant concern for backwards compatibility. But if you couldn't telnet into other email servers, you'd never be able to send an email to anybody. As the person running the email server, you cannot create accounts for the whole world to be able to receive email from everybody.
When you do this programmatically, it depends on what library you use. Most libraries will set defaults for the headers and let you override headers as needed.