while (proceed==true) {
(void) rou_dbglive(9,OPEP,"phase='%d'",OPEP,phase);
switch (phase) {
- case 0 : //are we encrypted and on the right port
- if (soc_iscrypted(contact->socptr)==false) {
- static char *cmt="no authentication allowed on clear chanel";
- (void) eml_status(contact,FAILED,NULL," 5.7.0 %s",cmt);
- (void) setterminator(contact,cmt);
- contact->credit-=1; //"Bad boy"
- phase=999; //No need to go further
- }
+ case 0 : //empty phase
break;
case 1 : //check buffer
if ((buffer==(char *)0)||(strlen(buffer)==0)) {
case 0 : //AUTH PLAIN
if (soc_iscrypted(contact->socptr)==true)
(void) get_auth_plain(contact,local,&rmtpass);
- else
- (void) eml_transmit(contact,true,"%d 5.7.3 Unsafe PLAIN auth mode",
- FAILED);
+ else {
+ static char *cmt="Unsafe PLAIN auth mode";
+
+ contact->credit-=2;
+ (void) eml_status(contact,FAILED,NULL," 5.7.3 %s",cmt);
+ (void) setterminator(contact,cmt);
+ }
break;
case 1 : //AUTH LOGIN
if (soc_iscrypted(contact->socptr)==true)
(void) get_auth_login(contact,&rmtpass);
- else
- (void) eml_transmit(contact,true,"%d 5.7.4 Unsafe LOGIN auth mode",
- FAILED);
+ else {
+ static char *cmt="Unsafe LOGIN auth mode";
+
+ contact->credit-=2;
+ (void) eml_status(contact,FAILED,NULL," 5.7.3 %s",cmt);
+ (void) setterminator(contact,cmt);
+ }
break;
case 2 : //AUTH DIGEST-MD5
(void) get_auth_digest_md5(contact,&rmtpass);
break;
- default : //not yet implemented
- (void) rou_alert(0,"%s auth type <%d> not yet implemented (Bug!)",
+ default : { //not yet implemented
+ static char *cmt="Unexpected auth mode";
+
+ (void) rou_alert(0,"%s auth type <%d> not yet implemented (Bug?!)",
OPEP,code);
- (void) eml_transmit(contact,true,"%d 5.7.5 Unexpected auth mode",FAILED);
+ (void) eml_status(contact,FAILED,NULL," 5.7.5 %s",cmt);
+ (void) setterminator(contact,cmt);
phase=999;
+ }
break;
}
break;