# Connecting Mail.ru Email
# Connecting Mail.ru Email via IMAP

:::danger
After connecting, all emails with the "Unread" status will be imported into Swarmica as tickets. If there are more than 100 of them, it can overload the system!
:::

<br />

1. Go to Swarmica to the "Settings - Channels" section, click on "Email".

2. In the top right, click on the image.

3. A window will open for filling in the main data:

Image

**Name** - arbitrary name for your email channel.

**Recipient** - email address where you receive mail.

**Sender** - address from which you will respond to emails.

Incoming and outgoing addresses may differ if, for example, you have several email addresses, but you send responses to all emails from all boxes only from one address.

After filling in the main data, click "Save".

4. The email settings page will open.

## Filling out settings in Swarmica

### Incoming mail settings

Image

1. **Name** - arbitrary name for your email channel.
2. **Sender's name** - displayed to recipients as the sender's name. For example, "Support service" and the name of your company.
3. **Recipient**: email address where you receive mail.
4. **Receiving server**: imap.mail.ru.
5. **IMAP port**: 993.
6. **Encryption**: SSL.
7. **User** - in most cases, it is equal to your email address.
8. **Password** - an application password is required. We will tell you how to get it below.
9. **Folder** - the name of the folder on your server's IMAP if you want to receive not all incoming mail in Swarmica, but only from a specific folder.
10. **Check connection** - be sure to click after entering the settings above to make sure that the settings are correct. If you see an error, double-check the entered data.

### Outgoing mail settings

You can set up sending from the Mail.ru mailbox, and you can send mail from your own SMTP Relay server. To send via SMTP Relay, enable the "Use system SMTP server" slider:

Image

:::tip
You can read about SMTP Relay settings [here](https://support.swarmica.com/article/ru/568-nastrojka-ishodyashej-pochty-cherez-smtp-relay.html).
:::

Below, we will talk about filling out settings for sending via Mail.ru.

Image

1. **Sender** - address from which you will respond to emails.
2. **Sending server**: smtp.mail.ru.
3. **SMTP port**: 465.
4. **Encryption**: SSL.
5. **User** - in most cases, it is equal to your email address.
6. **Password** - an application password is required. We will tell you how to get it below.
7. **Timeout** - artificial time interval in seconds between sent emails to avoid sending many emails at the same time and reduce the likelihood of being suspected of spam.
8. **Check connection** - be sure to click after entering the settings above to make sure that the settings are correct. If you see an error, double-check the entered data.

### Other settings

Image

1. **Allow ticket creation** - enable to transfer tickets to Swarmica.
2. **Preserve quoting** - save the correspondence when forwarding. With the option disabled, the forward will contain only the сопроводительный text. With the option enabled - the entire correspondence.
3. **Allow new users in CC** - allow any addresses to be put in the copy of the email ticket. The setting is turned on to protect against spammers using the ticket creation feature to send spam using the copy field.
4. **Same domain in CC** - allows putting addresses belonging only to the domain from the email address of the ticket creator in the copy of the letter. This is a simplified version of protection against spammers described in the previous paragraph. It will allow adding colleagues from the client's company, but will prohibit adding foreign addresses.
5. **Use by default** - enable so that responses are always sent from the specified sending address.
6. **Enabled** - allows you to activate the email channel in Swarmica.

After completing and checking the settings, do not forget to save them.

# Activating the IMAP protocol on the mail side and obtaining an app password

1. Go to your Mail.ru and click "Settings" at the bottom left:

Image

2. Select "All settings":

Image

3. Select the "Security - External services" section:

Image

4. On the opened page, enable "Access to Mail via IMAP, POP, and SMTP" if it is not enabled.

Image

5. Return to the "Security" section and select "Passwords for external applications":

Image

6. Click "Create":

Image

Come up with a password name, for example, Swarmica, click "Continue".

Image

7. On the opened page, select "Full access to mail":

Image

8. Enter your account password, pass the "I'm not a robot" check. A window with a password for the external application will open. Click "Copy":

Image

9. Go to Swarmica to your mail settings section and paste the copied password into both password fields:

Image

Check both connections. If errors occur, recheck the settings entered.

Click "Save". The mail is connected.