*/
int CtdlIsMe(char *addr, int addr_buf_len)
{
- struct recptypes *recp;
+ recptypes *recp;
int i;
recp = validate_recipients(addr, NULL, 0);
}
-/*
- * Citadel protocol command to do the same
- */
-void cmd_isme(char *argbuf) {
- char addr[256];
-
- if (CtdlAccessCheck(ac_logged_in)) return;
- extract_token(addr, argbuf, 0, '|', sizeof addr);
-
- if (CtdlIsMe(addr, sizeof addr)) {
- cprintf("%d %s\n", CIT_OK, addr);
- }
- else {
- cprintf("%d Not you.\n", ERROR + ILLEGAL_VALUE);
- }
-
-}
-
-
/* If the last item in a list of recipients was truncated to a partial address,
* remove it completely in order to avoid choking libSieve
*/
*
* Caller needs to free the result using free_recipients()
*/
-struct recptypes *validate_recipients(const char *supplied_recipients,
- const char *RemoteIdentifier,
- int Flags) {
+recptypes *validate_recipients(const char *supplied_recipients,
+ const char *RemoteIdentifier,
+ int Flags) {
struct CitContext *CCC = CC;
- struct recptypes *ret;
+ recptypes *ret;
char *recipients = NULL;
char *org_recp;
char this_recp[256];
int in_quotes = 0;
/* Initialize */
- ret = (struct recptypes *) malloc(sizeof(struct recptypes));
+ ret = (recptypes *) malloc(sizeof(recptypes));
if (ret == NULL) return(NULL);
/* Set all strings to null and numeric values to zero */
- memset(ret, 0, sizeof(struct recptypes));
+ memset(ret, 0, sizeof(recptypes));
if (supplied_recipients == NULL) {
recipients = strdup("");
/*
- * Destructor for struct recptypes
+ * Destructor for recptypes
*/
-void free_recipients(struct recptypes *valid) {
+void free_recipients(recptypes *valid) {
if (valid == NULL) {
return;
sField < pFieldEnd;
pField++, sField++)
{
- if ((*sField=='\r') || (*sField=='\n')) {
- sField++;
- if (*sField == '\n')
- sField++;
- *pField = *sField;
+ if ((*sField=='\r') || (*sField=='\n'))
+ {
+ int Offset = 1;
+ while (((*(sField + Offset) == '\r') ||
+ (*(sField + Offset) == '\n') ||
+ (isspace(*(sField + Offset)))) &&
+ (sField + Offset < pFieldEnd))
+ Offset ++;
+ sField += Offset;
+ *pField = *sField;
}
else {
if (*sField=='\"') quote = 1 - quote;
}
return(coll);
}
-
-
-CTDL_MODULE_INIT(internet_addressing)
-{
- if (!threading) {
- CtdlRegisterProtoHook(cmd_isme, "ISME", "Determine whether an email address belongs to a user");
- }
- return "internet_addressing";
-}