Hello Bob,
 |Bob Tennent <[email protected]> wrote:
 ||In 14.7.1, this command saves to a file user. And 14-8.0

I had to do that today...  In v14.8.1 we can with the new
"special" prefix ./, so that you can do "resend ./user@..." to
address a file.  On [master] already.  This was a great
observation of yours, it is more consistent than it was before
methinks.

 ||doesn't build on a Centos-6 system:

That would make me kinda nervous if i wouldn't i have eaten so
much this evening.  Digesting until Monday..
Ciao!

--steffen

commit 2cf5890
Author: Steffen (Daode) Nurpmeso <[email protected]>
Date:   2015-05-23 22:03:04 +0200

    Recipient address spec. change: "^\./" -> file (Bob Tennent)..

    The recipient address type detection is real magic.
    Bob correctly pointed out that it is impossible to save a file in
    a name that equals the sender:

      resend user@...
      In 14.7.1, this command saves to a file user.

    This is even more mystical given that (POSIX) mail(x) supports
    some – imho strange nowadays – commands which have exactly this
    semantic, e.g., `Copy':

      In the capitalized form, save the specified messages in a file
      whose name is derived from the author of the message

    So yes we do

      if (memchr(addr, '@', agp->ag_slen) == NULL) {

    and only if that condition is entered "addr" may be a file.
    Given the above plus the fact that we already special treat
    a leading "|" (vertical bar) to force the remains to be
    interpreted as a pipe specification, i think it is well acceptable
    to add the special condition of leading "./" (dot slash) to force
    the remains to be treated as a file name.
---
 head.c | 14 ++++----------
 nail.1 |  5 +++++
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/head.c b/head.c
index c5948b5..d4c48c7 100644
--- a/head.c
+++ b/head.c
@@ -291,20 +291,14 @@ _addrspec_check(int skinned, struct addrguts *agp)
    if (!skinned)
       goto jaddr_check;
 
-   /* Excerpt from nail.1:
-    * Recipient address specifications
-    * The rules are: Any name which starts with a `|' character specifies
-    * a pipe,  the  command  string  following  the `|' is executed and
-    * the message is sent to its standard input; any other name which
-    * contains a  `@' character  is treated as a mail address; any other
-    * name which starts with a `+' character specifies a folder name; any
-    * other name  which  contains  a  `/' character  but  no `!'  or `%'
-    * character before also specifies a folder name; what remains is
-    * treated as a mail  address */
+   /* When changing any of the following adjust any RECIPIENTADDRSPEC;
+    * grep the latter for the complete picture */
    if (*addr == '|') {
       agp->ag_n_flags |= NAME_ADDRSPEC_ISPIPE;
       goto jleave;
    }
+   if (addr[0] == '.' && addr[1] == '/')
+      goto jisfile;
    if (memchr(addr, '@', agp->ag_slen) == NULL) {
       if (*addr == '+')
          goto jisfile;
diff --git a/nail.1 b/nail.1
index afc0f7a..15c450f 100644
--- a/nail.1
+++ b/nail.1
@@ -626,6 +626,8 @@ is not set then only network addresses (see
 .Xr mailaddr 7
 for a description of mail addresses) and aliases may be used, though.
 .
+\" When changing any of the following adjust any RECIPIENTADDRSPEC;
+\" grep the latter for the complete picture
 ^ note: missing . fixed on [master], too x.x
 .Pp
 If the variable
 .Va expandaddr
@@ -635,6 +637,9 @@ Any name which starts with a vertical bar
 character specifies a pipe \(en the command string following the
 .Ql |
 is executed and the message is sent to its standard input;
+Likewise, any name that starts with the character sequence
+.Ql ./
+(dot slash) is treated as a file, regardless of the remaining content.
 Any other name which contains an at sign
 .Ql @
 character is treated as a network address;

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users

Reply via email to