/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "array.h"
#include "smtp-parser.h"
#include "smtp-syntax.h"
#include <ctype.h>
/*
* String
*/
{
int ret;
*value_r = "";
return 1;
}
return -1;
}
*error_r = "Invalid character in string";
return -1;
}
return 1;
}
{
return;
p = (const unsigned char *)value;
while (p < pend) {
pblock = p;
while (p < pend && smtp_char_is_atext(*p))
p++;
}
if (p >= pend)
break;
i_assert(smtp_char_is_qpair(*p));
if (!smtp_char_is_qtext(*p))
str_append_c(out, *p);
p++;
}
if (quoted)
}
/*
* Xtext encoding
*/
{
int ret;
*value_r = "";
return 1;
}
return -1;
}
*error_r = "Invalid character in xtext";
return -1;
}
*error_r = "Encountered NUL character in xtext";
return -1;
}
}
return 1;
}
{
p = data;
while (p < pend) {
pbegin = p;
while (p < pend && smtp_char_is_xtext(*p))
p++;
if (p >= pend)
break;
p++;
}
}
/*
* HELO domain
*/
bool allow_literal, const char **domain_r)
{
int ret;
if (allow_literal)
}
return -1;
return 0;
}
/*
* EHLO reply
*/
{
const char *param;
/*
ehlo-line = ehlo-keyword *( SP ehlo-param )
ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
; additional syntax of ehlo-params depends on
; ehlo-keyword
ehlo-param = 1*(%d33-126)
; any CHAR excluding <SP> and all
; control characters (US-ASCII 0-31 and 127
; inclusive)
*/
return -1;
}
return 1;
}
return -1;
}
return -1;
}
}
return -1;
}
}
}
return 1;
}
{
int ret;
*error_r = "Parameter is empty";
return -1;
}
return -1;
}
return 1;
}