reorder code a bit.
[apps/madmutt.git] / alias.cpkg
index d1b536c..c4e739e 100644 (file)
@@ -42,7 +42,7 @@ static rx_t *Alternates = NULL, *UnAlternates = NULL;
 rx_t *MailLists = NULL, *UnMailLists = NULL;
 rx_t *SubscribedLists = NULL, *UnSubscribedLists = NULL;
 
-@static_package MAlias {
+@package MAlias {
     /*
      ** .pp
      ** Specifies the format of the data displayed for the ``alias'' menu. The
@@ -65,7 +65,43 @@ rx_t *SubscribedLists = NULL, *UnSubscribedLists = NULL;
      ** \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");
+    path_t alias_file = m_strdup("~/.madmutt/aliases");
+
+    /*
+     ** .pp
+     ** Specifies the filename of your signature, which is appended to all
+     ** outgoing messages.   If the filename ends with a pipe (``\fT|\fP''), it is
+     ** assumed that filename is a shell command and input should be read from
+     ** its stdout.
+     */
+    path_t signature = m_strdup("~/.signature");
+
+    /*
+     ** .pp
+     ** This specifies the file into which your outgoing messages should be
+     ** appended.  (This is meant as the primary method for saving a copy of
+     ** your messages, but another way to do this is using the ``$my_hdr''
+     ** command to create a \fTBcc:\fP header field with your email address in it.)
+     ** .pp
+     ** The value of \fI$$record\fP is overridden by the ``$$force_name'' and
+     ** ``$$save_name'' variables, and the ``$fcc-hook'' command.
+     */
+    path_t record = NULL;
+
+    /*
+     ** .pp
+     ** This variable contains a default from address.  It
+     ** can be overridden using my_hdr (including from send-hooks) and
+     ** ``$$reverse_name''.  This variable is ignored if ``$$use_from''
+     ** is unset.
+     ** .pp
+     ** E.g. you can use
+     ** \fTsend-hook Madmutt-devel@lists.berlios.de 'my_hdr From: Foo Bar <foo@bar.fb>'\fP
+     ** when replying to the Madmutt developer's mailing list and Madmutt takes this email address.
+     ** .pp
+     ** Defaults to the contents of the environment variable \fT$$$EMAIL\fP.
+     */
+    address_t from = rfc822_parse_adrlist(NULL, NONULL(getenv("EMAIL")));
 
     void alternates(rx_t rx) {
         rx_list_remove(&UnAlternates, rx);
@@ -175,7 +211,7 @@ int mutt_addr_is_user(address_t *addr)
     ||  string_is_address(addr->mailbox, MCore.username, MCore.shorthost)
     ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(0))
     ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(1))
-    ||  (From && !ascii_strcasecmp(From->mailbox, addr->mailbox)))
+    ||  (MAlias.from && !ascii_strcasecmp(MAlias.from->mailbox, addr->mailbox)))
     {
         return 1;
     }