Annotation of researchv10no/lbin/mailx/receipt.c, revision 1.1

1.1     ! root        1: #ident "@(#)receipt.c  1.3 'attmail mail(1) command'"
        !             2: #ident "@(#)mailx:receipt.c    1.1"
        !             3: #include "rcv.h"
        !             4: 
        !             5: int            icsubstr();                                             /* adb */
        !             6: 
        !             7: void
        !             8: receipt(mp)
        !             9: struct message *mp;
        !            10: {
        !            11:        struct headline hl;
        !            12:        char    head[LINESIZE];
        !            13:        char    buf[BUFSIZ];
        !            14:        FILE    *pp, *fp;
        !            15:        char    *mail, *s;
        !            16: 
        !            17:        if ((mail = value("sendmail")) == 0)
        !            18:                mail = MAIL;
        !            19:        if (icsubstr(hfield("default-options", mp, addone), "/receipt")
        !            20:         || icsubstr(hfield(">to", mp, addto), "/receipt")) {
        !            21:                sprintf(buf, "%s %s", mail, skin(nameof(mp)));
        !            22:                if (pp = npopen(buf, "w")) {
        !            23:                        fp = setinput(mp);
        !            24:                        readline(fp, head);
        !            25:                        parse(head, &hl, buf);
        !            26:                        fprintf(pp, "Original-Date: %s\n", hl.l_date);
        !            27:                        if (s = hfield("message-id", mp, addone))
        !            28:                                fprintf(pp, "Original-Message-ID: %s\n", s);
        !            29:                        s = hfield("subject", mp, addone);
        !            30:                        fprintf(pp, "Subject: RR: %s\n", s ? s : "(none)");
        !            31:                        npclose(pp);
        !            32:                }
        !            33:        }
        !            34: }
        !            35: 
        !            36: int                                                                    /* adb */
        !            37: icsubstr(s1, s2)
        !            38: char   *s1, *s2;
        !            39: {
        !            40:        char    buf[LINESIZE];
        !            41: 
        !            42:        if (s1 && s2) {
        !            43:                istrcpy(buf, s1);
        !            44:                return substr(buf, s2) != -1;
        !            45:        } else
        !            46:                return 0;
        !            47: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.