Вместо telnet smtp.server.do 25
swaks
класная штука!
класная штука!
Пример как восопользоваться
server=mx.server.do
from=testfrom@dom.do
to=testto@do.dom
subject="Test 1"
swaks --tls --server $server --from $from--to $to --header "Subject: $subject"
from=testfrom@dom.do
to=testto@do.dom
subject="Test 1"
swaks --tls --server $server --from $from--to $to --header "Subject: $subject"
А вот пример как отправить зашифрованное письмо:
# необходимые переменные
server=mx13.kaspersky-labs.com
from=sender@gmail.com
to=poluchatel@kaspersky.com
subject="S\MIME email $(date +%Y%m%d-%H%M%S)"
message="Secret message"
to_cert=/etc/pki/crt/poluchatel.crt
# формируем файл сообщения email_body.txt
cat <<EOF > email_body.txt
From: $from
To: $to
Subject: "$subject"
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
$message
EOF
# шифруем открытым ключом сертификата получателя в файл encrypted.txt
openssl smime -encrypt -in email_body.txt -out encrypted.txt -from $from -to $to -subject "$subject" $to_cert
# отправляем с помощьюу утилиты командной строки swaks
swaks \
--to $to \
--from $from \
--server $server \
--tls \
--data @encrypted.txt
Ратнер Арсений, arsenyratner@gmail.com, 7 985 273 2090
Комментариев нет:
Отправить комментарий