Send Mail with Office365 Auth

 Step-1

    mkdir ~/.certs

Step-2

    certutil -N -d ~/.certs
    Enter a password which will be used to encrypt your keys.
    The password should be at least 8 characters long,
    and should contain at least one non-alphabetic character.

    Enter new password:
    Re-enter password:


Step-3

    echo -n | openssl s_client -starttls smtp -crlf -connect smtp.office365.com:587| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/365.crt
    certutil -A -n "Google Internet Authority" -t "C,," -d ~/.certs -i ~/.certs/365.crt

Step-4

    vim  mail-office365.sh
    echo -e "Email content" | mailx -v -s "Email subject" \
     -S smtp-auth=login \
     -S smtp-use-starttls \
     -S nss-config-dir=~/.certs \
     -S smtp=smtp.office365.com:587 \
     -S from="user@office365.com" \
     -S smtp-auth-user=user@office365.com \
     -S smtp-auth-password="passwordxxxx" \
     -S ssl-verify=ignore \
    user@gmail.com

Create pem certificate

 Creating a .pem with the Private Key and Entire Trust Chain     Log into your DigiCert Management Console and download your Intermediate (D...

Mais vistos