Script for Email with attachment



  • Hello
    I recently started using pfsense and I am trying to get a script I used under IPFire to work with pfsense. the problem I have is that I can not find a way to get my script to attache a log file. with ipfire there was a SendEmail daemon that I used but I cant find a way to attache a file using mail.php. Can you anyone help please I need to modify  to to work with pfsens..

    here is my script.

    #!/bin/sh

    grep -e "word1" -e "word2"  /var/squid/logs/access.log  > /home/scripts/poxlog.txt;
      /usr/local/bin/sendEmail -f XXXXXXX@gmail.com -t XXXXXXX@gmail.com -u "P-Logs" -m " Attached log file " -s smtp.gmail.com:587 -xu XXXXXXX -xp XXXXXXX  -o tls=yes -a /home/scripts/poxlog.txt;

    Thanks
    i