Performing HTTP requests with cURL using proxy

General way (config wide proxy):

export http_proxy=http://your.proxy.server:port/
export https_proxy=https://your.proxy.server:port/

or read man curl ;):

-x, --proxy <[protocol://][user:password@]proxyhost[:port]>

     Use the specified HTTP proxy. 
     If the port number is not specified, it is assumed at port 1080.
curl -x http://proxy_server:proxy_port --proxy-user username:password -L http://url

Sending e-mail with GMail on Entware-ng Asus routers

It’s possible to send emails even from Gmail account through openssl, first we need to download a trusted certificate:

wget -c -O /jffs/configs/Equifax_Secure_Certificate_Authority.pem --no-check-certificate

And a example:

FROMNAME="Your Router"

echo "Your friendly router." >>/tmp/mail.txt
echo "" >>/tmp/mail.txt

cat /tmp/mail.txt | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
-connect -tls1 -starttls smtp" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO 

rm /tmp/mail.txt