0

I am newbie. I created mail server thanks to the tutorial

Everything works, but I want to make backup of my emails. I made mysql backup, but email are not there.

I checked /var/mail/vhosts and /var/spool/postfix and still nothing.

I read that email storage depends on configuration. My configurations files are the same like in in tutorial above.

Where are my emails?

gongarek
  • 105
  • 3
  • 2
    Try /var/spool/mail - also look at /vat/log/maillog and ~user/Maildir (and variants) for hints - your mail cou and /vsr/spool/virtualmailld be stored anywhere depending on your config. – davidgo Apr 02 '20 at 09:53

1 Answers1

1

According to Dovecot Mail Location Settings:

There are three different places where the mail location is looked up from:

  1. mail_location setting in dovecot.conf is used if nothing else overrides it
  2. mail User Databases (userdb) overrides mail_location setting.
  3. location setting inside namespaces overrides everything. Usually this should be used only for public and shared namespaces.

If you have followed the tutorial you have:

mail_location = maildir:/var/mail/vhosts/%d/%n

Where the variables are:

  • %n User part in user@domain, same as %u if there’s no domain.

  • %d Domain part in user@domain, empty if there’s no domain.

Therefore, the mail is stored in domain/user directories under /var/mail/vhosts/. It's strange you didn't know, as following the tutorial you should have created those folders manually:

We are going to create a folder for each domain that we register in the MySQL table:

mkdir -p /var/mail/vhosts/example.com
Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122