• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs mail is atemted to be delivered even if there is no mailbox

Linulex

Silver Pleskian
Username: Linulex

TITLE

mail is atemted to be delivered even if there is no mailbox

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

plesk 18.0.37 latest centos 7

PROBLEM DESCRIPTION

emails that should not be in the queue stay in the queue when there is no mailbox and forwarding is enabled bot do not deliver is not enabled.

STEPS TO REPRODUCE

mail has forwarding
no mailbox
Do not deliver copies of forwarded emails to the Plesk mailbox = not enabled

ACTUAL RESULT

mail is forwarded fine, but a copy stays in the queue and the log says:

Jul 23 19:13:07 res9 dovecot_authdb_plesk[128937]: No such user '[email protected]' in mail authorization database
Jul 23 19:13:07 res9 postfix/pipe[140879]: 5CFCC6B6130D: to=<[email protected]>, relay=plesk_virtual, delay=171696, delays=171672/1.6/0/23, dsn=4.2.1, status=deferred (Message can not be delivered at this time )

postfix is trying to deliver the mail local, even if there is no mailbox

EXPECTED RESULT

mail is forwarded and then removed from the queue

ANY ADDITIONAL INFORMATION

mailbox on
enabling "Do not deliver copies of forwarded emails to the Plesk mailbox"
mailbox off

this solves it, but there should not be a deliver attempt when there is no mailbox

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Developers informed me that the issue cannot be reproduced according to the provided Steps To Reproduce on:

Product version: Plesk Obsidian 18.0.37.0
OS version: CentOS 7.8.2003 x86_64
 
I now have a client that has the same configuration (forward, no mailbox, do not delivered disabled) and after enabling an autoresponder he gets the autorespond mail every few hours.

centos is the latest version: CentOS Linux 7.9.2009 (Core)

the mailbox existed as a forward before 18.0.37 en spam is enabled. It is possible that there was a mailbox before but that this has been disabled and changed into a forward at some point in the past.

This is the log file about this mail. (mail address has been obscured due to gdpr rules)

Jul 26 10:29:22 res9 postfix-local[91570]: postfix-local: from=[email protected], to=[email protected], dirname=/var/qmail/mailnames
Jul 26 10:29:23 res9 spamd[91587]: spamd: using default config for [email protected]: /var/qmail/mailnames/xxxx.nl/info/.spamassassin/user_prefs
Jul 26 10:29:23 res9 spamd[91587]: spamd: processing message <[email protected]> for [email protected]:30
Jul 26 10:29:28 res9 spamd[91587]: spamd: identified spam (8.9/5.5) for [email protected]:30 in 4.2 seconds, 16003 bytes.
Jul 26 10:29:28 res9 spamd[91587]: spamd: result: Y 8 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,KAM_LOTSOFHASH,MAILING_LIST_MULTI,RAND_MKTG_HEADER,RAZOR2_CF_RANGE_51_100,RAZOR2_CHECK,SPF_HELO_NONE,URIBL_ABUSE_SURBL,URIBL_BLACK scantime=4.2,size=16003,user=[email protected],uid=30,required_score=5.5,rhost=::1,raddr=::1,rport=46276,mid=<[email protected]>,autolearn=no autolearn_force=no
Jul 26 10:29:28 res9 dovecot_authdb_plesk[128937]: No such user '[email protected]' in mail authorization database
Jul 26 10:29:28 res9 spamassassin[91572]: Mail delivery from '/usr/local/psa/handlers/spool/spam.GNUMog' to '[email protected]' into 'INBOX.Spam' failed with return code 67
Jul 26 10:29:28 res9 dovecot_authdb_plesk[128937]: No such user '[email protected]' in mail authorization database
Jul 26 10:29:28 res9 postfix/pipe[91566]: 3D5226B6136A: to=<[email protected]>, relay=plesk_virtual, delay=97090, delays=97084/0.04/0/6.1, dsn=4.2.1, status=deferred (Message can not be delivered at this time )
Jul 26 10:29:41 res9 plesk_saslauthd[68565]: No such user '[email protected]' in mail authorization database
Jul 26 10:29:41 res9 plesk_saslauthd[68565]: failed mail authentication attempt for user '[email protected]' (password len=7)

It looks like the spam is trying to deliver it.

Regards
Jan
 
I can't seem to reproduce it either with a new mailbox, so it seems only to happen when a mailbox existed prior to the update to 18.0.37

I seem to remember that long ago it was not needed to enter a user and password when creating a mail account that did not had a mailbox, only a forward. Maybe that is why there is no user in the database now.

I already did try to repair it with both the plesk repair mail and mchk utilities.

regards
Jan
 
I found the reason why it is happening:

conditions:
- mailbox = no
- forward = yes

at that point /var/qmail/mailnames/domain/mailbox/qmail has the lines:


| true
| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO" -a "${ORIGINAL_RECIPIENT:-DELIVERED_TO}"
&[email protected]

The work around:
mailbox on
enabling "Do not deliver copies of forwarded emails to the Plesk mailbox"
mailbox off

removes the line

| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO" -a "${ORIGINAL_RECIPIENT:-DELIVERED_TO}"

from

/var/qmail/mailnames/domain/mailbox/qmail

and the problem is solved. So that line in the qmail file is the reason. i suspect this is a historic line that is not needed anymore and never removed.

Manualy removing the line also solves the problem.

info: we used to use qmail and courier, but that has been changed to postfix and dovecot in sept 2018, plesk was 17.8.11 at that moment.

would be very usefull: a script that makes a list of all mailboxes that have no mailbox but forwarding AND this line in the qmail file and then removes the line out of the qmail file.

regards
Jan
 
solution/work around to fix it for now

NO WARRANTY !!!
USE AT YOUR OWN RISK !!!

plesk db "SELECT postbox, delivery from mail WHERE postbox='false';"
plesk db "UPDATE mail SET delivery='false' WHERE postbox='false';"
plesk repair mail -y
perl -p -i -e 's/--daemonize//g' /etc/sysconfig/spamassassin
postqueue -c /etc/postfix -f

No explanation.
If you don't know what these commands mean then you should not be tampering with them.

regards
Jan
 
From developer:

While the provided information gets us closer to the issue, I still couldn't reproduce it.

When adding a spam check with "Move spam to the Spam folder" on a mail account with disabled mailbox and enabled forwarding, and sending a spam (GTUBE) mail to this mail account, the following behavior is observed:

Jul 26 18:36:28 a10-52-31-116 postfix-local[7172]: postfix-local: from=[email protected]10-52-31-116.qa.plesk.ru, to=[email protected]10-52-31-116.qa.plesk.ru, dirname=/var/qmail/mailnames
Jul 26 18:36:28 a10-52-31-116 spamassassin[7174]: Starting the spamassassin filter...
Jul 26 18:36:28 a10-52-31-116 spamd[19704]: spamd: connection from localhost [::1]:52468 to port 783, fd 6
Jul 26 18:36:28 a10-52-31-116 spamd[19704]: spamd: using default config for [email protected]10-52-31-116.qa.plesk.ru: /var/qmail/mailnames/test1.a10-52-31-116.qa.plesk.ru/mail3/.spamassassin/user_prefs
Jul 26 18:36:28 a10-52-31-116 spamd[19704]: spamd: processing message <[email protected]10-52-31-116.qa.plesk.ru> for [email protected]10-52-31-116.qa.plesk.ru:30
Jul 26 18:36:28 a10-52-31-116 spamd[19704]: spamd: identified spam (1001.4/7.0) for [email protected]10-52-31-116.qa.plesk.ru:30 in 0.1 seconds, 892 bytes.
Jul 26 18:36:28 a10-52-31-116 spamd[19704]: spamd: result: Y 1001 - ALL_TRUSTED,DNS_FROM_AHBL_RHSBL,GTUBE scantime=0.1,size=892,user=[email protected]10-52-31-116.qa.plesk.ru,uid=30,required_score=7.0,rhost=localhost,raddr=::1,rport=52468,mid=<[email protected]10-52-31-116.qa.plesk.ru>,autolearn=no autolearn_force=no
Jul 26 18:36:28 a10-52-31-116 dovecot_authdb_plesk[6818]: No such user '[email protected]10-52-31-116.qa.plesk.ru' in mail authorization database
Jul 26 18:36:28 a10-52-31-116 spamassassin[7174]: Mail delivery from '/usr/local/psa/handlers/spool/spam.5Rlrr5' to '[email protected]10-52-31-116.qa.plesk.ru' into 'INBOX.Spam' failed with return code 67
Jul 26 18:36:28 a10-52-31-116 spamassassin[7174]: Unable to deliver message into Spam folder
Jul 26 18:36:28 a10-52-31-116 postfix-local[7172]: Error during 'spam' handler
Jul 26 18:36:28 a10-52-31-116 spamd[19668]: prefork: child states: II
Jul 26 18:36:28 a10-52-31-116 dovecot: service=imap, user=[email protected]10-52-31-116.qa.plesk.ru, ip=[::1]. Disconnected: Logged out rcvd=620, sent=758
Jul 26 18:36:29 a10-52-31-116 check-quota[7186]: Starting the check-quota filter...
Jul 26 18:36:29 a10-52-31-116 journal: plesk sendmail[7184]: handlers_stderr: SKIP
Jul 26 18:36:29 a10-52-31-116 journal: plesk sendmail[7184]: SKIP during call 'check-quota' handler
Jul 26 18:36:29 a10-52-31-116 postfix/pickup[6539]: 1F59930136385: uid=30 from=<[email protected]10-52-31-116.qa.plesk.ru>
Jul 26 18:36:29 a10-52-31-116 postfix/cleanup[7166]: 1F59930136385: message-id=<[email protected]10-52-31-116.qa.plesk.ru>
Jul 26 18:36:29 a10-52-31-116 postfix/pipe[7171]: 98BD430136383: to=<[email protected]10-52-31-116.qa.plesk.ru>, relay=plesk_virtual, delay=0.54, delays=0.18/0.02/0/0.34, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Jul 26 18:36:29 a10-52-31-116 postfix/qmgr[6538]: 98BD430136383: removed
Jul 26 18:36:29 a10-52-31-116 postfix/qmgr[6538]: 1F59930136385: from=<[email protected]10-52-31-116.qa.plesk.ru>, size=982, nrcpt=1 (queue active)

And no lingering mail in mail queue are observed.

So, basically, the spam filter works and attempts to deliver mail in Spam folder of non-existent mailbox. This (as expected) results in mail handler error. However, this doesn't result in Postfix deferring the mail. So no additional mails stay in the mail queue. I.e. no real problem is observed.

Enabling auto-responder doesn't seem to influence the behaviour.

Perhaps a more specific configuration or set of actions is required to reproduce the issue. I see a couple of differences with the provided log:
  1. provided log doesn't have "spamassassin[...]: Unable to deliver the message into Spam folder" mail handler message which should be there (indicating customized mail handler binary or incomplete log excerpt);
  2. provided log contains duplicate "dovecot_authdb_plesk[...]: No such user '[email protected]' in mail authorization database" message for some reason (indicating potential double delivery attempt or unknown customization).
 
I have posted the why and a solution in my previous posts, the probkem is

| /usr/libexec/dovecot/dovecot-lda -d "$DELIVERED_TO" -a "${ORIGINAL_RECIPIENT:-DELIVERED_TO}"
in
/var/qmail/mailnames/domain/mailbox/qmail

Perhaps the offending line was entered long time ago, that i don't know and i have no idea how or when it got in there.

It is not removed by "plesk repair mail" when "postbox" is false and "delivery" is true (both in table mail).

It is removed by "plesk repair mail" when postbox is false and delivery is false.

The field delivery was true everywhere, perhaps this is de default status when the field was created during the update to 18.0.37.

Regards
Jan
 
Thank you. Reproduced on upgrade to 18.0.37. Confirmed issue PPPM-13129.
 
Its still not fixed for me. I installed the patch and took an reboot.

I see following lines in maillog:
Aug 16 10:44:06 srv1 dovecot_authdb_plesk[2219]: No such user '[email protected]' in mail authorization database
Aug 16 10:44:06 srv1 postfix/pipe[19388]: EAFC61440580: to=<[email protected]>, relay=plesk_virtual, delay=33981, delays=33981/0/0/0.15, dsn=4.2.1, status=deferred (Message can not be delivered at this time )

Plesk Version:
Plesk Obsidian
Version 18.0.37 Update #2
 
Dear Igor!

This bug seem's to me not fixed at all. If i disable the mailbox for an address, mail delivery is executed after it (does not reject) but the mails are vanished / removed.

Config:
  • Plesk Obsidian v18.0.40_build1800220116.00 os_Debian 10.0
  • Debian 10.11
  • postfix 3.4.14-0+deb10u1
  • dovecot 2.3.17-v.debian.10+p18.0.40.3+t220116.0005
Steps to reproduce:
  1. take a mail address ([email protected]) and disable the mailbox (forwarding is disabled too, spam filtering status is not relevant, i tested it)
  2. the delivery value is still true in tha psa > mail table.
  3. /var/qmail/mailnames/domain.tld/address/.qmail content: "| true"
  4. send an email to that address
  5. mail is sent, but it should be rejected,
  6. the receiver server tries to deliver the mail, but at the end removes it. (cant find it physically in the mailbox / directory)
Logs:
  • postfix/qmgr[27320] D2F3C200746: removed
  • postfix/pipe[5800] D2F3C200746: to=<[email protected]>, relay=plesk_virtual, delay=2.5, delays=0.49/0.01/0/2, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
  • postfix-local[5801] D2F3C200746: dmarc: stderr: PASS
  • postfix-local[5801] D2F3C200746: dk_check: stderr: PASS
  • postfix-local[5801] D2F3C200746: spam: stderr: PASS
  • spamd[1820] spamd: result: . -1 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS scantime=1.9,size=3484,user=[email protected],uid=30,required_score=3.0,rhost=::1,raddr=::1,rport=60856,mid=<[email protected]>,autolearn=ham autolearn_force=no
  • spamd[1820] spamd: clean message (-1.1/3.0) for [email protected]:30 in 1.9 seconds, 3484 bytes.
  • spamd[1820] spamd: processing message <[email protected]> for [email protected]:30
  • spamd[1820] spamd: using default config for [email protected]: /var/qmail/mailnames/qhosting.hu/address/.spamassassin/user_prefs
  • postfix-local[5801] D2F3C200746: from=<[email protected]>, to=<[email protected]>, dirname=/var/qmail/mailnames
  • postfix/qmgr[27320] D2F3C200746: from=<[email protected]>, size=3044, nrcpt=1 (queue active)
  • psa-pc-remote[10508] D2F3C200746: check-quota: stderr: SKIP
  • psa-pc-remote[10508] D2F3C200746: spf: stderr: PASS
  • psa-pc-remote[10508] D2F3C200746: py-limit-out: stderr: SKIP
  • psa-pc-remote[10508] D2F3C200746: py-limit-out: stderr: INFO:__main__:No SMTP AUTH and not running in sendmail context (incoming or unrestricted outgoing mail). SKIP message.
  • postfix/cleanup[5792] D2F3C200746: message-id=<[email protected]>
  • psa-pc-remote[10508] D2F3C200746: from=<[email protected]> to=<[email protected]>
  • postfix/smtpd[5786] D2F3C200746: client=mail-wr1-f51.google.com[209.85.221.51]
 
Back
Top