Ubuntu/Scripts
From r00tedvw.com wiki
Email current IP address
#!/bin/bash -x #define varibles #HOSTNAME=`hostname` from="$HOSTNAME"'@sender domain.com' to='recipient address' recipient_mx='recipient mail exchanger' DATE=`date` messageid='[email protected]' IP=$(curl checkip.dyndns.org|awk '/Address:/ {print$6}'|sed 's/<.*/ /') #function containing mail commands. Contains enough RFC required fields to satisfy gmail's requirements to allow the message, though it may be detected as spam if you do not have a SPF record. function mail_input { sleep 1 echo 'ehlo test.com\n' sleep 0.5 printf 'mail from:<'"$from"'>\n' sleep 1 printf 'rcpt to:<'"$to"'>\n' sleep 1 printf 'data\n' sleep 0.5 printf 'Return-Path: <'"$from"'>\n' printf 'Date: '"$DATE"'\n' printf 'Message-ID: <'"$messageid"'>\n' printf 'Subject: test\n' printf 'From: <'"$from"'>\n' printf 'To: <'"$to"'>\n' printf "$HOSTNAME"' ip address= '"$IP"'\n' printf '.\n' printf 'quit' } #sending mail with mail_input function mail_input | telnet $recipient_mx 25 || exit exit