Hello.
I have two yunohost servers, A and B. Both are very similar and have been configured as explained at Homemade WireGuard VPN on a VPS server.
A runs Yunohost 12.1.4 and B runs Yunohost 12.0.17
Email was working great on both, but now there is a problem on A, perhaps related to the 12.1 upgrade, not sure. Everything is working ok on B.
Emails do not arrive to A users. People sending emails to A users get an “Undelilvered Mail Returned to Sender” email which says that “mail for subdomain.domain-a.tld loops back to myself”.
A users can send emails but they cannot be copied to the Sent folder.
According to Postfix Configuration Parameters the mail-loops-back-to-myself error “happens when the local MTA is the best SMTP mail exchanger for a destination not listed in $mydestination, $inet_interfaces, $proxy_interfaces, $virtual_alias_domains, or $virtual_mailbox_domains.”
I do not properly understand what that means, but I checked those values on servers A and B and noticed one of them was different: virtual_mailbox_domains
On /etc/postfix/main.cf of server A I could find the value
virtual_mailbox_domains = /etc/postfix/virtual-mailbox-domains
while server B had
virtual_mailbox_domains = ldap:/etc/postfix/ldap-domains.cf
I also found A was missing a file B did have: /etc/postfix/ldap-domains.cf
So I modified A so that it had the same parameter and file as B. Then I restarted Postfix and nothing got fixed.
Any suggestion will be a ray of happiness.
In the meantime I’m thinking of a restore, but I have a doubt. If I do a restore from the official Yunohost backup tool, will post-backup email messages stay?
Thank you.
journalctl
Aug 23 03:11:56 postfix/anvil[4473]: statistics: max recipient rate 1/60s for (smtp:178.6.43.74) at Aug 23 03:08:34
Aug 23 03:11:56 postfix/anvil[4473]: statistics: max cache size 1 at Aug 23 03:08:32
Aug 23 03:14:24 postfix/smtpd[4667]: connect from azpdcgyse1k8.stretchoid.com[128.102.103.54]
Aug 23 03:14:24 postfix/smtpd[4667]: improper command pipelining after CONNECT from azpdcgyse1k8.stretchoid.com[128.102.103.54]: MGLNDD_93.90.205.227_25\n
Aug 23 03:14:25 postfix/smtpd[4667]: lost connection after UNKNOWN from azpdcgyse1k8.stretchoid.com[128.102.103.54]
Aug 23 03:14:25 postfix/smtpd[4667]: disconnect from azpdcgyse1k8.stretchoid.com[128.102.103.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: improper command pipelining after CONNECT from unknown[167.94.146.54]: \026\003\003\001\246\001\000\001\242\003\003K\\\341\211\2225C\036\304\322_\275\2444\305\257\252o&\362\324R\035]P\347R|\217\n\323r 3\r\231\205\210\bQ\224^\200\234\345\261;\242\266\200\032\343\223\355\272\030q\341\345\374\210\314\346=\341\000\212\000\026\0003\000g\300\236\300\242\000\236\0009\000k\300\237\300\243\000\237
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\003\001\246\001\000\001\242\003\003K\\\341\211\2225C\036\304\322_\275\2444\305\257\252o&\36
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\003\001\246\001\000\001\242\003\003\021\200b`}\271e\225\214\370B\201\372\347\350=Io\240.\01
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\003\001W\001\000\001S\003\003\334\242\242\v\202`#\321U>\tOC\215\231\270\226\r\233\026\351\3
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\003\001I\001\000\001E\003\003\rE\006-9\032\2507R\r'\345n\036\200\230Am-\260\315-@W2s5J\\\25
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\003\001\232\001\000\001\226\003\003H\214\325\274\034\017\375eW\fH\265)\205)\200\266\333\304
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\002\001\233\001\000\001\227\003\002Vdb2\303\301\267r>\254\200s\213\365`~\372\033\215\2513\2
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:06 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:06 postfix/smtpd[4811]: improper command pipelining after CONNECT from unknown[167.94.146.54]: \026\003\001\001\250\001\000\001\244\003\003\314~\375!\351\234qm\366F\353\177\354J*2\226\201\260\256\213c)\tp\256O\211\027\355\263\\ \235\211Cj\2723k,\311\374\355\246y\000>\306\300\375;\346@M\337\017\327\356\357%O\355\217\337\000\212\000\026\0003\000g\300\236\300\242\000\236\0009\000k\300\237\300\243\000\237
Aug 23 03:16:06 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\001\001\250\001\000\001\244\003\003\314~\375!\351\234qm\366F\353\177\354J*2\226\201\260\256
Aug 23 03:16:06 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:07 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:07 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\001\001\250\001\000\001\244\003\003z\214\275\271\030k\262:^\265\322G_\263\374\033\320iX\375
Aug 23 03:16:07 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:07 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:07 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\001\001\236\001\000\001\232\003\003S\247\245\263\242\266!\031o\265\366S\225\002\344\3628\27
Aug 23 03:16:07 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:16:07 postfix/smtpd[4811]: connect from unknown[167.94.146.54]
Aug 23 03:16:07 postfix/smtpd[4811]: improper command pipelining after CONNECT from unknown[167.94.146.54]: \026\003\001\001\265\001\000\001\261\003\003\205\207_\b\304\254X\327u\323\251\322\312\034\255`_*\3532\247m\334E\204\006\006\312Be'\n Y>f\276|"\260\351\021Ye'\202\232\006\017\255\023\234\031\240h\305n \317\203\307\206\331\230\267\000\214\312\312\300\022\300\023\300\a\300'\314\024\300/\023\001\300\024\023\002\300(
Aug 23 03:16:07 postfix/smtpd[4811]: warning: non-SMTP command from unknown[167.94.146.54]: \026\003\001\001\265\001\000\001\261\003\003\205\207_\b\304\254X\327u\323\251\322\312\034\255`_*\353
Aug 23 03:16:07 postfix/smtpd[4811]: disconnect from unknown[167.94.146.54] unknown=0/1 commands=0/1
Aug 23 03:19:27 postfix/anvil[4669]: statistics: max connection rate 10/60s for (smtp:167.94.146.54) at Aug 23 03:16:07
Aug 23 03:19:27 postfix/anvil[4669]: statistics: max connection count 1 for (smtp:128.102.103.54) at Aug 23 03:14:24
Aug 23 03:19:27 postfix/anvil[4669]: statistics: max cache size 1 at Aug 23 03:14:24
Aug 23 04:01:54 postfix/smtpd[5824]: connect from b5.scanner.modat.io[46.4.60.80]
Aug 23 04:01:54 postfix/smtpd[5824]: improper command pipelining after CONNECT from b5.scanner.modat.io[46.4.60.80]: \026\003\001\000\356\001\000\000\352\003\003\230\t\300\264\031~\212\\<\260\301\313\253\263~\032\231\253sa\221\032\261\2371\346\270\002w\0277f b\325\274[\365\336\360v\203W\027\335\017\235H\3548V\034,\276\036\3443\233\325\267\347\253\303{\342\000&\314\250\314\251\300/\3000\300+\300,\300\023\300\t\300\024\300\n\000\234
Aug 23 04:01:54 postfix/smtpd[5824]: warning: non-SMTP command from b5.scanner.modat.io[46.4.60.80]: \026\003\001\000\356\001\000\000\352\003\003\230\t\300\264\031~\212\\<\260\301\313\253\263~\032\231\
Aug 23 04:01:54 postfix/smtpd[5824]: disconnect from b5.scanner.modat.io[46.4.60.80] unknown=0/1 commands=0/1
Aug 23 04:05:14 postfix/anvil[5829]: statistics: max connection rate 1/60s for (smtp:46.4.60.80) at Aug 23 04:01:54
Aug 23 04:05:14 postfix/anvil[5829]: statistics: max connection count 1 for (smtp:46.4.60.80) at Aug 23 04:01:54
Aug 23 04:05:14 postfix/anvil[5829]: statistics: max cache size 1 at Aug 23 04:01:54
var/log/mail.log
2025-08-23T04:23:49.460880+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:23:49.526894+02:00 subdomain dovecot: imap(alice)<6347><r1ZAA/889L+q/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:23:49.559667+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:23:49.620771+02:00 subdomain dovecot: imap(alice)<6347><r1ZAA/889L+q/Thb>: Error: stat(/var/mail/alice/.DeltaChat/tmp) failed: Not a directory
2025-08-23T04:23:49.649856+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:49.716159+02:00 subdomain dovecot: imap(alice)<6347><r1ZAA/889L+q/Thb>: Disconnected: Connection closed (SELECT finished 0.094 secs ago) in=152 out=1355 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:23:49.744180+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:23:49.838671+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:49.933735+02:00 subdomain dovecot: imap(alice)<6348><IsRAA/88/L+q/Thb>: Disconnected: Connection closed (SELECT finished 0.094 secs ago) in=200 out=1485 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:23:56.774715+02:00 subdomain dovecot: imap-login: Login: user=<alice>, method=PLAIN, rip=31.110.137.8, lip=10.9.02, mpid=6352, TLS, session=<8bm0A/88HBEf3fh3>
2025-08-23T04:23:56.776839+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: chdir(/var/mail/alice) failed: Not a directory
2025-08-23T04:23:57.219190+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:23:57.362741+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:23:57.493081+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:57.888421+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:23:58.019684+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/.Junk/tmp) failed: Not a directory
2025-08-23T04:23:58.151920+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/.Sent/tmp) failed: Not a directory
2025-08-23T04:23:58.287956+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/.Archive/tmp) failed: Not a directory
2025-08-23T04:23:58.424111+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:58.588086+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:58.720719+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:58.849924+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:23:58.982374+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:23:59.117810+02:00 subdomain dovecot: imap(alice)<6352><8bm0A/88HBEf3fh3>: Disconnected: Connection closed (SELECT finished 0.135 secs ago) in=421 out=2577 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:24:49.122030+02:00 subdomain dovecot: imap-login: Login: user=<alice>, method=PLAIN, rip=170.142.45.80, lip=10.9.02, mpid=6359, TLS, session=<DXvTBv88BM+q/Thb>
2025-08-23T04:24:49.124122+02:00 subdomain dovecot: imap(alice)<6359><DXvTBv88BM+q/Thb>: Error: chdir(/var/mail/alice) failed: Not a directory
2025-08-23T04:24:49.146308+02:00 subdomain dovecot: imap-login: Login: user=<alice>, method=PLAIN, rip=170.142.45.80, lip=10.9.02, mpid=6360, TLS, session=<2dnTBv88CM+q/Thb>
2025-08-23T04:24:49.149462+02:00 subdomain dovecot: imap(alice)<6360><2dnTBv88CM+q/Thb>: Error: chdir(/var/mail/alice) failed: Not a directory
2025-08-23T04:24:49.383667+02:00 subdomain dovecot: imap(alice)<6359><DXvTBv88BM+q/Thb>: Error: stat(/var/mail/alice/.DeltaChat/tmp) failed: Not a directory
2025-08-23T04:24:49.409099+02:00 subdomain dovecot: imap(alice)<6360><2dnTBv88CM+q/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:24:49.469268+02:00 subdomain dovecot: imap(alice)<6359><DXvTBv88BM+q/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:24:49.496178+02:00 subdomain dovecot: imap(alice)<6360><2dnTBv88CM+q/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:24:49.555154+02:00 subdomain dovecot: imap(alice)<6359><DXvTBv88BM+q/Thb>: Error: stat(/var/mail/alice/.DeltaChat/tmp) failed: Not a directory
2025-08-23T04:24:49.582623+02:00 subdomain dovecot: imap(alice)<6360><2dnTBv88CM+q/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:24:49.642365+02:00 subdomain dovecot: imap(alice)<6359><DXvTBv88BM+q/Thb>: Disconnected: Connection closed (SELECT finished 0.086 secs ago) in=152 out=1355 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:24:49.668477+02:00 subdomain dovecot: imap(alice)<6360><2dnTBv88CM+q/Thb>: Disconnected: Connection closed (SELECT finished 0.085 secs ago) in=140 out=1355 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:25:49.121219+02:00 subdomain dovecot: imap-login: Login: user=<alice>, method=PLAIN, rip=170.142.45.80, lip=10.9.02, mpid=6375, TLS, session=<sABnCv88+r+q/Thb>
2025-08-23T04:25:49.123417+02:00 subdomain dovecot: imap(alice)<6375><sABnCv88+r+q/Thb>: Error: chdir(/var/mail/alice) failed: Not a directory
2025-08-23T04:25:49.144711+02:00 subdomain dovecot: imap-login: Login: user=<alice>, method=PLAIN, rip=170.142.45.80, lip=10.9.02, mpid=6376, TLS, session=<ZlpnCv88CMCq/Thb>
2025-08-23T04:25:49.147107+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: chdir(/var/mail/alice) failed: Not a directory
2025-08-23T04:25:49.383090+02:00 subdomain dovecot: imap(alice)<6375><sABnCv88+r+q/Thb>: Error: stat(/var/mail/alice/.DeltaChat/tmp) failed: Not a directory
2025-08-23T04:25:49.406053+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:25:49.468652+02:00 subdomain dovecot: imap(alice)<6375><sABnCv88+r+q/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:25:49.493034+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: Failed to get quota resource STORAGE: quota-maildir: Failed to get STORAGE_BYTES: open(/var/mail/alice/maildirsize) failed: Not a directory
2025-08-23T04:25:49.554927+02:00 subdomain dovecot: imap(alice)<6375><sABnCv88+r+q/Thb>: Error: stat(/var/mail/alice/.DeltaChat/tmp) failed: Not a directory
2025-08-23T04:25:49.578702+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:25:49.642098+02:00 subdomain dovecot: imap(alice)<6375><sABnCv88+r+q/Thb>: Disconnected: Connection closed (SELECT finished 0.086 secs ago) in=152 out=1355 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2025-08-23T04:25:49.664965+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: Root directory is a file: /var/mail/alice
2025-08-23T04:25:49.751040+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Error: stat(/var/mail/alice/tmp) failed: Not a directory
2025-08-23T04:25:49.837093+02:00 subdomain dovecot: imap(alice)<6376><ZlpnCv88CMCq/Thb>: Disconnected: Connection closed (SELECT finished 0.086 secs ago) in=200 out=1485 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0```