Automated Mail Through ICloud
We wanted to set up some infrastructure that would send mail through a shared icloud account. Here's how we did that:
- Set up icloud account.
- Set up AppleID for said icloud account / the mac(s) running the infrastructure.
- Fully log in to your Apple ... stuff. Mac, icloud, apple ID, etc. You must use two-factor authentication to do so.
- Go to your AppleID management interface, once fully logged in and authenticated.
- Create an "app specific password."
You should now be fully set up and ready to go! Invoke your
script. Let's assume your icloud account is
myfakeaccount@icloud.com. This should be it!
123456789 | python mailer.py \
--user myfakeaccount \
--passwd <app specific password in the format: aaaa-aaaa-aaaa-aaaa> \
--host smtp.mail.me.com \
--port 587 \
--from_addr myfakeaccount@icloud.com \
--to_addr <your address> \
--subj "Your subject" \
--attach your_file.txt
|
If that doesn't work, well, check the
reference document we used to get going and see what's wrong.
Ches Koblents
June 20, 2019