Email Undelivered: can't create user output file

Thank @calport however problem was something else… and probably its not taken care completely.

For normal users everything works fine. I figured out issue was something else running below command.

echo test | sudo /etc/webmin/virtual-server/lookup-domain.pl user-domain.com

I am running webmin at 11000 port and loopup-domain also runs at same port if not changed.

Here is the fix if you’re running webmin at 11000 port and ran into same issue.

  1. Change lookup-domain port in virtualmin:
    Goto Virtualmin → Email Settings → Spam & virus setting → Domain Lookup Daemon Port
    Change it to any value other than 11000, I set to 12000
  2. Update procmailrc file:
    Goto Webmin → Servers → Procmail Mail Filter → Manually Edit Configuration
    Change following line
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl --exitcode 73 $LOGNAME

to

VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl --port 12000 --exitcode 73 $LOGNAME

Your changed port here.

That’s all. Now if you run

echo test | sudo /etc/webmin/virtual-server/lookup-domain.pl user-domain.com

It should output you correct domain ID
something like 1645784274306360

Hope this will help others to resolve issue similar to this one.