2006-12-06 19:26:24 +03:00
|
|
|
/* $NetBSD: def.h,v 1.23 2006/12/06 16:26:24 christos Exp $ */
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-06-29 09:09:04 +04:00
|
|
|
* Copyright (c) 1980, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 15:13:06 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1996-12-28 10:10:57 +03:00
|
|
|
* @(#)def.h 8.4 (Berkeley) 4/20/95
|
2006-12-06 19:26:24 +03:00
|
|
|
* $NetBSD: def.h,v 1.23 2006/12/06 16:26:24 christos Exp $
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mail -- a mail program
|
|
|
|
*
|
|
|
|
* Author: Kurt Shoens (UCB) March 25, 1978
|
|
|
|
*/
|
|
|
|
|
2006-10-31 23:07:32 +03:00
|
|
|
#ifndef __DEF_H__
|
|
|
|
#define __DEF_H__
|
|
|
|
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/ioctl.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
#include <sys/stat.h>
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <sys/param.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
#include <sys/time.h>
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <sys/wait.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <err.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <paths.h>
|
|
|
|
#include <pwd.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
#include <signal.h>
|
|
|
|
#include <stdio.h>
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <stdlib.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
#include <string.h>
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <termios.h>
|
1998-04-02 14:31:09 +04:00
|
|
|
#include <time.h>
|
1997-10-19 09:02:57 +04:00
|
|
|
#include <unistd.h>
|
1994-06-29 09:09:04 +04:00
|
|
|
#include "pathnames.h"
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
#define APPEND /* New mail goes to end of mailbox */
|
|
|
|
|
2006-10-31 23:07:32 +03:00
|
|
|
#define COMMENT_CHAR '#' /* Comment character when sourcing */
|
1993-03-21 12:45:37 +03:00
|
|
|
#define ESCAPE '~' /* Default escape for sending */
|
|
|
|
#define NMLSIZE 1024 /* max names in a message list */
|
|
|
|
#define PATHSIZE MAXPATHLEN /* Size of pathnames throughout */
|
|
|
|
#define HSHSIZE 59 /* Hash size for aliases and vars */
|
|
|
|
#define LINESIZE BUFSIZ /* max readable line width */
|
|
|
|
#define MAXARGC 1024 /* Maximum list of raw strings */
|
|
|
|
#define MAXEXP 25 /* Maximum expansion of aliases */
|
|
|
|
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define PUBLIC /* make it easy to find the entry points */
|
|
|
|
|
2006-10-31 23:07:32 +03:00
|
|
|
/*
|
|
|
|
* User environment variable names.
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
* See complete.h, mime.h, and thread.h for names specific to those modules.
|
2006-10-31 23:07:32 +03:00
|
|
|
*/
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define ENAME_INDENT_POSTSCRIPT "indentpostscript"
|
|
|
|
#define ENAME_INDENT_PREAMBLE "indentpreamble"
|
|
|
|
#define ENAME_APPEND "append"
|
|
|
|
#define ENAME_ASK "ask"
|
|
|
|
#define ENAME_ASKBCC "askbcc"
|
|
|
|
#define ENAME_ASKCC "askcc"
|
|
|
|
#define ENAME_ASKSUB "asksub"
|
|
|
|
#define ENAME_AUTOINC "autoinc"
|
|
|
|
#define ENAME_AUTOPRINT "autoprint"
|
|
|
|
#define ENAME_CRT "crt"
|
|
|
|
#define ENAME_DEAD "DEAD"
|
|
|
|
#define ENAME_DEBUG "debug"
|
|
|
|
#define ENAME_DONTSENDEMPTY "dontsendempty"
|
|
|
|
#define ENAME_DOT "dot"
|
|
|
|
#define ENAME_EDITOR "EDITOR"
|
|
|
|
#define ENAME_ENABLE_PIPES "enable-pipes"
|
|
|
|
#define ENAME_ESCAPE "escape"
|
|
|
|
#define ENAME_FOLDER "folder"
|
|
|
|
#define ENAME_HEADER_FORMAT "header-format"
|
|
|
|
#define ENAME_HOLD "hold"
|
|
|
|
#define ENAME_IGNORE "ignore"
|
|
|
|
#define ENAME_IGNOREEOF "ignoreeof"
|
|
|
|
#define ENAME_INDENTPREFIX "indentprefix"
|
|
|
|
#define ENAME_INTERACTIVE "interactive"
|
|
|
|
#define ENAME_KEEP "keep"
|
|
|
|
#define ENAME_KEEPSAVE "keepsave"
|
|
|
|
#define ENAME_LISTER "LISTER"
|
|
|
|
#define ENAME_MBOX "MBOX"
|
|
|
|
#define ENAME_METOO "metoo"
|
|
|
|
#define ENAME_NOHEADER "noheader"
|
|
|
|
#define ENAME_NOSAVE "nosave"
|
|
|
|
#define ENAME_PAGER "PAGER"
|
|
|
|
#define ENAME_PAGER_OFF "pager-off"
|
|
|
|
#define ENAME_PROMPT "prompt"
|
|
|
|
#define ENAME_QUIET "quiet"
|
2006-10-31 23:07:32 +03:00
|
|
|
#define ENAME_RECORD "record"
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define ENAME_REGEX_SEARCH "regex-search"
|
|
|
|
#define ENAME_REPLYALL "Replyall"
|
|
|
|
#define ENAME_REPLYASRECIPIENT "ReplyAsRecipient"
|
|
|
|
#define ENAME_SCREEN "screen"
|
|
|
|
#define ENAME_SCREENHEIGHT "screenheight"
|
|
|
|
#define ENAME_SCREENWIDTH "screenwidth"
|
|
|
|
#define ENAME_SEARCHHEADERS "searchheaders"
|
|
|
|
#define ENAME_SENDMAIL "sendmail"
|
|
|
|
#define ENAME_SHELL "SHELL"
|
|
|
|
#define ENAME_SHOW_RCPT "show-rcpt"
|
|
|
|
#define ENAME_SMOPTS_VERIFY "smopts-verify"
|
|
|
|
#define ENAME_TOPLINES "toplines"
|
|
|
|
#define ENAME_VERBOSE "verbose"
|
|
|
|
#define ENAME_VISUAL "VISUAL"
|
2006-10-31 23:07:32 +03:00
|
|
|
|
|
|
|
#define sizeofarray(a) (sizeof(a)/sizeof(*a))
|
1993-03-21 12:45:37 +03:00
|
|
|
#define equal(a, b) (strcmp(a,b)==0)/* A nice function to string compare */
|
|
|
|
|
|
|
|
struct message {
|
|
|
|
short m_flag; /* flags, see below */
|
|
|
|
short m_offset; /* offset in block of message */
|
2005-07-20 03:07:10 +04:00
|
|
|
long m_block; /* block number of this message */
|
1996-12-28 10:10:57 +03:00
|
|
|
long m_lines; /* Lines in the message */
|
2005-07-20 03:07:10 +04:00
|
|
|
off_t m_size; /* Bytes in the message */
|
2002-03-29 18:07:52 +03:00
|
|
|
long m_blines; /* Body (non-header) lines */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* threading fields
|
|
|
|
*/
|
|
|
|
int m_index; /* message index in this thread */
|
|
|
|
int m_depth; /* depth in thread */
|
|
|
|
struct message *m_flink; /* link to next message */
|
|
|
|
struct message *m_blink; /* link to previous message */
|
|
|
|
struct message *m_clink; /* link to child of this message */
|
|
|
|
struct message *m_plink; /* link to parent of thread */
|
1993-03-21 12:45:37 +03:00
|
|
|
};
|
2006-10-22 01:37:20 +04:00
|
|
|
typedef struct mime_info mime_info_t; /* phantom structure only to attach.c */
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* flag bits.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MUSED (1<<0) /* entry is used, but this bit isn't */
|
|
|
|
#define MDELETED (1<<1) /* entry has been deleted */
|
|
|
|
#define MSAVED (1<<2) /* entry has been saved */
|
|
|
|
#define MTOUCH (1<<3) /* entry has been noticed */
|
|
|
|
#define MPRESERVE (1<<4) /* keep entry in sys mailbox */
|
|
|
|
#define MMARK (1<<5) /* message is marked! */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define MMODIFY (1<<6) /* message has been modified */
|
1993-03-21 12:45:37 +03:00
|
|
|
#define MNEW (1<<7) /* message has never been seen */
|
|
|
|
#define MREAD (1<<8) /* message has been read sometime. */
|
|
|
|
#define MSTATUS (1<<9) /* message status has changed */
|
|
|
|
#define MBOX (1<<10) /* Send this to mbox, regardless */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define MTAGGED (1<<11) /* message has been tagged */
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Given a file address, determine the block number it represents.
|
|
|
|
*/
|
|
|
|
#define blockof(off) ((int) ((off) / 4096))
|
|
|
|
#define offsetof(off) ((int) ((off) % 4096))
|
|
|
|
#define positionof(block, offset) ((off_t)(block) * 4096 + (offset))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Format of the command description table.
|
|
|
|
* The actual table is declared and initialized
|
|
|
|
* in lex.c
|
|
|
|
*/
|
|
|
|
struct cmd {
|
2005-07-19 05:38:38 +04:00
|
|
|
const char *c_name; /* Name of command */
|
2002-03-02 17:59:35 +03:00
|
|
|
int (*c_func)(void *); /* Implementor of the command */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
int c_pipe; /* Pipe output through the pager */
|
|
|
|
# define C_PIPE_PAGER 1 /* enable use of pager */
|
2006-12-06 19:26:24 +03:00
|
|
|
# define C_PIPE_CRT 2 /* use the pager if CRT is defined */
|
|
|
|
# define C_PIPE_SHELL 4 /* enable shell pipes */
|
2006-10-22 01:37:20 +04:00
|
|
|
#ifdef USE_EDITLINE
|
Jumbo mail patch from our anonymous user:
1) Use editline [optional]:
Most of this code was borrowed from src/usr.bin/ftp. It does the
appropriate editing, history, and completion for all mail commands
(from cmdtab[]) and also does editing on header strings ('~h' inside
the mail editor).
2) '-B' flag:
This will suppress the "To:" line passed to sendmail. In most
configurations it will lead to sendmail adding "To: undisclosed
recipients;". Currently, AFAIK mail requires at least one exposed
recipient address.
3) Comments in rcfile:
Currently, comments in .mailrc are only supported if the first
(non-white) character on a line is '#' followed by white space,
i.e., '#' is a 'nop' command. This (trivial) patch allows the more
normal/expected use of '#' as a comment character. It does not
respect quoting, so that might be an objection which I should fix.
4) Sendmail option editing:
This adds the sendmail option string to the strings editable by the
'~h' command within the mail editor. Currently, you can only set
this string from the command-line, which is particularly annoying
when replying to mail.
5) Reply from:
When replying to a message, grab the "To:" address from the message
and, if there is only one such address and it does not match a list of
allowed addresses (set in the "ReplyFrom" variable), pass it to
sendmail as the "From:" address for the reply (with the '-f' option).
I often make aliases for myself so that my primary address is not
given out; if the alias gets out, I know who to blame. Unfortunately,
a reply to such a message would normally use the primary address
without this patch. A warning is displayed when this is going to
happen so that it can be modified with '~h'.
6) CC and BCC lists:
Allow '-c' and '-b' to accept white-space or ',' delimited lists.
Currently, a white-space delimited list of addresses work, but a
list of aliases will not get expanded. For example, currently:
mail -c "foo bar" christos
will fail to send mail to 'foo' and 'bar' if these are mail aliases
(in ~/.mailrc); sendmail aliases (in /etc/aliases) do work.
7) pipe command:
This pipes the current message into a shell command. I use this for
quick decoding of uuencoded mail, but I can imagine it might be
useful for decrypting encrypted mail, too.
8) show command:
This command takes a list of variables and shows their values. It
is probably stupid as the 'set' command without any argument
displays all variable values. Of course, if there are a lot of
variables you have to sift through the list for the one(s) you want.
2006-09-18 23:46:21 +04:00
|
|
|
const char *c_complete; /* String describing completion */
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
short c_argtype; /* Type of arglist (see below) */
|
|
|
|
short c_msgflag; /* Required flags of messages */
|
|
|
|
short c_msgmask; /* Relevant flags of messages */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Yechh, can't initialize unions */
|
|
|
|
|
|
|
|
#define c_minargs c_msgflag /* Minimum argcount for RAWLIST */
|
|
|
|
#define c_maxargs c_msgmask /* Max argcount for RAWLIST */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Argument types.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MSGLIST 0 /* Message list type */
|
|
|
|
#define STRLIST 1 /* A pure string */
|
|
|
|
#define RAWLIST 2 /* Shell string list */
|
|
|
|
#define NOLIST 3 /* Just plain 0 */
|
|
|
|
#define NDMLIST 4 /* Message list, no defaults */
|
|
|
|
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define P 0x010 /* Autoprint dot after command */
|
|
|
|
#define I 0x020 /* Interactive command bit */
|
|
|
|
#define M 0x040 /* Legal from send mode bit */
|
|
|
|
#define W 0x080 /* Illegal when read only bit */
|
|
|
|
#define F 0x100 /* Is a conditional command */
|
|
|
|
#define T 0x200 /* Is a transparent command */
|
|
|
|
#define R 0x400 /* Cannot be called from collect */
|
|
|
|
#define ARGTYPE_MASK ~(P|I|M|W|F|T|R)
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Oft-used mask values
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MMNORM (MDELETED|MSAVED)/* Look at both save and delete bits */
|
|
|
|
#define MMNDEL MDELETED /* Look only at deleted bit */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure used to return a break down of a head
|
|
|
|
* line (hats off to Bill Joy!)
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct headline {
|
|
|
|
char *l_from; /* The name of the sender */
|
|
|
|
char *l_tty; /* His tty string (if any) */
|
|
|
|
char *l_date; /* The entire date string */
|
|
|
|
};
|
|
|
|
|
Jumbo mail patch from our anonymous user:
1) Use editline [optional]:
Most of this code was borrowed from src/usr.bin/ftp. It does the
appropriate editing, history, and completion for all mail commands
(from cmdtab[]) and also does editing on header strings ('~h' inside
the mail editor).
2) '-B' flag:
This will suppress the "To:" line passed to sendmail. In most
configurations it will lead to sendmail adding "To: undisclosed
recipients;". Currently, AFAIK mail requires at least one exposed
recipient address.
3) Comments in rcfile:
Currently, comments in .mailrc are only supported if the first
(non-white) character on a line is '#' followed by white space,
i.e., '#' is a 'nop' command. This (trivial) patch allows the more
normal/expected use of '#' as a comment character. It does not
respect quoting, so that might be an objection which I should fix.
4) Sendmail option editing:
This adds the sendmail option string to the strings editable by the
'~h' command within the mail editor. Currently, you can only set
this string from the command-line, which is particularly annoying
when replying to mail.
5) Reply from:
When replying to a message, grab the "To:" address from the message
and, if there is only one such address and it does not match a list of
allowed addresses (set in the "ReplyFrom" variable), pass it to
sendmail as the "From:" address for the reply (with the '-f' option).
I often make aliases for myself so that my primary address is not
given out; if the alias gets out, I know who to blame. Unfortunately,
a reply to such a message would normally use the primary address
without this patch. A warning is displayed when this is going to
happen so that it can be modified with '~h'.
6) CC and BCC lists:
Allow '-c' and '-b' to accept white-space or ',' delimited lists.
Currently, a white-space delimited list of addresses work, but a
list of aliases will not get expanded. For example, currently:
mail -c "foo bar" christos
will fail to send mail to 'foo' and 'bar' if these are mail aliases
(in ~/.mailrc); sendmail aliases (in /etc/aliases) do work.
7) pipe command:
This pipes the current message into a shell command. I use this for
quick decoding of uuencoded mail, but I can imagine it might be
useful for decrypting encrypted mail, too.
8) show command:
This command takes a list of variables and shows their values. It
is probably stupid as the 'set' command without any argument
displays all variable values. Of course, if there are a lot of
variables you have to sift through the list for the one(s) you want.
2006-09-18 23:46:21 +04:00
|
|
|
#define GTO 0x001 /* Grab To: line */
|
|
|
|
#define GSUBJECT 0x002 /* Likewise, Subject: line */
|
|
|
|
#define GCC 0x004 /* And the Cc: line */
|
|
|
|
#define GBCC 0x008 /* And also the Bcc: line */
|
|
|
|
#define GSMOPTS 0x010 /* Grab the sendmail options */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define GMISC 0x020 /* miscellaneous extra fields for sending */
|
2006-10-22 01:37:20 +04:00
|
|
|
#ifdef MIME_SUPPORT
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
#define GMIME 0x040 /* mime flag */
|
2006-10-22 01:37:20 +04:00
|
|
|
#endif
|
Jumbo mail patch from our anonymous user:
1) Use editline [optional]:
Most of this code was borrowed from src/usr.bin/ftp. It does the
appropriate editing, history, and completion for all mail commands
(from cmdtab[]) and also does editing on header strings ('~h' inside
the mail editor).
2) '-B' flag:
This will suppress the "To:" line passed to sendmail. In most
configurations it will lead to sendmail adding "To: undisclosed
recipients;". Currently, AFAIK mail requires at least one exposed
recipient address.
3) Comments in rcfile:
Currently, comments in .mailrc are only supported if the first
(non-white) character on a line is '#' followed by white space,
i.e., '#' is a 'nop' command. This (trivial) patch allows the more
normal/expected use of '#' as a comment character. It does not
respect quoting, so that might be an objection which I should fix.
4) Sendmail option editing:
This adds the sendmail option string to the strings editable by the
'~h' command within the mail editor. Currently, you can only set
this string from the command-line, which is particularly annoying
when replying to mail.
5) Reply from:
When replying to a message, grab the "To:" address from the message
and, if there is only one such address and it does not match a list of
allowed addresses (set in the "ReplyFrom" variable), pass it to
sendmail as the "From:" address for the reply (with the '-f' option).
I often make aliases for myself so that my primary address is not
given out; if the alias gets out, I know who to blame. Unfortunately,
a reply to such a message would normally use the primary address
without this patch. A warning is displayed when this is going to
happen so that it can be modified with '~h'.
6) CC and BCC lists:
Allow '-c' and '-b' to accept white-space or ',' delimited lists.
Currently, a white-space delimited list of addresses work, but a
list of aliases will not get expanded. For example, currently:
mail -c "foo bar" christos
will fail to send mail to 'foo' and 'bar' if these are mail aliases
(in ~/.mailrc); sendmail aliases (in /etc/aliases) do work.
7) pipe command:
This pipes the current message into a shell command. I use this for
quick decoding of uuencoded mail, but I can imagine it might be
useful for decrypting encrypted mail, too.
8) show command:
This command takes a list of variables and shows their values. It
is probably stupid as the 'set' command without any argument
displays all variable values. Of course, if there are a lot of
variables you have to sift through the list for the one(s) you want.
2006-09-18 23:46:21 +04:00
|
|
|
#define GMASK (GTO|GSUBJECT|GCC|GBCC|GSMOPTS)
|
1993-03-21 12:45:37 +03:00
|
|
|
/* Mask of places from whence */
|
|
|
|
|
Jumbo mail patch from our anonymous user:
1) Use editline [optional]:
Most of this code was borrowed from src/usr.bin/ftp. It does the
appropriate editing, history, and completion for all mail commands
(from cmdtab[]) and also does editing on header strings ('~h' inside
the mail editor).
2) '-B' flag:
This will suppress the "To:" line passed to sendmail. In most
configurations it will lead to sendmail adding "To: undisclosed
recipients;". Currently, AFAIK mail requires at least one exposed
recipient address.
3) Comments in rcfile:
Currently, comments in .mailrc are only supported if the first
(non-white) character on a line is '#' followed by white space,
i.e., '#' is a 'nop' command. This (trivial) patch allows the more
normal/expected use of '#' as a comment character. It does not
respect quoting, so that might be an objection which I should fix.
4) Sendmail option editing:
This adds the sendmail option string to the strings editable by the
'~h' command within the mail editor. Currently, you can only set
this string from the command-line, which is particularly annoying
when replying to mail.
5) Reply from:
When replying to a message, grab the "To:" address from the message
and, if there is only one such address and it does not match a list of
allowed addresses (set in the "ReplyFrom" variable), pass it to
sendmail as the "From:" address for the reply (with the '-f' option).
I often make aliases for myself so that my primary address is not
given out; if the alias gets out, I know who to blame. Unfortunately,
a reply to such a message would normally use the primary address
without this patch. A warning is displayed when this is going to
happen so that it can be modified with '~h'.
6) CC and BCC lists:
Allow '-c' and '-b' to accept white-space or ',' delimited lists.
Currently, a white-space delimited list of addresses work, but a
list of aliases will not get expanded. For example, currently:
mail -c "foo bar" christos
will fail to send mail to 'foo' and 'bar' if these are mail aliases
(in ~/.mailrc); sendmail aliases (in /etc/aliases) do work.
7) pipe command:
This pipes the current message into a shell command. I use this for
quick decoding of uuencoded mail, but I can imagine it might be
useful for decrypting encrypted mail, too.
8) show command:
This command takes a list of variables and shows their values. It
is probably stupid as the 'set' command without any argument
displays all variable values. Of course, if there are a lot of
variables you have to sift through the list for the one(s) you want.
2006-09-18 23:46:21 +04:00
|
|
|
#define GNL 0x100 /* Print blank line after */
|
|
|
|
#define GDEL 0x200 /* Entity removed from list */
|
|
|
|
#define GCOMMA 0x400 /* detract puts in commas */
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2006-10-22 01:37:20 +04:00
|
|
|
#ifdef MIME_SUPPORT
|
|
|
|
/*
|
|
|
|
* Structure of MIME content.
|
|
|
|
*/
|
|
|
|
struct Content {
|
|
|
|
const char *C_type; /* content type */
|
|
|
|
const char *C_encoding; /* content transfer encoding */
|
|
|
|
const char *C_disposition; /* content disposition */
|
|
|
|
const char *C_description; /* content description */
|
|
|
|
const char *C_id; /* content id */
|
|
|
|
};
|
|
|
|
/* Header strings corresponding to the above Content fields. */
|
|
|
|
#define MIME_HDR_TYPE "Content-Type"
|
|
|
|
#define MIME_HDR_ENCODING "Content-Transfer-Encoding"
|
|
|
|
#define MIME_HDR_DISPOSITION "Content-Disposition"
|
|
|
|
#define MIME_HDR_ID "Content-ID"
|
|
|
|
#define MIME_HDR_DESCRIPTION "Content-Description"
|
|
|
|
#define MIME_HDR_VERSION "MIME-Version"
|
|
|
|
/* the value of the MIME-Version field */
|
|
|
|
#define MIME_VERSION "1.0"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ATTACH_INVALID = 0, /* do not use! */
|
|
|
|
ATTACH_FNAME = 1,
|
|
|
|
ATTACH_MSG = 2,
|
|
|
|
ATTACH_FILENO = 3
|
|
|
|
} attach_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure of a MIME attachment.
|
|
|
|
*/
|
|
|
|
struct attachment {
|
|
|
|
struct attachment *a_flink; /* Forward link in list. */
|
|
|
|
struct attachment *a_blink; /* Backward list link */
|
|
|
|
|
|
|
|
attach_t a_type; /* attachment type */
|
|
|
|
#if 1
|
|
|
|
union {
|
|
|
|
char *u_name; /* file name */
|
|
|
|
struct message *u_msg; /* message */
|
|
|
|
int u_fileno; /* file number */
|
|
|
|
} a_u;
|
|
|
|
|
|
|
|
#define a_name a_u.u_name
|
|
|
|
#define a_msg a_u.u_msg
|
|
|
|
#define a_fileno a_u.u_fileno
|
|
|
|
#else
|
|
|
|
char *a_name; /* file name */
|
|
|
|
struct message *a_msg; /* message */
|
|
|
|
int a_fileno; /* file number */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct Content a_Content; /* MIME content strings */
|
|
|
|
};
|
|
|
|
#endif /* MIME_SUPPORT */
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Structure used to pass about the current
|
|
|
|
* state of the user-typed message header.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct header {
|
|
|
|
struct name *h_to; /* Dynamic "To:" string */
|
|
|
|
char *h_subject; /* Subject string */
|
|
|
|
struct name *h_cc; /* Carbon copies string */
|
|
|
|
struct name *h_bcc; /* Blind carbon copies */
|
|
|
|
struct name *h_smopts; /* Sendmail options */
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
char *h_in_reply_to;
|
|
|
|
struct name *h_references;
|
2006-10-22 01:37:20 +04:00
|
|
|
#ifdef MIME_SUPPORT
|
|
|
|
char *h_mime_boundary; /* MIME multipart boundary string */
|
|
|
|
struct Content h_Content; /* MIME content for message */
|
|
|
|
struct attachment *h_attach; /* MIME attachments */
|
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure of namelist nodes used in processing
|
|
|
|
* the recipients of mail and aliases and all that
|
|
|
|
* kind of stuff.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct name {
|
|
|
|
struct name *n_flink; /* Forward link in list. */
|
|
|
|
struct name *n_blink; /* Backward list link */
|
|
|
|
short n_type; /* From which list it came */
|
|
|
|
char *n_name; /* This fella's name */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Structure of a variable node. All variables are
|
|
|
|
* kept on a singly-linked list of these, rooted by
|
|
|
|
* "variables"
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct var {
|
|
|
|
struct var *v_link; /* Forward link to next variable */
|
|
|
|
char *v_name; /* The variable's name */
|
|
|
|
char *v_value; /* And it's current value */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct group {
|
|
|
|
struct group *ge_link; /* Next person in this group */
|
|
|
|
char *ge_name; /* This person's user name */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct grouphead {
|
|
|
|
struct grouphead *g_link; /* Next grouphead in list */
|
|
|
|
char *g_name; /* Name of this group */
|
|
|
|
struct group *g_list; /* Users in group. */
|
|
|
|
};
|
|
|
|
|
2006-10-31 23:07:32 +03:00
|
|
|
struct smopts_s {
|
|
|
|
struct smopts_s *s_link; /* Link to next smopts_s in list */
|
|
|
|
char *s_name; /* Name of this smopts_s */
|
|
|
|
struct name *s_smopts; /* sendmail options name list */
|
|
|
|
};
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Structure of the hash table of ignored header fields
|
|
|
|
*/
|
|
|
|
struct ignoretab {
|
2005-07-20 03:07:10 +04:00
|
|
|
size_t i_count; /* Number of entries */
|
1993-03-21 12:45:37 +03:00
|
|
|
struct ignore {
|
|
|
|
struct ignore *i_link; /* Next ignored field in bucket */
|
|
|
|
char *i_field; /* This ignored field */
|
|
|
|
} *i_head[HSHSIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
* Constants for conditional commands. These control whether we
|
|
|
|
* should be executing commands or not.
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
struct cond_stack_s {
|
|
|
|
struct cond_stack_s *c_next;
|
|
|
|
int c_cond;
|
|
|
|
};
|
|
|
|
#define CNONE 0x00 /* Execute everything */
|
|
|
|
#define CSKIP 0x01 /* Do not execute commands */
|
|
|
|
#define CIF 0x02 /* Inside if/endif block */
|
|
|
|
#define CELSE 0x04 /* The last conditional was else */
|
|
|
|
#define CIGN 0x08 /* Conditional in a skipped block */
|
|
|
|
|
|
|
|
enum mailmode_e {
|
|
|
|
mm_receiving, /* receiving mail mode */
|
|
|
|
mm_sending, /* sending mail mode */
|
|
|
|
mm_hdrsonly /* headers only mode */
|
|
|
|
};
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Kludges to handle the change from setexit / reset to setjmp / longjmp
|
|
|
|
*/
|
|
|
|
|
2005-07-20 03:07:10 +04:00
|
|
|
#define setexit() (void)setjmp(srbuf)
|
1993-03-21 12:45:37 +03:00
|
|
|
#define reset(x) longjmp(srbuf, x)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Truncate a file to the last character written. This is
|
|
|
|
* useful just before closing an old file that was opened
|
|
|
|
* for read/write.
|
|
|
|
*/
|
1994-06-29 09:09:04 +04:00
|
|
|
#define trunc(stream) { \
|
|
|
|
(void)fflush(stream); \
|
|
|
|
(void)ftruncate(fileno(stream), (off_t)ftell(stream)); \
|
1994-03-23 04:32:50 +03:00
|
|
|
}
|
2006-10-22 01:37:20 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Make this static inline available everywhere.
|
|
|
|
*/
|
|
|
|
static inline char*
|
From Anon Ymous:
1) Statification of modules.
2) Implement the 'detach' and 'Detach' commands for extracting mime
parts from messages.
3) Teach mail to output "In-Reply-To" and "References" header fields
when replying so others can thread us.
4) Implement threading, sorting, and tagging, supported by the
following commands: 'flatten', 'reverse', 'sort', 'thread',
'unthread', 'down', 'tset', 'up', 'expose', 'hide', 'tag',
'untag', 'invtags', 'tagbelow', 'hidetags', 'showtags'.
See the manpage for details (when available - soon).
5) Implement a 'deldups' command to delete duplicate messages based on
their "Message-Id" field, e.g., in replies to a mailing list that
are also CCed to a subscriber. (This can also be accomplished with
the threading and tagging commands.)
6) Implement 'ifdef' and 'ifndef' commands, and make the conditionals
nestable (i.e., implement a conditional stack). The if/else/endif
commands existed before, but they were primitive and undocumented.
The 'if' command currently recognizes the "receiving", "sending",
and "headersonly" mode keywords.
7) Teach the message selecting routine to understand regular
expressions if "regex-search" is defined. Otherwise only case
insensitive substring matches are done (as in the past).
8) Teach the message selection routine to understand boolean
expressions. Improved "colon-modifier" support. See the manpage
for details (when available - soon).
9) Extend paging to all commands (where relevant).
10) Add shell like piping and redirection of (standard) output (if
"enable-piping" is defined). Extend completion to these contexts.
11) The manpage should follow soon!!!!
2006-11-28 21:45:32 +03:00
|
|
|
skip_blank(char *cp)
|
2006-10-22 01:37:20 +04:00
|
|
|
{
|
|
|
|
while (isblank((unsigned char)*cp))
|
|
|
|
cp++;
|
|
|
|
return cp;
|
|
|
|
}
|
2006-10-31 23:07:32 +03:00
|
|
|
|
|
|
|
#endif /* __DEF_H__ */
|