Notification from RPA by GMail
I have Sikullix in my Cloud Computer and I am playing with RPA and other things, but I can't watch it all the time after it starts because I let it run for a good long time, but I don't know when it finishes or it may have ended up with an error for some reason in the middle of the process. So, even very simple idea, but I'm going to use Gmail to notify me when the process is finished or when there is an error.
Of course, since I am dealing with RPA so far, we could use that to send it via webmail from a browser, but it would be a lot of work to start a browser, access the Gmail page, go to .... and as anyone who has ever made RPA knows, it doesn't work quite as well as I'd like (;-s). Especially this time, I want to send an email even when an error occurs while letting the user surf the web using a browser, but it is not a good idea to send an email through the browser because the error may be caused by the browser. Also, since I am a command line lover (:-), I will make this part with a script. However, my current theme is a Cloud Computer, so I don't mean to make it a mail server. It is just a normal Computer that can be used to send mail.
In the case of Ubuntu, it is under /etc/postfix. However, since security is getting stricter these days, you need to issue an application password on the Gmail side and set it up on your cloud computer as well.
On the Gmail side, go to Account ⇒ Security ⇒ Application Password.
Write this password in a file named sasl_passwd, excluding spaces. When ready, create transport.db and sasl_passwd.db and restart postfix. It looks like this.
$ sudo postmap /etc/postfix/transport $ sudo postmap /etc/postfix/sasl_passwd $ sudo systemctl restart postfix
$ sudo postmap /etc/postfix/transport
$ sudo postmap /etc/postfix/sasl_passwd
$ sudo systemctl restart postfix
Now all you have to do is send mail as usual.
$ echo "body of mail" | mail -s "subject of mail" mail to (xxxxx@xxx.com)
$ echo "body of mail" | mail -s "subject of mail" mail to (xxxxx@xxx.com)
The command line world is easier to understand than RPA after all (:-), and there are many cases where it is better to use scripts to do things that can be done with RPA. If you try to do everything with RPA, you will see a tough world a bit (:-).
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home