From 552847916ae6671d52db12880ee337f880cc766b Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Tue, 27 Mar 2007 01:45:10 +0200 Subject: [PATCH] Reinstate documentation, also migrate use_domain to MCore. Signed-off-by: Pierre Habouzit --- alias.cpkg | 23 ++++++- init.h | 7 -- lib-lua/lua-token.sh | 1 + lib-lua/madmutt.cpkg | 149 ++++++++++++++++++++++++++++++++++++++++--- mutt.h | 1 - send.c | 2 +- 6 files changed, 163 insertions(+), 20 deletions(-) diff --git a/alias.cpkg b/alias.cpkg index b6b1dbe..7f9843e 100644 --- a/alias.cpkg +++ b/alias.cpkg @@ -39,7 +39,28 @@ @import "lib-lua/base.cpkg" @static_package MAlias { + /* + ** .pp + ** Specifies the format of the data displayed for the ``alias'' menu. The + ** following \fTprintf(3)\fP-style sequences are available: + ** .pp + ** .dl + ** .dt %a .dd alias name + ** .dt %f .dd flags - currently, a "d" for an alias marked for deletion + ** .dt %n .dd index number + ** .dt %r .dd address which alias expands to + ** .dt %t .dd character which indicates if the alias is tagged for inclusion + ** .de + */ string_t alias_format = m_strdup("%4n %2f %t %-10a %r"); + /* + ** .pp + ** The default file in which to save aliases created by the + ** ``$create-alias'' function. + ** .pp + ** \fBNote:\fP Madmutt will not automatically source this file; you must + ** explicitly use the ``$source'' command for it to be executed. + */ path_t alias_file = m_strdup("~/.madmutt/aliases"); }; @@ -357,7 +378,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) last = address_list_append(last, pop); } - if (option(OPTUSEDOMAIN)) { + if (MCore.use_domain) { /* now qualify all local addresses */ rfc822_qualify(head, mutt_fqdn(1)); } diff --git a/init.h b/init.h index ab8d050..e6ae39c 100644 --- a/init.h +++ b/init.h @@ -3322,13 +3322,6 @@ struct option_t MuttVars[] = { ** flag when sending 8-bit messages to enable ESMTP negotiation or tell ** libESMTP to do so. */ - {"use_domain", DT_BOOL, R_NONE, OPTUSEDOMAIN, "yes" }, - /* - ** .pp - ** When \fIset\fP, Madmutt will qualify all local addresses (ones without the - ** @host portion) with the value of ``$$hostname''. If \fIunset\fP, no - ** addresses will be qualified. - */ {"use_from", DT_BOOL, R_NONE, OPTUSEFROM, "yes" }, /* ** .pp diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index c5ea76c..a7d9916 100644 --- a/lib-lua/lua-token.sh +++ b/lib-lua/lua-token.sh @@ -131,6 +131,7 @@ exit 0 ## shell ## sysconfdir ## tmpdir +## use_domain ## username ## version ## yes diff --git a/lib-lua/madmutt.cpkg b/lib-lua/madmutt.cpkg index fd56f52..10cb39f 100644 --- a/lib-lua/madmutt.cpkg +++ b/lib-lua/madmutt.cpkg @@ -55,24 +55,122 @@ static char *madmutt_init_homedir(void) #endif @package MCore { + /* + ** .pp + ** \fIThis is a read-only system property and specifies madmutt's + ** version string.\fP + */ const string_t version = VERSION; + /* + ** .pp + ** \fIThis is a read-only system property and specifies madmutt's + ** subversion revision string.\fP + */ const string_t sysconfdir = SYSCONFDIR; + /* + ** .pp + ** \fIThis is a read-only system property and specifies the + ** directory containing the madmutt binary.\fP + */ const string_t bindir = BINDIR; + /* + ** .pp + ** \fIThis is a read-only system property and specifies the + ** directory containing the madmutt documentation.\fP + */ const string_t docdir = PKGDOCDIR; + /* + ** .pp + ** \fIThis is a read-only system property and specifies the + ** header chaching's database backend.\fP + */ const string_t hcache_backend = HCACHE_BACKEND; - path_t dotlock = m_strdup(BINDIR "/mutt_dotlock"); - path_t editor = m_strdup(getenv("VISUAL") ?: getenv("EDITOR") ?: "vi"); - path_t shell = madmutt_init_shell(); - path_t username = madmutt_init_username(); - path_t homedir = madmutt_init_homedir(); - path_t tmpdir = m_strdup(getenv("TMPDIR") ?: "/tmp"); - rx_t gecos_mask = luaM_rxnew("^[^,]*"); + /* + ** .pp + ** Contains the path of the \fTmadmutt_dotlock(1)\fP binary to be used by + ** Madmutt. + */ + path_t dotlock = m_strdup(BINDIR "/mutt_dotlock"); + /* + ** .pp + ** This variable specifies which editor is used by Madmutt. + ** It defaults to the value of the \fT$$$VISUAL\fP, or \fT$$$EDITOR\fP, environment + ** variable, or to the string "\fTvi\fP" if neither of those are set. + */ + path_t editor = m_strdup(getenv("VISUAL") ?: getenv("EDITOR") ?: "vi"); + /* + ** .pp + ** Command to use when spawning a subshell. By default, the user's login + ** shell from \fT/etc/passwd\fP is used. + */ + path_t shell = madmutt_init_shell(); - quadopt_t quit = M_YES; - bool beep = 1; - bool beep_new = 0; + /* TODO: document */ + path_t username = madmutt_init_username(); + /* TODO: document */ + path_t homedir = madmutt_init_homedir(); + + /* + ** .pp + ** This variable allows you to specify where Madmutt will place its + ** temporary files needed for displaying and composing messages. If + ** this variable is not set, the environment variable \fT$$$TMPDIR\fP is + ** used. If \fT$$$TMPDIR\fP is not set then "\fT/tmp\fP" is used. + */ + path_t tmpdir = m_strdup(getenv("TMPDIR") ?: "/tmp"); + /* + ** .pp + ** A regular expression used by Madmutt to parse the GECOS field of a password + ** entry when expanding the alias. By default the regular expression is set + ** to ``\fT^[^,]*\fP'' which will return the string up to the first ``\fT,\fP'' encountered. + ** If the GECOS field contains a string like "lastname, firstname" then you + ** should do: \fTset gecos_mask=".*"\fP. + ** .pp + ** This can be useful if you see the following behavior: you address a e-mail + ** to user ID stevef whose full name is Steve Franklin. If Madmutt expands + ** stevef to ``Franklin'' stevef@foo.bar then you should set the gecos_mask to + ** a regular expression that will match the whole name so Madmutt will expand + ** ``Franklin'' to ``Franklin, Steve''. + */ + rx_t gecos_mask = luaM_rxnew("^[^,]*"); + + /* + ** .pp + ** This variable controls whether ``quit'' and ``exit'' actually quit + ** from Madmutt. If it set to \fIyes\fP, they do quit, if it is set to \fIno\fP, they + ** have no effect, and if it is set to \fIask-yes\fP or \fIask-no\fP, you are + ** prompted for confirmation when you try to quit. + */ + quadopt_t quit = M_YES; + /* + ** .pp + ** When this variable is \fIset\fP, Madmutt will beep when an error occurs. + */ + bool beep = 1; + /* + ** .pp + ** When this variable is \fIset\fP, Madmutt will beep whenever it prints a message + ** notifying you of new mail. This is independent of the setting of the + ** ``$$beep'' variable. + */ + bool beep_new = 0; + + /* + ** .pp + ** When \fIset\fP, Madmutt will qualify all local addresses (ones without the + ** @host portion) with the value of ``$$hostname''. If \fIunset\fP, no + ** addresses will be qualified. + */ + bool use_domain = 1; + + /* + ** .pp + ** \fIThis is a read-only system property and, at runtime, + ** specifies the current working directory of the madmutt + ** binary.\fP + */ const string_t pwd(void) { char path[_POSIX_PATH_MAX]; getcwd(path, sizeof(path)); @@ -81,11 +179,42 @@ static char *madmutt_init_homedir(void) }; @package MTransport { + /* + ** .pp + ** Specifies the program and arguments used to deliver mail sent by Madmutt. + ** Madmutt expects that the specified program interprets additional + ** arguments as recipient addresses. + */ path_t sendmail = m_strdup(SENDMAIL " -eom -oi"); + /* + ** .pp + ** \fBNote:\fP you should not enable this unless you are using Sendmail + ** 8.8.x or greater or in connection with the SMTP support via libESMTP. + ** .pp + ** This variable sets the request for when notification is returned. The + ** string consists of a comma separated list (no spaces!) of one or more + ** of the following: \fInever\fP, to never request notification, + ** \fIfailure\fP, to request notification on transmission failure, + ** \fIdelay\fP, to be notified of message delays, \fIsuccess\fP, to be + ** notified of successful transmission. + ** .pp + ** Example: \fTset dsn_notify="failure,delay"\fP + */ /* TODO: check it's NULL, hdrs or full */ string_t dsn_notify = NULL; + /* + ** .pp + ** \fBNote:\fP you should not enable this unless you are using Sendmail + ** 8.8.x or greater or in connection with the SMTP support via libESMTP. + ** .pp + ** This variable controls how much of your message is returned in DSN + ** messages. It may be set to either \fIhdrs\fP to return just the + ** message header, or \fIfull\fP to return the full message. + ** .pp + ** Example: \fTset dsn_return=hdrs\fP + */ /* TODO: check it's never, delay, failure, success with ',' */ string_t dsn_return = NULL; }; diff --git a/mutt.h b/mutt.h index 3bab146..15a9710 100644 --- a/mutt.h +++ b/mutt.h @@ -330,7 +330,6 @@ enum { OPTTILDE, OPTUNCOLLAPSEJUMP, OPTUSE8BITMIME, - OPTUSEDOMAIN, OPTUSEFROM, OPTUSEGPGAGENT, #ifdef HAVE_LIBIDN diff --git a/send.c b/send.c index 6ca6963..2c06429 100644 --- a/send.c +++ b/send.c @@ -965,7 +965,7 @@ address_t *mutt_default_from (void) if (From) adr = address_dup(From); - else if (option (OPTUSEDOMAIN)) { + else if (MCore.use_domain) { const char *fqdn = mutt_fqdn (1); adr = address_new(); adr->mailbox = p_new(char, m_strlen(MCore.username) + m_strlen(fqdn) + 2); -- 2.20.1