danielhilst

command line gmail smpt send

Jun 18th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. # Baixe o certificado
  2. wget https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Global_eBusiness_CA-1.cer -O /root/gmailcert.cer
  3.  
  4. # Crie o arquivo de configuração do msmtp
  5. cat <<EOF > /root/.msmtprc
  6. account default
  7. host smtp.gmail.com
  8. port 587
  9. tls on
  10. tls_trust_file /root/gmailcert.cer
  11. auth on
  12. password XXXXXXXX
  13. logfile ~/.msmtp.log
  14. EOF
  15.  
  16. # Permissaozinha
  17. chmod 600 /root/.msmtprc
  18.  
  19. # Arquivo mutt
  20. cat <<EOF > /root/.muttrc
  21. send2-hook '~f [email protected]' 'set sendmail="/usr/bin/msmtp"'
  22. EOF
  23.  
  24. # MUDA A USUARIO/SENHA NO /root/.msmtprc e /root/.muttrc
  25. # Test
  26. echo "Teste mutt" | mutt -s "Teste mutt subject" [email protected]
Advertisement
Add Comment
Please, Sign In to add comment