GNU/Linux konsolundan Yandex sunucuları üzerinden e-posta göndermek.
GNU/Linux sistemlerin yönetiminde bildirim almak elbette önemli. E-posta ile bildirim göndermek ise en çok kullanılan yöntemlerden. Konsoldan mail komutu ile e-posta göndermede sorun yaşıyor iseniz; güvenli, kolay ve stabil bir yöntem olarak aşağıdaki script'i kullanabilirsiniz. SMTP client ile kullanıcı adı ve şifre kullanılarak e-posta gönderimi yapıldığından, e-postanızın sağlıklı şekilde yerine ulaştığından emin olabilirsiniz.
Kurulum (Debian)
Ben Yandex sunucularını kullandığımdan, önce bir Yandex hesabınızın olması gerekiyor. (Bu hesap bilgileri, script'in şu değişkenlerinde kullanılacak: gonderen, user, password)
Daha sonra
heirloom-mailxpaketini kuruyoruz.apt-get install heirloom-mailx
Python Script
Aşağıdaki kodları send-mail.py dosyasına kayıt edelim.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# *** README ***
# Önce aşağıdaki kurulum yapılır.
# apt-get install heirloom-mailx
import os
# ********** TANIMLAR **********
mesaj = "Buraya mesaj yazılacak..."
gonderen = "kullanıcı@yandex.com (Gönderen Adı)"
konu = "Buraya konu yazılacak..."
smtpserver = "smtp.yandex.com:587"
user = "kullanıcı@yandex.com"
password = "KULLANICININ_ŞİFRESİ"
kime = "user@example.com"
# ******** TANIMLAR SON ********
os.system('echo "%s" | heirloom-mailx -v -r "%s" -s "%s" -S smtp="%s" -S smtp-use-starttls -S smtp-auth=login -S smtp-auth-user="%s" -S smtp-auth-password="%s" -S ssl-verify=ignore %s' % (mesaj, gonderen, konu, smtpserver, user, password, kime))
exit ()
... ve çalıştırıp e-postayı gönderiyoruz...
$ python3 send-mail.py
https://github.com/aytekinaygun/scripts/blob/master/TR/send-mail.py
Leave GNU/Linux konsolundan Yandex sunucuları üzerinden e-posta göndermek. to:
Read more #linux posts
Best Posts From Aytekin Aygün
We have not curated any of aytekinaygun's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Aytekin Aygün
- Mother and Father...
- My daughter reads the "Children's Rights Convention" when she was 3 years old ...
- Men and women art series #5 : Problem Solution
- Men and women art series #4 : Chat
- İki döküman arasındaki benzerlik yüzdesi nasıl bulunur? (Cosine Similarity)
- Markov Zinciri : Torbadaki Bilyelerin Simülasyonu
- Scientific and Dogmatic Art Series #1 : Talking
- Men and women art series #3 : Sleep
- Men and women art series #2 : Shopping
- Men and women art series #1 : Colors and see