Back to index

courier  0.68.2
Functions | Variables
capability.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "imapwrite.h"

Go to the source code of this file.

Functions

const char * externalauth ()
void initcapability ()
int have_starttls ()
int tlsrequired ()
int keywords ()
int fastkeywords ()
int magictrash ()
const char * imap_externalauth ()
void imapcapability ()

Variables

static int capa_keywords = 0

Function Documentation

const char* externalauth ( )

Definition at line 16 of file externalauth.c.

{
       const char *p=getenv("TLS_EXTERNAL");
       char *q, *r;

       if (!p || !*p)
              return NULL;

       if ((q=malloc(strlen(p)+20)) == NULL)
              return NULL;

       strcat(strcpy(q, "TLS_SUBJECT_"), p);

       for (r=q; *r; r++)
              if (*r >= 'a' && *r <= 'z')
                     *r -= 'a' - 'A';

       p=getenv(q);
       free(q);

       if (p && *p)
              return p;
       return 0;
}
int fastkeywords ( )

Definition at line 56 of file capability.c.

{
       return capa_keywords == 1;
}

Here is the caller graph for this function:

int have_starttls ( )

Definition at line 29 of file capability.c.

{
const char *p;

       if ((p=getenv("IMAP_STARTTLS")) == 0)     return (0);
       if (*p != 'y' && *p != 'Y')        return (0);

       p=getenv("COURIERTLS");
       if (!p || !*p)       return (0);
       if (access(p, X_OK)) return (0);
       return (1);
}

Here is the caller graph for this function:

const char* imap_externalauth ( )

Definition at line 72 of file capability.c.

{
       const char *p;

       if ((p=getenv("IMAP_TLS")) && atoi(p))
              return externalauth();

       return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void imapcapability ( )

Definition at line 83 of file capability.c.

{
       const char *p;

       if ((p=getenv("IMAP_TLS")) && atoi(p) &&
           (p=getenv("IMAP_CAPABILITY_TLS")) && *p)
              writes(p);
       else if ((p=getenv("IMAP_CAPABILITY")) != 0 && *p)
              writes(p);
       else
              writes("IMAP4rev1");

#if SMAP
       p=getenv("SMAP_CAPABILITY");

       if (p && *p)
       {
              writes(" ");
              writes(p);

              if (keywords())
                     writes(" KEYWORDS");
       }
#endif

       if ((p=getenv("IMAP_ACL")) && atoi(p))
              writes(" ACL ACL2=UNION");

       if (have_starttls())
       {
              writes(" STARTTLS");
              if (tlsrequired())
                     writes(" LOGINDISABLED");
       }
       else
       {
              if (imap_externalauth())
                     writes(" AUTH=EXTERNAL");
       }
                     

       p=getenv("OUTBOX");

       if (p && *p)
       {
              writes(" XCOURIEROUTBOX=INBOX");
              writes(p);
       }

       if (magictrash())
              writes(" XMAGICTRASH");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void initcapability ( )

Definition at line 22 of file capability.c.

{
       const char *p=getenv("IMAP_KEYWORDS");

       if (p) capa_keywords=atoi(p);
}

Here is the caller graph for this function:

int keywords ( )

Definition at line 51 of file capability.c.

{
       return capa_keywords != 0;
}

Here is the caller graph for this function:

int magictrash ( )

Definition at line 61 of file capability.c.

{
       const char *p;

       p=getenv("IMAP_MOVE_EXPUNGE_TO_TRASH");

       if (p && atoi(p))
              return 1;
       return 0;
}

Here is the caller graph for this function:

int tlsrequired ( )

Definition at line 43 of file capability.c.

{
const char *p=getenv("IMAP_TLS_REQUIRED");

       if (p && atoi(p))       return (1);
       return (0);
}

Here is the caller graph for this function:


Variable Documentation

int capa_keywords = 0 [static]

Definition at line 18 of file capability.c.