🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5659

Re: Indy relaying and CC, BCC fields

#5659
From: Remy Lebeau (TeamB)
Date: Fri, 02 Jul 2004 00:09
50 lines
3043 bytes
"Stefano Bonifazi" <stefboombastic@libero.it> wrote in message
news:40e47e0f@newsgroups.borland.com...

> All works fine but when I insert email addresses in the CC
> or BCC fields cause the program raises the following exception:
> "EIdProtocolReplyError with message <username@otherdomain>
> recipient address rejected."

If you connect to a particular domain's SMTP server directly, you should not
be specifying any addresses that do not belong to that domain.

> I used otherdomain cause I assumed I'm sending an email
> (in TO: field)  with domain other than the ones in CC or BCC fields!

The CC and Bcc lists also contain recipient addresses.  All three fields are
used for delivering mail.  The server very well could reject addresses that
it does not know about or know how to reach.

> Shouldn't  the SMTP server (given to me by the DNS server)
> forward the emails in CC and BCC fields to the proper servers??

Not necessarily, no.

> Of course I can take only an email address from the CC  or BCC
> field at a time then do an MX lookup against a DNS server for
> that domain part, and finally connect directly to the SMTP server
> that the MX record point to, to deliver the message

Yes.

> but I need the email to arrive with the correct header, that
> is with the correct email addresses in the CC or BCC fields!!

That has nothing to do with it.  When a client connects to an SMTP server,
it has to specify the intended recipients *before* any of the actual message
data is then transmitted.  The client parses the message to extract the
appropriate To, Cc, and Bcc addresses and then tells the server which ones
to send to.  Whatever is contained in the message data itself is transmitted
as-is and is not parsed during transmission.  The server doesn't care what
is in the message data at all.

TIdSMTP was not really designed for handling relaying, though.  With that
said, please go to the "news.atozedsoftware.com" server and look in the
"atozedsoftware.indy.protocol.smtp" newsgroup.  I posted an example a month
ago in the "SMTP Message Delivery - Multiple Recipients" discussion thread
on this issue.


Gambit
Technical Details
Message-ID: <40e4a7c0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40e47e0f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,48782d607b4fb37f
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <40e47e0f@newsgroups.borland.com>
Subject: Re: Indy relaying and CC, BCC fields
Date: Thu, 1 Jul 2004 17:09:47 -0700
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.10
Message-ID: <40e4a7c0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088726976 68.69.17.10 (1 Jul 2004 17:09:36 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail