Solved

SMTP CC & BCC (Telnet like application)

Posted on 2006-06-14
5
9,040 Views
Last Modified: 2012-06-27
Hi all,

I'm working on a new SMTP class for the company I work for, as the one that comes packaged with .Net does not support certain features.

Now,

I've got everything working apart from the CC and BCC. It seems to work to an point but theres a little problem.

Within my class i've built-in a log method, which logs each request and response made to the SMTP server (via sockets).

heres my output:

New Log 14/06/2006

< : 220 mail.****.co.uk ESMTP Sendmail 8.10.2/8.10.2; Wed, 14 Jun 2006 08:15:30 +0100 : Wed, 14 Jun 2006 08:39:50 GMT
> : HELO ****: Wed, 14 Jun 2006 08:39:50 GMT
< : 250 mail.****.co.uk Hello [192.168.0.69], pleased to meet you : Wed, 14 Jun 2006 08:39:50 GMT
> : MAIL FROM: <root@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.0 <root@****.co.uk>... Sender ok : Wed, 14 Jun 2006 08:39:50 GMT
> : RCPT TO: <Gavin@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.5 <Gavin@****.co.uk>... Recipient ok : Wed, 14 Jun 2006 08:39:50 GMT
> : RCPT TO: <admin@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.5 <admin@****.co.uk>... Recipient ok : Wed, 14 Jun 2006 08:39:50 GMT
> : DATA : Wed, 14 Jun 2006 08:39:50 GMT
< : 354 Please start mail input. : Wed, 14 Jun 2006 08:39:50 GMT
> : Subject: DSSMTP Test Message
MIME-Version: 1.0
Content-Type: multipart/mixed;
      boundary="----_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE"
Message-ID: <QZTMDYDNMT.GGYLTHBWJE@****.co.uk>
From: "Gavin @ Work" <root@****.co.uk>
To: "Gavin Roberts" <Gavin@****.co.uk>
Bcc: "Gavin @ Home" <admin@****.co.uk>

------_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE
Content-Type: text/plain;
      charset="iso-8859-1"

This is a test

Does it work?!

------_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE--


. : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 Mail queued for delivery. : Wed, 14 Jun 2006 08:39:50 GMT
> : QUIT : Wed, 14 Jun 2006 08:39:50 GMT
< : 221 Closing connection. Good bye. : Wed, 14 Jun 2006 08:39:50 GMT

It seems that although I specified a name and e-mail address for the bcc recepient, it's some how managed to send both e-mails with the name and e-mail address of the To recepient.

** EDIT ** Both e-mails are received on the accounts sent to, it's just the sent to name appears the same for both e-mails (the e-mail address and name specified in the To: within the e-mail header).

And since there is no RCPT CC or RCPT BCC command in SMTP, I have been informed that you just set RCPT TO for all the e-mail addresses you want to send to, and then the e-mail header deals with the rest.

Just to let you know, both e-mails I receive have no idea that there are two recepients, just that one of the e-mails has the wrong name and e-mail address showing.

Does anyone know of why this is happening and how I can resolve this?!

It's pretty urgent so 250 points will go down quite nicely for anyone that can help solve this.

Thanks
0
Comment
Question by:gRoberts12
  • 3
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 250 total points
Comment Utility
That is the way it works. rcpt to is the actual recipients to, cc, or bcc regardless.  what shows in the headers part is just text and pretty well irrelevant,don't specify the bcc there at all and the to entrywill be seen by all and doesn't have to be a real recipient listed in rcpt to.

0
 
LVL 1

Author Comment

by:gRoberts12
Comment Utility
I've just been reading a little more about, and well what you say is partially true, it still sends the e-mail as BCC but it keeps the main recepients e-mail address and name as the display name it was sent to.

I've adapted my script to send the e-mails to BCC recepients seperately, so i've pretty much sorted it.

I'll mark your reply as the answer.

Regards

Gav
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
that's what I was getting at. bcc just really means an entry in rcpt to but not normaly in the headers... everyone sees what goes in the headers, I.e. to and cc.  typing this on pda hence keeping it short.

not keen on b grades but thanks for the paq, an a doesn't cost any more you know.
0
 
LVL 1

Author Comment

by:gRoberts12
Comment Utility
apologies, the reason why I marked it as such is because I really answered my own question.

But out of kindness & as a Thank you for taking your time I gave you the points as well.

I was going to disbute the points, and ask for them back but I feel that's an insult against your self, as you took the time to deal with my question, although it wasn't a real solution, if I hadn't of figured it out before hand, your reply would of resulted in me resolving the issue.

If the points didn't say Thank You (enough or at all),

Thank you for your effort.

Regards

Gav
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
no problem...
Steve
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Lets look at the default installation and configuration of FreeProxy 4.10 REQUIREMENTS 1. FreeProxy 4.10 Application - Can be downloaded here (http://www.handcraftedsoftware.org/index.php?page=download) 2. Ensure that you disable the windows fi…
What’s a web proxy server? A proxy server is a server that goes between clients and web servers, used in corporate to enforce corporate browsing policy and ensure security. Proxy servers are commonly used in three modes. A)    Forward proxy …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now