static _Bool doehlo(CONTYP *contact,char *parameter)
{
-static char *ehlostr[]= {
- "-STARTTLS",
- "-8BITMIME",
- "-ENHANCEDSTATUSCODES",
- " AUTH CRAM-MD5 DIGEST-MD5",
- (char *)0
+static struct {
+ int display; //0 ->always, 1-->plain 2-->crypted
+ char *str; //the message to display
+ }ehlo[]={
+ {1,"STARTTLS"},
+ {2,"AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5"},
+ {0,"SIZE "MXMSIZE},
+ {0,"8BITMIME"},
+ {0,"ENHANCEDSTATUSCODES"},
+ {0,(char *)0}
};
#define OPEP "lvleml.c:doehlo"
break;
case 1 : //thereis an FQDN
(void) linkready(contact,true);
- (void) transmit(contact,false,"%d-SIZE %ld",CMDOK,MXMSIZE);
if (soc_iscrypted(contact->socptr)==true)
strstart++;
- for (int i=strstart;ehlostr[i]!=(char *)0;i++) {
- (void) transmit(contact,false,"%d%s",CMDOK,ehlostr[i]);
+ for (int i=strstart;ehlo[i].str!=(char *)0;i++) {
+ char space;
+
+ space='-';
+ if (ehlo[i+1].str==(char *)0)
+ space=' ';
+ switch (ehlo[i].display) {
+ case 0 : //always display
+ break;
+ case 1 : //display on plain only
+ if (soc_iscrypted(contact->socptr)==true)
+ continue;
+ break;
+ case 2 : //display on crypted only
+ if (soc_iscrypted(contact->socptr)==false)
+ continue;
+ break;
+ }
+ (void) transmit(contact,false,"%d%c%s",CMDOK,space,ehlo[i].str);
}
(void) transmit(contact,true,"");
done=true;
#define HFROM "From: " //Then email header header from
#define HTITLE "Subject: " //Then email subject entry
-#define MXMSIZE 52428800 //52 Megabytes
+#define MXMSIZE "52428800" //52 Megabytes
#define CRLF "\r\n" //EOL within SMTP protocol
#define SIGNON 220 //signon information
#define QUITOK 221 //status on quit