Menu

#14 ncid-page subject line customization.

closed
None
1
2015-09-19
2015-09-14
Anonymous
No

I had an old version of NCID on a server that has been running for years. It has finally crashed. I just install the latest NCID. Previous versions of ncid used to show the name and number in the subject line of emails it sent. This version only shows the number as "xxx-xxx-xxxx"\r with no name. Is there a way to modify the subject line of email pages so that it can show the name and number instead of just the number? thanks.

Discussion

  • John L. Chmielewski

    You are correct. The reason for just using $NMBR as the subject line no longer applies. Version 1.2 will go back to a subject line of "$NMBR $NAME". The new release should be within a couple of weeks, but it is an easy modification if you want the new subject line immediately.

    as root edit /usr/share/ncid/ncid-page
    change line 83 from: [ -n "$PageOpt" ] && PageOpt="$PageOpt \"$NMBR\"\n"
    to: [ -n "$PageOpt" ] && PageOpt="$PageOpt \"$NMBR $NAME\"\n"

     

    Last edit: John L. Chmielewski 2015-09-15
  • Anonymous

    Anonymous - 2015-09-15

    Awesome thanks for the info. Here's what I had to do to get it to work properly

    83 [ -n "$PageOpt" ] && PageOpt="$PageOpt $NAME $NMBR"

    and I had to add quotes around $PageOpt variable like so:

    91 echo $use_e $MailMsg | $PageMail "$PageOpt" $PageTo

     
  • John L. Chmielewski

    The quotes around "$PageOpt" in line 91 are necessary because you did not include the \" around \"$NAME $NMBR\" in line 83. Your way is probably easier to understand, but you broke the other mail option of a specific user sending mail.

    I noticed you placed $NAME in front of $NMBER. I always put number first because $NMBR does not contain spaces while $NAME does in most cases. I think it is easier to read with $NMBR first.

    While changing the source, I decided to modify ncid-page.conf and ncid-page so that you can configure the subject line in one of 5 ways:

    no subject line
    subject line containing caller number
    subject line containing caller name
    subject line containing caller number and name
    subjecj line containing caller name and number

     

    Last edit: John L. Chmielewski 2015-09-15
  • Anonymous

    Anonymous - 2015-09-15

    When i tried it originally \"$NMBR $NAME"\ on line 83 it only would put the name or nmbr (whichever was first i tried it both ways) in the subject line.

    I have PageFrom="ncid" in the ncid-page.conf file.

    i created a user "ncid" and as that user I run:
    ncid --no-gui --program ncid-page

    It works and show from "ncid" in the email. Not sure if I did that right but its working :-)

     
  • John L. Chmielewski

    You are correct, \"$NAME $NMBR\" does not work for two variables. It only seems to work with one variable. This lead me to fix more of the code. Thank you.

    Your test should be root running ncid, it will run ncid as user mail, if $PageFrom is set to mail in ncid-page.conf.

    sudo ncid --no-gui --program ncid-page

    The fix for root running ncid is easy, just change the su line to

    su -s /bin/sh -c "$PageMail \"$PageOpt\" $PageTo" $PageFrom

    The next release will also default $PageFrom to "", then it will be root sending the mail by default when ncid-page is started at boot.

    If you would like to try the new version of ncid-page and possibly provide feedback, email me at sourceforge and provide your email so I can email you the script and its configuration file.

     
  • John L. Chmielewski

    • status: open --> closed
     
  • John L. Chmielewski

    Release 1.2 will allow the user to customize the subject line of the ncid-page module.

     

Anonymous
Anonymous

Add attachments
Cancel