L
L
lxfr2016-12-21 18:33:54
linux
lxfr, 2016-12-21 18:33:54

How to send mail from pure sendmail on a pure server?

Suppose I installed pure Debian and pure sendmail.
My IP is equal to the IP of my domain, for example pochtalon.ru
I.e. my server is IP 2.2.2.2 and domain pochtalon.ru also has IP 2.2.2.2
Next, I install sendmail and write:
echo "hello world" | sendmail -s "hello ded moroz" [email protected]
But nothing comes to [email protected] (even spam).
Sendmail then processes the command for about 1 minute.
I did not find any logs at /var/log/sendmail.
How to be and what to do?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry, 2016-12-21
@Tabletko

On modern Debians, the default mta is exim. And /bin/sendmail is a symlink to Exim. You need to look at the Exim logs.

A
Alexey Cheremisin, 2016-12-21
@leahch

I'll add CityCat4
Additionally, in addition to the correct format of the letter with headers and other rubbish, it would also be nice to sign the letter with DKIM, and correctly register the MX and SFP records in the DNS. Otherwise, in 95% of cases, no one will want to accept your letter.

C
CityCat4, 2016-12-21
@CityCat4

Sending an email from pure sendmail (and not from mail, as is usually done) is not exactly easy. At the sendmail input, you need to submit a finished letter - with mail headers. sendmail itself does not generate them, except for filling in the header Date:
The following headers must be in the letter:
- Date: (can be empty, only Date: text)
- From: (filled in, at least [email protected] in angle brackets)
- To : (filled in, just like From)
- Subject: (filled in, if the subject is not in Latin, then recoded with the encoding tag - otherwise it will not be read)
- Content-Type: (if the letter is not text, then filled out according to RFC)
The letter itself is sent by the command :

# cat headers.txt body.txt | sendmail [email protected]

где headers.txt и body.txt - файлы с заголовками и телом письма.
А лог у sendmail обычно /var/log/maillog

N
nekipelov, 2016-12-21
@nekipelov

Может быть что-нибудь полезное есть в /var/log/maillog? Sendmail обязательно куда-то должен писать логи. Еще можно глянуть взаимодействие с mx сервером yandex с помощью tcpdump, там будет ответ их smtp сервера.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question