]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
faxcover: Add from-mail-address feature
authorAidan Van Dyk <aidan@ifax.com>
Mon, 28 Apr 2008 20:33:38 +0000 (20:33 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Mon, 28 Apr 2008 20:33:38 +0000 (20:33 +0000)
Based on Lee's commit:
| commit 967221f223fa762a060f384f2c96145c57a2ddd9
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Tue Oct 23 17:45:13 2007 +0000
|
|     Riccardo Magliocchetti contributes "from-mail-address" feature for faxcover.

faxcover/faxcover.c++
libhylafax/FaxDB.c++
libhylafax/FaxDB.h
libhylafax/SendFaxClient.c++
man/faxcover.1

index 2aeedf7d8536eb8d1b02302b71d6bbb55ba895ac..ec6fd570188623e0deefb358c4cb71f81707c579 100644 (file)
@@ -51,6 +51,7 @@ private:
     fxStr      fromVoiceNumber;        // sender's voice number
     fxStr      fromLocation;   // sender's geographical location
     fxStr      fromCompany;    // sender's company/institution
+    fxStr      fromMailAddr;   // sender's email address
     fxStr      regarding;      // fax is regarding...
     fxStr      comments;       // general comments
     fxStr      sender;         // sender's identity
@@ -110,7 +111,7 @@ faxCoverApp::initialize(int argc, char** argv)
        cover = cp;
 
     setupPageSize("default");
-    while ((c = Sys::getopt(argc, argv, "C:D:L:N:V:X:n:t:f:c:p:l:m:r:s:v:x:z:")) != -1)
+    while ((c = Sys::getopt(argc, argv, "C:D:L:M:N:V:X:n:t:f:c:p:l:m:r:s:v:x:z:")) != -1)
        switch (c) {
        case 's':                       // page size
            setupPageSize(optarg);
@@ -124,6 +125,9 @@ faxCoverApp::initialize(int argc, char** argv)
        case 'L':                       // sender's geographic location
            fromLocation = optarg;
            break;
+       case 'M':                       // sender's email address
+           fromMailAddr = optarg;
+           break;
        case 'N':                       // sender's fax number
            fromFaxNumber = optarg;
            break;
@@ -210,6 +214,7 @@ faxCoverApp::usage()
        " [-C template-file]"
        " [-D date-format]"
        " [-L from-location]"
+       " [-M from-mail-address]"
        " [-N from-fax-number]"
        " [-V from-voice-number]"
        " [-X from-company]"
@@ -393,6 +398,7 @@ faxCoverApp::emitFromDefs(FaxDBRecord* rec)
        fromLocation = rec->find("Location");
        fromFaxNumber = rec->find(FaxDB::numberKey);
        fromVoiceNumber = rec->find("Voice-Number");
+       fromMailAddr = rec->find("Mail-Address");
        fxStr areaCode(rec->find("Area-Code"));
        if (areaCode != "") {
            if (fromFaxNumber != "")
@@ -406,6 +412,7 @@ faxCoverApp::emitFromDefs(FaxDBRecord* rec)
     coverDef("from-voice-number",fromVoiceNumber);
     coverDef("from-company",   fromCompany);
     coverDef("from-location",  fromLocation);
+    coverDef("from-mail-address",      fromMailAddr);
 }
 
 void
index edeeff323842b8d52174fad7000bd714557f4998..07f61508f8a0b942e2497ec4e05bb8dbd2805d9f 100644 (file)
@@ -85,6 +85,7 @@ fxStr FaxDB::numberKey("FAX-Number");
 fxStr FaxDB::companyKey("Company");
 fxStr FaxDB::locationKey("Location");
 fxStr FaxDB::phoneKey("Voice-Number");
+fxStr FaxDB::mailAddrKey("Mail-Address");
 
 FaxDBRecord*
 FaxDB::find(const fxStr& s, fxStr* name)
index d5269a0616f20be33f8438a765321bdec60e32f0..e00caadcb5b12674d741f6f4c3db3f6ec67cea99 100644 (file)
@@ -73,6 +73,7 @@ public:
     static fxStr locationKey;
     static fxStr phoneKey;
     static fxStr companyKey;
+    static fxStr mailAddrKey;
 
     FaxDBRecord* find(const fxStr& pat, fxStr* name = 0);
     FaxDBRecord* operator[](const fxStr& name);
index 397c4f79f057757cd014920644cacbb300abd537..7a23580c406a35835f2ceedd8cd390484c1cb2b5 100644 (file)
@@ -211,6 +211,7 @@ SendFaxClient::makeCoverPage(const SendFaxJob& job, fxStr& file, fxStr& emsg)
        addarg(av, ac, "-D", dateFormat);
        addarg(av, ac, "-c", job.getCoverComments());
        addarg(av, ac, "-f", senderName);
+       addarg(av, ac, "-M", job.getMailbox());
        addarg(av, ac, "-l", job.getCoverLocation());
        addarg(av, ac, "-n", job.getExternalNumber());
        addarg(av, ac, "-r", job.getCoverRegarding());
index c985b0fc70d5e40e5a45328eafe50c2c92ce4f6f..ce78bd188889ddf3dff7b8977d645aec6b94df8b 100644 (file)
@@ -69,6 +69,7 @@ symbols are defined:
 \fIto-location\fP      destination geographic location \fIfrom-location\fP     sender geographic location
 \fIto-voice-number\fP  person's voice phone number     \fIfrom-voice-number\fP sender's voice phone number
 \fIto-fax-number\fP    destination fax phone number    \fIfrom-fax-number\fP   sender's fax phone number
+\fI\fP         \fIfrom-mail-address\fP sender's e-mail address
 \fIcomments\fP unbroken comment string \fIcommentsX\fP \fI\s-1X\s+1\fP'th line of comments
 \fIregarding\fP        Re: subject     \fICommentX\fP  similar to \fIcommentsX\fP
 \fIpageWidth\fP        page width in millimeters       \fIpage-count\fP        # pages other than cover page
@@ -224,6 +225,11 @@ indicates the maximum number of
 .I commentsX
 lines to generate.
 .TP 12
+.BI \-M " address"
+Use
+.I address
+for the sender's e-mail address.
+.TP 12
 .BI \-n " number"
 Use
 .I number