Common Lisp Package: CLPMR-INTERNAL

README:

FUNCTION

Public

BOUNCE

Send back to the sender and discard it.

FORWARD (&REST ADDRESSES)

Send current message to ADDRESSES.

GET-HEADER (NAME &OPTIONAL (MIME-PART CURRENT-MIME))

Return the header associated to NAME of MIME-PART. Return NIL if NAME doesn't exist among the headers.

SETFGET-HEADER (VALUE NAME &OPTIONAL (MIME-PART CURRENT-MIME))

Set the header associated to HEADER-SYMBOL of MIME-PART with VALUE.

GET-HEADERS (NAME &OPTIONAL (MIME-PART CURRENT-MIME))

Just like GET-HEADER but return a list of strings; one for each occurrence of NAME header.

MATCH-HEADER (HEADER REGULAR-EXPRESSION)

Match all occurrences of HEADER to REGULAR-EXPRESSION.

SERVER

Enter server mode and start accepting connections on a Unix socket.

STOP

Stop immediately any further processing on current message.

Undocumented

ADD-CLPMR-HEADERS (&OPTIONAL (MIME-MESSAGE CURRENT-MIME))

ANSWER (BODY &KEY ATTACHMENTS BLACKLIST)

BLACKLIST (LIST)

BLACKLISTED-P (ADDRESS LIST)

DEBUG-SERVER

FORWARD-TO-PROGRAM (PROGRAM &REST ARGS)

MAIN

SAVE (&KEY (FILE (FORCE MAILBOX)))

Private

DELETE-LOCK-FILE (PATHNAME)

Remove a lock file PATHNAME.

MAKE-LOCK-FILE (PATHNAME)

Create a lock file PATHNAME. Due to the way *CLPMR-LOCKER* works, the lock file is actually PATHNAME plus a "lock" extension (type, in Lisp slang).

PARSE-ARGS (ARGS)

Set global vars based on command line options and return anything after the last optional argument.

REMOVE-SERVER-SOCKET

If present, remove the server socket that might have been left around by previous runs.

Undocumented

ABSOLUTE-FILENAME (NAME)

ENSURE-RULES

EXIT (VALUE)

FLOCK (FD OP)

IMAGE-MAIN

INTERRUPT-HANDLER (SIGNAL CODE SCP)

LOAD-RULES (FILE)

LOCK-FILE (STREAM)

LOOPING-MESSAGE-P (MESSAGE)

MAKE-ANSWER-HEADERS (ADDITIONAL-HEADERS MESSAGE)

MERGE-HEADERS (HL1 HL2)

QUOTE-MESSAGE (MESSAGE)

READ-HEADER (STREAM CHAR1 CHAR2)

REPLY-ADDRESSES (MESSAGE)

REPORT-ERROR (CONDITION DEBUGGER-HANDLER)

RUN-RULES

SENDMAIL (ADDRESSES MESSAGE)

SET-RULES (PROC)

SETUP-INTERRUPTS

UNLOCK-FILE (STREAM)

USAGE

MACRO

Public

H~ (H RE)

Abbreviation for MATCH-HEADER.

Undocumented

ON-EXIT (&BODY BODY)

RULE-SET (&BODY BODY)

Private

WITH-EXCLUSIVE-APPEND ((VAR NAME) &BODY BODY)

Execute BODY with VAR bound to a stream open in append mode on file NAME. Care is taken to lock the file before opening it.

WITH-FILE-LOCK ((STREAM) &BODY FORMS)

While executing BODY hold a Unix advisory lock on STREAM's file descriptor.

WITH-LOCK-FILE ((PATHNAME) &BODY BODY)

Execute BODY keeping a lock file. The lock file is just like PATHNAME but with type "lock".

GENERIC-FUNCTION

Public

PROCESS-MESSAGE (INPUT)

Process a mail message coming from INPUT. INPUT can be anything that can be promoted to a MIME-MESSAGE.

VARIABLE

Public

*CURRENT-MESSAGE*

During message processing this is bound to the pathname of the unparsed message.

Undocumented

*DEBUG*

*FROM-IN-REPLIES*

*REPLY-TO-IN-REPLIES*

MAILBOX

USER

Private

*CLPMR-LOCKER*

Pathname of the program responsible for the locking and unlocking of mailboxes.

*CURRENT-MIME*

During message processing this is bound to a "promise" of the MIME-PART parsed from the message.

*LOCK-EXPIRY*

How long to wait before assuming the lock was left around by a dead process.

*MAX-IDLE-TIME*

Time in seconds before the server decides to die because of boredom.

Undocumented

*ERROR-FILE*

*MAX-STACK-TRACE*

*ON-EXIT-CALLS*

*XLOOP-ID*

HOME-DIRECTORY

RULES-FILE

SERVER-SOCKET-PATHNAME

USER-MAIL-DIRECTORY

CLASS

Public

Undocumented

MAILBOX

CONSTANT

Private

Undocumented

LOCK_EX

LOCK_NB

LOCK_SH

LOCK_UN