Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdSMTPServer - Questions (differences between v9 and v10)
#7
Hi again,

Just wondering.. in v10, there is a RcptTo event:
IdSMTPServer1RcptTo(ASender: TIdSMTPServerContext; const AAddress: String; AParams: TStrings; var VAction: TIdRCPToReply; var VForward: String);

I've got that one coded up, if the AAddress is local, it's accepted, if it's external it's only accepted if the user is logged in (pluis a few other checks). Oh and I have SPF fully implemented checking TXT (parsing a, mx, include: ), A records and MX..

However, then I hit a snag...

IdSMTPServer1MsgReceive(ASender: TIdSMTPServerContext; AMsg: TStream; var VAction: TIdDataReply);

EEeeeek!

So, I've done:
Msg := TIdMessage.Create;
Msg.LoadFromStream(AMsg);

But now I am stuck with a new problem... who is it TO?

ASender.RCPTList.EMailAddresses (and similar under ASender.RCPTList) !!!

But there could be many there.. how do I know which one I approved earlier in RcptTo? - I could use a variable somewhere but I kinda thought it would be made available in the parameters!

It looks like I need to loop through the items and process every single address all over again to determine if it's ok or a fail. Is that correct or am I missing something? Should I just call the RcptTo event on each address?

Obviously if it's an outgoing mail I guess that's straight forward but if it's incoming for a local user and there's lots of addresses in there that is gonna require more cpu cycles right?
Reply


Messages In This Thread
RE: TIdSMTPServer - Questions (differences between v9 and v10) - by Justin Case - 07-16-2024, 11:38 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)