R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
S:helo example.com
R:250 mailleur.example.com, link (cleartext) ready, your IP/FQDN=[127.127.99.25/No.Reverse]
-S:QUIT
-R:221 2.0.0 Bye, closing connection...
+S:MAIL FROM: <trouble@mailref1.example.com>
+R:457-5.5.3 Your Credential need to be checked
+R:457 5.5.3 Closing connection
+R:Disconnected
#-------------------------------------------------------------------------
*/
/********************************************************/
/* */
+/* Procedure to check remote IP credit */
+/* */
+/********************************************************/
+static _Bool checkcredit(CONTYP *contact)
+
+{
+_Bool goodcredit;
+
+goodcredit=false;
+return goodcredit;
+}
+/*
+^L
+*/
+/********************************************************/
+/* */
/* Procedure to get the domain code */
/* */
/********************************************************/
mailfrom[strlen(mailfrom)-1]='\000';
(void) memmove(mailfrom,mailfrom+1,strlen(mailfrom));
break;
- case 3 : //everything ok
+ case 3 : //check if contact authenticated
+ if (contact->authenticated==true)
+ phase++; //No need to check remote "credits
+ break;
+ case 4 : //check remote credit
+ if (checkcredit(contact)==false) {
+ (void) transmit(contact,true,"%d-5.5.3 Your Credential need to be checked",
+ NEWSITE);
+ (void) transmit(contact,true,"%d 5.5.3 Closing connection",NEWSITE);
+ phase=999; //bad credit not need to go further
+ }
+ break;
+ case 5 : //everything ok
contact->mailfrom=strdup(mailfrom);
(void) transmit(contact,true,"%d 2.1.3 %s.. sender ok",
CMDOK,contact->mailfrom);
+ success=true;
break;
default : //SAFE guard
proceed=false;
code=eml_getcode(line);
switch (code) {
case c_data : //Peer request to transfer email corps.
-
proceed=getdata(contact);
break;
case c_helo : //HELO SMTP protocol
proceed=false;
break;
case c_mail : //MAIL FROM: checking originator
- (void) checkfrom(contact,line);
+ proceed=checkfrom(contact,line);
break;
case c_auth : //Auth request
if (getauth(contact,line)==false)
#define SENDB64 334 //send a B64 sequence
#define DATAOK 354 //Ready to accept EMAIL data
#define ERRPROC 451 //local processing error
+#define NEWSITE 457 //Site credential need to be checked
#define NOANSWR 460 //no answer from remote
#define BADPAR 501 //error in parameters
#define CMDBAD 502 //command not implemented