LuckyBX Русский
Sites

Site mail

A site can send letters in two ways.

Through this server#

This works right away if the mail component is installed. Letters are sent by postfix.

luckybx site mail shop.example.com local

Mail services check the SPF and DKIM records of the domain and the reverse record of the server address (the hosting provider sets it). Without them letters land in spam.

Through a mail service#

Through Gmail, Yandex, Mail.ru or your own mail server:

luckybx site mail shop.example.com smtp smtp.example.com 465 shop@example.com

The command asks for the password itself. Port 465 or 587.

The sender address in the Bitrix main module settings must match this mailbox. Yandex and Mail.ru do not accept letters with someone else's sender address.

Test#

luckybx site mail shop.example.com test you@example.com

With nothing after the domain the command shows how the site sends mail now.

Where the settings are#

The mail service address, login and password are written to the .msmtprc file, each site has its own:

/home/bitrix/sites/shop.example.com/.msmtprc

It is not visible from outside, it lies above the site root. root and the bitrix user can read it. The setup command overwrites this file.

What was sent and what was not is in the site's logs/mail.log.

The file is not included in a backup. If you restored the site on a new server, connect the mail service again.

Your own scripts that you added to cron send letters through the server. To send them through the service, add -d sendmail_path="/usr/bin/msmtp -C /home/bitrix/sites/shop.example.com/.msmtprc -t -i" to the command.