From: Ken Hornstein Date: Wed, 15 Feb 2012 16:36:36 +0000 (-0500) Subject: Beginning of support for the Local-Mailbox profile entry. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=5aab34095ffbff27be09091e703e61ddf352ad87;p=mmh Beginning of support for the Local-Mailbox profile entry. --- diff --git a/man/mh-profile.man b/man/mh-profile.man index ac10b26..9ba9f11 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -215,6 +215,22 @@ command. (context, no default) .RE .PP +.BR Local\-Mailbox : +Your Username +.RS 5 +Tells the various MH tools what your local mailbox is. If set, will be used +by the default component files by tools like +.B comp +and +.B repl +to construct your default \*(lqFrom\*(rq header. The text used here will +be copied exactly to your From: header, so it should already be RFC-822 +compliant. If this is set, the +.B Signature +profile entry is NOT used, so it should include a signature as well. (profile, +default: userid@local.hostname) +.RE +.PP .BR Alternate\-Mailboxes : mh@uci\-750a, bug-mh* .RS 5 diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 8a468bb..633f6ef 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -370,8 +370,29 @@ ismymbox (struct mailname *np) * list of alternate mailboxes. */ if (am == NULL) { + if ((am = context_find ("local-mailbox"))) { + struct mailname *mptr; + + if ((mptr = getm (am, NULL, 0, AD_NAME, NULL)) == NULL) { + admonish (NULL, "invalid entry in local-mailbox: %s", am); + return 0; + } + + /* + * Yes, we're not freeing the whole entry, because all of those + * elements contain allocated pointers that we need; maybe + * later ... + */ + + mq = *mptr; + + free(mptr); + } else { + mq.m_mbox = getusername (); + } + mq.m_next = NULL; - mq.m_mbox = getusername (); + if ((am = context_find ("alternate-mailboxes")) == NULL) am = getusername(); else {