IMAPS gateway with getmail and dovecot

It had been a while I wanted to have another solution for hosting and serving emails than Gmail. Especially because I am currently working on the Linux Kernel and at some point I would like to submit a few patches. Unfortunately, it is impossible to use Gmail for sending patches or even, to a greater extend, to be involved in the LKML. Also I think it is pretty fancy (nerdy?) to have my own email address, i.e. [email protected]. At the same time, I have always heard that managing a full email stack (from the mx DNS records up to the IMAP and SMTP servers) is a pain. It can definitely happen that my server is down for a few days which would mean that my emails would be inaccessible in the meantime. That is why I had this idea of using a stable frontend (i.e. via OVH, my hosting service company) before my own email server, so that whenever my server is down, I can still access my emails through this frontend. One could argue that I could just use the email facility that OVH provides but there are (at least) two reasons I prefer not to: The mailbox OVH offers me is only 2G in size, which is fairly small nowadays. I would like to manage my own data (I like the cloud, but only if it is mine!) Here is a picture of what I wanted to achieve (thanks to Asciiflow for the following ASCII Flow Diagram): ...

12 грудня 2019 · 9 хвилин · 1773 слів · dimetrius

Dovecot аналог виртуальных хостов

В этой заметке вы сможете узнать о том что dovecot поддерживает ip-based, domain-based конфигурации для SSL. 1 2 3 4 5 6 7 8 9 local 10.10.10.11 { ssl_cert = </home/domain0/ssl.cert ssl_key = </home/domain0/ssl.key } local 10.10.10.12 { ssl_cert = </home/domain1/ssl.cert ssl_key = </home/domain2/ssl.key } При этом необходимо убрать из конфигурации SSL сертификаты, которые вне этих секций. Так же можно указывать SSL сертификаты для доменов: 1 2 3 4 5 6 7 8 9 local_name mail.domain0.com { ssl_cert = </home/domain0/ssl.cert ssl_key = </home/domain0/ssl.key } local_name mail.domain1.com { ssl_cert = </home/domain1/ssl.cert ssl_key = </home/domain1/ssl.key }

16 липня 2019 · 1 хвилина · 94 слів · dimetrius

Скрипт logrotate для ротации логов dovecot

Что-то последнее время часто приходится настраивать ротацию логов dovecot с помощью logrotate. Заметка на память. Всё очень просто. Создаём файлик 1 # vim /etc/logrotate.d/dovecot с содержимым… 1 2 3 4 5 6 7 8 9 10 /var/log/dovecot*.log { mail [email protected] size 10M missingok notifempty delaycompress sharedscripts postrotate /bin/kill -USR1 `cat /var/run/dovecot/master.pid 2>/dev/null` 2> /dev/null || true endscript Для проверки и моментальной ротации можно выполнить logrotate -v /etc/logrotate.d/dovecot Для FreeBSD можно добавить в файл /etc/newsyslog.conf строку 1 /var/log/dovecot.log 644 3 2000 * J /var/run/dovecot/master.pid 30 Вот и всё UPDATE: немного больше информации вы сможете найти по адресу wiki2.dovecot.org/Logging Если при выполнении # logrotate -f -v /etc/logrotate.d/dovecot вы получаете 1 2 3 4 error: skipping "/var/log/dovecot-lda.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. considering log /var/log/dovecot.log error: skipping "/var/log/dovecot.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. considering log /var/log/dovecot-sieve.log не спешите делать выводы. Директива “su” указана в основном конфигурационном файле /etc/logrotate.conf, и если ротация выполняется полностью, то ошибок не возникает.

25 березня 2019 · 1 хвилина · 210 слів · dimetrius

Авторизация Exim+Dovecot+PostfixAdmin

Я в процессе настройки своего почтового сервера. Эта заметка касается авторизации, которая допускает не шифрованный пароль и шифрованный. Используется Exim4 + Dovecot2 + PostfixAdmin 1. Файл /etc/exim4/exim4.conf - ставишь такую секцию которую я привел: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 begin authenticators auth_plain: driver = dovecot public_name = PLAIN server_socket = /var/run/dovecot/auth-client server_set_id = $auth1 auth_login: driver = dovecot public_name = LOGIN server_socket = /var/run/dovecot/auth-client server_set_id = $auth2 auth_cram_md5: driver = dovecot public_name = CRAM-MD5 server_socket = /var/run/dovecot/auth-client server_set_id = $auth3 2. В файле /var/www/html/postfixadmin/config.inc.php меняешь настройки алгоритмов на: 1 2 $CONF['encrypt'] = 'dovecot:CRAM-MD5'; $CONF['dovecotpw'] = "/usr/bin/doveadm pw"; 3. Файл /var/www/html/roundcube/config/main.inc.php - меняешь алгоритм на cram-md5: 1 $rcmail_config['imap_auth_type'] = cram-md5; 4. Файл /etc/dovecot/dovecot.conf - меняешь алгоритмы авторизации на plain,login и cram-md5: 1 auth_mechanisms = plain login cram-md5 5. Файл /etc/dovecot/dovecot-mysql.conf - ставишь: 1 default_pass_scheme = CRAM-MD5 Так же можно авторизоваться Exim’ом непосредственно в Mysql базе данных (но у меня этот способ не особо заработал): ...

11 серпня 2017 · 2 хвилин · 273 слів · dimetrius