Dear all,
when using the PHP function mail() or /usr/sbin/sendmail to locally send an e-mail, I discovered the following issue:
Normally, I would assume to receive a bounce message when sending an e-mail to a non-existing address.
If I use a non-existing external e-mail address as a recipient, the sender receives a normal bounce message.
However, if the recipient address belongs to a domain that is managed locally on my server (by Plesk) but has an invalid (non-existing) local part, the e-mail just seems to be discarded without further notification.
The following steps need to be performed to test this issue.
local (virtual) domain: mydomain.com (no catch-all address!)
local existing user: demo@mydomain.com
invalid address / non-existing local user: fake@mydomain.com
distant (existing) domain: otherdomain.com
non-existing user on distant domain: invalid@otherdomain.cm
Now try to send three e-mails as root:
a) echo "Test mail" | /usr/sbin/sendmail invalid@otherdomain.com
b) echo "Test mail" | /usr/sbin/sendmail fake@mydomain.com
c) echo "Test mail" | /usr/sbin/sendmail demo@mydomain.com
In all three cases, sendmail returns with exit code 0. For case (c), the e-mail is delivered as usual. For case (a), I receive a bounce e-mail telling that the address does not exist. However, for case (b), I do not receive any feedback. What I would expect instead to receive a bounce message just as I do for the other two cases as well.
For case (b) please have a look at the corresponding log file:
Jan 4 01:23:02 srv plesk sendmail[854]: handlers_stderr: PASS
Jan 4 01:23:02 srv plesk sendmail[854]: PASS during call 'limit-out' handler
Jan 4 01:23:02 srv plesk sendmail[854]: handlers_stderr: SKIP
Jan 4 01:23:02 srv plesk sendmail[854]: SKIP during call 'check-quota' handler
Jan 4 01:23:02 srv postfix/pickup[629]: 2D3311AD804B5: uid=0 from=<root>
Jan 4 01:23:02 srv postfix/cleanup[861]: 2D3311AD804B5: message-id=<20160104032302.2D3311AD804B5@srv.mydomain.com>
Jan 4 04:23:02 srv postfix/qmgr[3925]: 2D3311AD804B5: from=<root@srv.mydomain.com>, size=367, nrcpt=1 (queue active)
Jan 4 04:23:02 srv postfix-local[864]: postfix-local: from=root@srv.mydomain.com, to=fake@mydomain.com, dirname=/var/qmail/mailnames
Jan 4 01:23:02 srv dk_check[865]: DK_STAT_NOSIG: No signature available in message
Jan 4 01:23:02 srv postfix-local[864]: cannot chdir to mailname dir fake: No such file or directory
Jan 4 01:23:02 srv postfix-local[864]: Unknown user: fake@mydomain.com
Jan 4 01:23:02 srv postfix/pipe[863]: 2D3311AD804B5: to=<fake@mydomain.com>, relay=plesk_virtual, delay=0.3, delays=0.2/0/0/0.09, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Jan 4 01:23:02 srv postfix/qmgr[3925]: 2D3311AD804B5: removed
The same applies when using the mail() function of PHP.
Does anybody have an idea how to fix this?
B_P
when using the PHP function mail() or /usr/sbin/sendmail to locally send an e-mail, I discovered the following issue:
Normally, I would assume to receive a bounce message when sending an e-mail to a non-existing address.
If I use a non-existing external e-mail address as a recipient, the sender receives a normal bounce message.
However, if the recipient address belongs to a domain that is managed locally on my server (by Plesk) but has an invalid (non-existing) local part, the e-mail just seems to be discarded without further notification.
The following steps need to be performed to test this issue.
local (virtual) domain: mydomain.com (no catch-all address!)
local existing user: demo@mydomain.com
invalid address / non-existing local user: fake@mydomain.com
distant (existing) domain: otherdomain.com
non-existing user on distant domain: invalid@otherdomain.cm
Now try to send three e-mails as root:
a) echo "Test mail" | /usr/sbin/sendmail invalid@otherdomain.com
b) echo "Test mail" | /usr/sbin/sendmail fake@mydomain.com
c) echo "Test mail" | /usr/sbin/sendmail demo@mydomain.com
In all three cases, sendmail returns with exit code 0. For case (c), the e-mail is delivered as usual. For case (a), I receive a bounce e-mail telling that the address does not exist. However, for case (b), I do not receive any feedback. What I would expect instead to receive a bounce message just as I do for the other two cases as well.
For case (b) please have a look at the corresponding log file:
Jan 4 01:23:02 srv plesk sendmail[854]: handlers_stderr: PASS
Jan 4 01:23:02 srv plesk sendmail[854]: PASS during call 'limit-out' handler
Jan 4 01:23:02 srv plesk sendmail[854]: handlers_stderr: SKIP
Jan 4 01:23:02 srv plesk sendmail[854]: SKIP during call 'check-quota' handler
Jan 4 01:23:02 srv postfix/pickup[629]: 2D3311AD804B5: uid=0 from=<root>
Jan 4 01:23:02 srv postfix/cleanup[861]: 2D3311AD804B5: message-id=<20160104032302.2D3311AD804B5@srv.mydomain.com>
Jan 4 04:23:02 srv postfix/qmgr[3925]: 2D3311AD804B5: from=<root@srv.mydomain.com>, size=367, nrcpt=1 (queue active)
Jan 4 04:23:02 srv postfix-local[864]: postfix-local: from=root@srv.mydomain.com, to=fake@mydomain.com, dirname=/var/qmail/mailnames
Jan 4 01:23:02 srv dk_check[865]: DK_STAT_NOSIG: No signature available in message
Jan 4 01:23:02 srv postfix-local[864]: cannot chdir to mailname dir fake: No such file or directory
Jan 4 01:23:02 srv postfix-local[864]: Unknown user: fake@mydomain.com
Jan 4 01:23:02 srv postfix/pipe[863]: 2D3311AD804B5: to=<fake@mydomain.com>, relay=plesk_virtual, delay=0.3, delays=0.2/0/0/0.09, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Jan 4 01:23:02 srv postfix/qmgr[3925]: 2D3311AD804B5: removed
The same applies when using the mail() function of PHP.
Does anybody have an idea how to fix this?
B_P