Last active
April 11, 2017 10:56
-
-
Save dobrivoje/d431b8956c8803eaf27003f96626281e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### We're installing dependencies (certutils commdand) | |
### based on the fantastic explanation covered here : https://coderwall.com/p/ez1x2w/send-mail-like-a-boss | |
apt-get install libnss3-tools | |
mkdir certs | |
### optional | |
chown -R root:tomcat certs/ | |
chmod 770 -R certs/ | |
certutil -N -d certs/ | |
### assuming we are in /root directory, and want to add following files in the /root/ssl/certs folder | |
### we're issuing following command : | |
echo -n | openssl s_client -connect smtp.gmail.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/ssl/certs/gmail.crt | |
certutil -A -n "Google Internet Authority" -t "C,," -d ~/ssl/certs -i ~/ssl/certs/gmail.crt | |
### We're testing with the following command : | |
echo -e "Email content..." | mailx -v -s "Email subject" -S smtp-use-starttls \ | |
-S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 \ | |
-S from="email_we'[email protected] (e.g. your name)" -S smtp-auth-user=email_we'[email protected] \ | |
-S smtp-auth-password=<email_pasword> -S ssl-verify=ignore -S nss-config-dir=~/ssl/certs \ | |
email_we'[email protected] | |
### Above we may put our name in brackets for more decriptive email : | |
### -S from="email_we'[email protected] (e.g. your name)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment