s/qmail 4.2.29a
Next generation secure email transport
Loading...
Searching...
No Matches
Macros | Functions | Variables
qmail-popup.c File Reference
#include <unistd.h>
#include "commands.h"
#include "fd.h"
#include "sig.h"
#include "stralloc.h"
#include "buffer.h"
#include "alloc.h"
#include "wait.h"
#include "str.h"
#include "byte.h"
#include "now.h"
#include "fmt.h"
#include "case.h"
#include "exit.h"
#include "timeout.h"
#include "env.h"
#include "tls_start.h"
#include "ip.h"
Include dependency graph for qmail-popup.c:

Go to the source code of this file.

Macros

#define PORT_POP3S   "995"
 
#define FDIN   0
 
#define FDOUT   1
 
#define FDAUTH   3
 
#define FDLOG   5
 

Functions

void die ()
 
ssize_t saferead (int fd, char *buf, int len)
 
ssize_t safewrite (int fd, char *buf, int len)
 
void outs (char *s)
 
void flush ()
 
void err (char *s)
 
void logs (char *s)
 
void logp (char *s)
 
void logh (char *s1, char *s2)
 
void logu (char *s)
 
void logn (char *s)
 
void logpid ()
 
void log_pop (char *s1, char *s2, char *s3, char *s4, char *s5, char *s6)
 
void die_usage ()
 
void die_nomem ()
 
void die_pipe ()
 
void die_write ()
 
void die_fork ()
 
void die_childcrashed ()
 
void die_badauth ()
 
void die_tls ()
 
void die_notls ()
 
void err_syntax ()
 
void err_wantuser ()
 
void err_authoriz ()
 
void okay ()
 
void pop3_quit ()
 
void poplog_init ()
 
void doanddie (char *user, unsigned int userlen, char *pass)
 
void pop3_greet ()
 
void pop3_user (char *arg)
 
void pop3_pass (char *arg)
 
void pop3_apop (char *arg)
 
void pop3_capa (char *arg)
 
void pop3_stls (char *arg)
 
int main (int argc, char **argv)
 

Variables

char outbuf [128]
 
buffer bo = BUFFER_INIT(safewrite,FDOUT,outbuf,sizeof(outbuf))
 
char inbuf [128]
 
buffer bi = BUFFER_INIT(saferead,FDIN,inbuf,sizeof(inbuf))
 
stralloc protocol = {0}
 
stralloc auth = {0}
 
char * localport
 
char * remoteip
 
char * remotehost
 
char strnum [FMT_ULONG]
 
char logbuf [512]
 
buffer bl = BUFFER_INIT(safewrite,FDLOG,logbuf,sizeof(logbuf))
 
char unique [FMT_ULONG+FMT_ULONG+3]
 
char * hostname
 
stralloc username = {0}
 
int seenuser = 0
 
char ** childargs
 
buffer ba
 
char authbuf [128]
 
int stls = 0
 
int seenstls = 0
 
int apop = 0
 
struct commands pop3commands []
 

Macro Definition Documentation

◆ FDAUTH

#define FDAUTH   3

Definition at line 23 of file qmail-popup.c.

◆ FDIN

#define FDIN   0

Definition at line 21 of file qmail-popup.c.

◆ FDLOG

#define FDLOG   5

Definition at line 24 of file qmail-popup.c.

◆ FDOUT

#define FDOUT   1

Definition at line 22 of file qmail-popup.c.

◆ PORT_POP3S

#define PORT_POP3S   "995"

Definition at line 20 of file qmail-popup.c.

Function Documentation

◆ die()

void die ( )

Definition at line 26 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_badauth()

void die_badauth ( )

Definition at line 93 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_childcrashed()

void die_childcrashed ( )

Definition at line 92 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_fork()

void die_fork ( )

Definition at line 91 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_nomem()

void die_nomem ( void  )

Definition at line 88 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_notls()

void die_notls ( )

Definition at line 95 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_pipe()

void die_pipe ( )

Definition at line 89 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_tls()

void die_tls ( )

Definition at line 94 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_usage()

void die_usage ( )

Definition at line 87 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ die_write()

void die_write ( )

Definition at line 90 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doanddie()

void doanddie ( char *  user,
unsigned int  userlen,
char *  pass 
)

Definition at line 136 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ err()

void err ( char *  s)

Definition at line 58 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ err_authoriz()

void err_authoriz ( )

Definition at line 103 of file qmail-popup.c.

Here is the call graph for this function:

◆ err_syntax()

void err_syntax ( void  )

Definition at line 101 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ err_wantuser()

void err_wantuser ( )

Definition at line 102 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush()

void flush ( )

Definition at line 54 of file qmail-popup.c.

Here is the caller graph for this function:

◆ log_pop()

void log_pop ( char *  s1,
char *  s2,
char *  s3,
char *  s4,
char *  s5,
char *  s6 
)

Definition at line 84 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logh()

void logh ( char *  s1,
char *  s2 
)

Definition at line 80 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logn()

void logn ( char *  s)

Definition at line 82 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logp()

void logp ( char *  s)

Definition at line 79 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logpid()

void logpid ( )

Definition at line 83 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logs()

void logs ( char *  s)

Definition at line 78 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logu()

void logu ( char *  s)

Definition at line 81 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 272 of file qmail-popup.c.

Here is the call graph for this function:

◆ okay()

void okay ( )

Definition at line 105 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ outs()

void outs ( char *  s)

Definition at line 50 of file qmail-popup.c.

Here is the caller graph for this function:

◆ pop3_apop()

void pop3_apop ( char *  arg)

Definition at line 219 of file qmail-popup.c.

Here is the call graph for this function:

◆ pop3_capa()

void pop3_capa ( char *  arg)

Definition at line 231 of file qmail-popup.c.

Here is the call graph for this function:

◆ pop3_greet()

void pop3_greet ( )

Definition at line 180 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pop3_pass()

void pop3_pass ( char *  arg)

Definition at line 211 of file qmail-popup.c.

Here is the call graph for this function:

◆ pop3_quit()

void pop3_quit ( )

Definition at line 106 of file qmail-popup.c.

Here is the call graph for this function:

◆ pop3_stls()

void pop3_stls ( char *  arg)

Definition at line 245 of file qmail-popup.c.

Here is the call graph for this function:

◆ pop3_user()

void pop3_user ( char *  arg)

Definition at line 201 of file qmail-popup.c.

Here is the call graph for this function:

◆ poplog_init()

void poplog_init ( )

Definition at line 108 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saferead()

ssize_t saferead ( int  fd,
char *  buf,
int  len 
)

Definition at line 28 of file qmail-popup.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ safewrite()

ssize_t safewrite ( int  fd,
char *  buf,
int  len 
)

Definition at line 36 of file qmail-popup.c.

Here is the call graph for this function:

Variable Documentation

◆ apop

int apop = 0

Definition at line 134 of file qmail-popup.c.

◆ auth

stralloc auth = {0}

Definition at line 69 of file qmail-popup.c.

◆ authbuf

char authbuf[128]

Definition at line 131 of file qmail-popup.c.

◆ ba

buffer ba

Definition at line 130 of file qmail-popup.c.

◆ bi

buffer bi = BUFFER_INIT(saferead,FDIN,inbuf,sizeof(inbuf))

Definition at line 48 of file qmail-popup.c.

◆ bl

buffer bl = BUFFER_INIT(safewrite,FDLOG,logbuf,sizeof(logbuf))

Definition at line 76 of file qmail-popup.c.

◆ bo

buffer bo = BUFFER_INIT(safewrite,FDOUT,outbuf,sizeof(outbuf))

Definition at line 45 of file qmail-popup.c.

◆ childargs

char** childargs

Definition at line 129 of file qmail-popup.c.

◆ hostname

char* hostname

Definition at line 126 of file qmail-popup.c.

◆ inbuf

char inbuf[128]

Definition at line 47 of file qmail-popup.c.

◆ localport

char* localport

Definition at line 70 of file qmail-popup.c.

◆ logbuf

char logbuf[512]

Definition at line 75 of file qmail-popup.c.

◆ outbuf

char outbuf[128]

Definition at line 44 of file qmail-popup.c.

◆ pop3commands

struct commands pop3commands[]
Initial value:
= {
{ "user", pop3_user, 0 }
, { "pass", pop3_pass, 0 }
, { "apop", pop3_apop, 0 }
, { "quit", pop3_quit, 0 }
, { "capa", pop3_capa, 0 }
, { "stls", pop3_stls, 0 }
, { "noop", okay, 0 }
, { 0, err_authoriz, 0 }
}
void pop3_quit()
Definition: qmail-popup.c:106
void pop3_user(char *arg)
Definition: qmail-popup.c:201
void pop3_capa(char *arg)
Definition: qmail-popup.c:231
void pop3_apop(char *arg)
Definition: qmail-popup.c:219
void okay()
Definition: qmail-popup.c:105
void err_authoriz()
Definition: qmail-popup.c:103
void pop3_stls(char *arg)
Definition: qmail-popup.c:245
void pop3_pass(char *arg)
Definition: qmail-popup.c:211

Definition at line 261 of file qmail-popup.c.

◆ protocol

stralloc protocol = {0}

Definition at line 68 of file qmail-popup.c.

◆ remotehost

char* remotehost

Definition at line 72 of file qmail-popup.c.

◆ remoteip

char* remoteip

Definition at line 71 of file qmail-popup.c.

◆ seenstls

int seenstls = 0

Definition at line 133 of file qmail-popup.c.

◆ seenuser

int seenuser = 0

Definition at line 128 of file qmail-popup.c.

◆ stls

int stls = 0

Definition at line 132 of file qmail-popup.c.

◆ strnum

char strnum[FMT_ULONG]

Definition at line 74 of file qmail-popup.c.

◆ unique

char unique[FMT_ULONG+FMT_ULONG+3]

Definition at line 125 of file qmail-popup.c.

◆ username

stralloc username = {0}

Definition at line 127 of file qmail-popup.c.