Advertisement
fkeles

Untitled

May 3rd, 2025
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | Source Code | 0 0
  1. ## send mail using mailx
  2. # install
  3. sudo dnf install -y postfix
  4. sudo systemctl start postfix
  5. sudo systemctl enable postfix
  6.  
  7. # open local port
  8. sudo firewall-cmd --permanent --add-port=25/tcp
  9. sudo firewall-cmd --reload
  10. sudo dnf install mailx
  11.  
  12. # configure
  13. sudo tee -a /etc/mail.rc > /dev/null <<EOF
  14. set smtp=smtp://smtp.email.me-dubai-1.oci.oraclecloud.com:587
  15. set smtp-auth-user='ocid1.user.oc1..<userid>@ocid1.tenancy.oc1..<tenancyid>.qx.com'
  16. set smtp-auth-password='<smtpcredentials>'
  17. set smtp-auth=plain
  18. set smtp-use-starttls
  19. set ssl-verify=ignore
  20. EOF
  21.  
  22. # check
  23. sudo cat /etc/mail.rc
  24. #set smtp=smtp://smtp.email.me-dubai-1.oci.oraclecloud.com:587
  25. #set smtp-auth-user='ocid1.user.oc1..<userid>@ocid1.tenancy.oc1..<tenancyid>.qx.com'
  26. #set smtp-auth-password='<smtpcredentials>'
  27. #set smtp-auth=plain
  28. #set smtp-use-starttls
  29. #set ssl-verify=ignore
  30.  
  31. # send email
  32. echo "This is a test email from Mailx." | mailx -s "Test Email" -r info@codeharmony.net me@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement