Mail suddenly stopped being delivered to mailbox?

We have an existing installation that has been working fine now for some weeks and suddenly email has stopped being received by the end user. We did install some updates on the server using the built in updates function in Virtualmin/Webmin a few days ago so assume that it must relate to this. Below is an extract from the maillog can anyone advise why the mail is now, no-longer getting to the users mailbox and how to fix?

Sep 27 13:26:19 the_host_domain postfix/smtpd[30053]: connect from thb-mta-08-tx.emailfiltering.com[194.116.199.208]
Sep 27 13:26:19 the_host_domain postfix/trivial-rewrite[30056]: warning: do not list domain the_domain_name.co.uk in BOTH mydestination and virtual_alias_domains
Sep 27 13:26:19 the_host_domain postfix/smtpd[30053]: EF927130196: client=thb-mta-08-tx.emailfiltering.com[194.116.199.208]
Sep 27 13:26:20 the_host_domain postfix/cleanup[30057]: EF927130196: message-id=F16D267CFC28A74886C6676F4FDE110E78A84B@officeserver.local
Sep 27 13:26:20 the_host_domain postfix/qmgr[13177]: EF927130196: from=<person@the_sending_domain.co.uk>, size=10435, nrcpt=1 (queue active)
Sep 27 13:26:20 the_host_domain postfix/trivial-rewrite[30056]: warning: do not list domain the_domain_name.co.uk in BOTH mydestination and virtual_alias_domains
Sep 27 13:26:20 the_host_domain postfix/smtpd[30053]: disconnect from thb-mta-08-tx.emailfiltering.com[194.116.199.208]
Sep 27 13:26:22 the_host_domain postfix/smtpd[30053]: connect from dsvr.co.uk[212.69.210.106]
Sep 27 13:26:22 the_host_domain postfix/smtpd[30053]: 60FF713019C: client=dsvr.co.uk[212.69.210.106]
Sep 27 13:26:22 the_host_domain postfix/cleanup[30057]: 60FF713019C: message-id=0759175EC99C4A21BC0ADA415FA389C2@BABYSMART
Sep 27 13:26:22 the_host_domain postfix/qmgr[13177]: 60FF713019C: from=sales@babys-mart.co.uk, size=2421, nrcpt=1 (queue active)
Sep 27 13:26:22 the_host_domain postfix/trivial-rewrite[30056]: warning: do not list domain the_domain_name.co.uk in BOTH mydestination and virtual_alias_domains
Sep 27 13:26:22 the_host_domain postfix/smtpd[30053]: disconnect from dsvr.co.uk[212.69.210.106]
Sep 27 13:26:23 the_host_domain dovecot: imap-login: Login: user=<sales.btw>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 27 13:26:23 the_host_domain dovecot: IMAP(sales.btw): Disconnected: Logged out
Sep 27 13:26:25 the_host_domain dovecot: imap-login: Login: user=<sales.btw>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 27 13:26:25 the_host_domain dovecot: IMAP(sales.btw): Disconnected: Logged out
Sep 27 13:26:25 the_host_domain spamd[27728]: spamd: connection from localhost [127.0.0.1] at port 45841
Sep 27 13:26:25 the_host_domain spamd[27728]: spamd: setuid to sales.btw succeeded
Sep 27 13:26:25 the_host_domain spamd[27728]: spamd: processing message 0759175EC99C4A21BC0ADA415FA389C2@BABYSMART for sales.btw:504
Sep 27 13:26:25 the_host_domain dovecot: imap-login: Login: user=<sales.btw>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 27 13:26:25 the_host_domain dovecot: IMAP(sales.btw): Disconnected: Logged out
Sep 27 13:26:26 the_host_domain spamd[27728]: spamd: clean message (0.0/5.0) for sales.btw:504 in 1.7 seconds, 2538 bytes.
Sep 27 13:26:26 the_host_domain spamd[27728]: spamd: result: . 0 - HTML_MESSAGE scantime=1.7,size=2538,user=sales.btw,uid=504,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=45841,mid=0759175EC99C4A21BC0ADA415FA389C2@BABYSMART,autolearn=ham
Sep 27 13:26:26 the_host_domain postfix/local[30069]: 60FF713019C: to=<sales.btw@the_domain_name.co.uk>, orig_to=<sales@the_domain_name.co.uk>, relay=local, delay=4.5, delays=0.03/0.01/0/4.4, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Sep 27 13:26:26 the_host_domain postfix/qmgr[13177]: 60FF713019C: removed
Sep 27 13:26:26 the_host_domain dovecot: imap-login: Login: user=<sales.btw>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 27 13:26:26 the_host_domain dovecot: IMAP(sales.btw): Disconnected: Logged out
Sep 27 13:26:26 the_host_domain spamd[27726]: prefork: child states: II
Sep 27 13:26:27 the_host_domain spamd[27728]: spamd: connection from localhost [127.0.0.1] at port 45845
Sep 27 13:26:27 the_host_domain spamd[27728]: spamd: setuid to sales.btw succeeded
Sep 27 13:26:27 the_host_domain spamd[27728]: spamd: processing message F16D267CFC28A74886C6676F4FDE110E78A84B@officeserver.local for sales.btw:504
Sep 27 13:26:27 the_host_domain dovecot: imap-login: Login: user=<sales.btw>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 27 13:26:27 the_host_domain dovecot: IMAP(sales.btw): Disconnected: Logged out
Sep 27 13:26:29 the_host_domain spamd[27728]: spamd: clean message (1.9/5.0) for sales.btw:504 in 2.3 seconds, 10396 bytes.
Sep 27 13:26:29 the_host_domain spamd[27728]: spamd: result: . 1 - EXTRA_MPART_TYPE,HTML_MESSAGE,RCVD_NUMERIC_HELO scantime=2.3,size=10396,user=sales.btw,uid=504,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=45845,mid=F16D267CFC28A74886C6676F4FDE110E78A84B@officeserver.local,autolearn=no
Sep 27 13:26:29 the_host_domain postfix/local[30058]: EF927130196: to=<sales.btw@the_domain_name.co.uk>, orig_to=<sales@the_domain_name.co.uk>, relay=local, delay=9.7, delays=0.04/0.01/0/9.7, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Sep 27 13:26:29 the_host_domain postfix/qmgr[13177]: EF927130196: removed
Sep 27 13:26:29 the_host_domain spamd[27726]: prefork: child states: II

Howdy,

I don’t see any errors in your logs there – and I see at least one email being handed off to procmail, which is the tool that actually delivers the mail.

So, that much looks good.

You may want to take a peek at your procmail logs to make sure nothing is awry there… that’s located in /var/log/procmail.log.

-Eric

Ah I can see what’s wrong from the procmail logs it’s stopped placing the mail into the correct location its putting the mail into…

Folder: /var/mail/sales.btw

rather than the actual users local directory, not sure why this would have changed?

How do I fix and also how do I copy the mail from /var/mail/sales.btw into the users real directory?

Ah, that’s unusual… the only thing I can think of there is that somehow the /etc/procmailrc on your system may have gotten corrupted.

Can you paste in the contents of that file?

-Eric

LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0

  • ?/usr/bin/test “$EXITCODE” = “73”
    /dev/null
    EXITCODE=0
    :0
  • ?/usr/bin/test “$VIRTUALMIN” != “”
    {
    INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
    }
    ORGMAIL=/var/mail/$LOGNAME
    DEFAULT=/var/mail/$LOGNAME
    DROPPRIVS=yes
    :0
    $DEFAULT

Ah, it looks like ORGMAIL and DEFAULT were somehow changed! Those should both be as follows:

ORGMAIL=$HOME/Maildir/ DEFAULT=$HOME/Maildir/

OK thanks for that I’ve changed. Can you advise how I copy the mail across from the other location into the users real mailbox location?

Yeah, fixing that is the trickier of the problems :slight_smile:

The issue is that those are being stored in a different format over in /var/mail, so it’s not as simple as copying them. You’d somehow need to convert them from their current mbox format to what Virtualmin is using in /home, maildir.

I think you can do that using the Virtualmin command line tools, though I don’t have experience with this particular option, you may want to test it on a test system first.

But, try running “virtualmin copy-mailbox” (doing so will give you a list of options), I’m under the impression that can be used to not just copy a mailbox, but to change formats.

-Eric

Oh gosh sounds like it may be a pain, is there a way of me just manually forwarding one at a time the messages from the wrong box to the to the now correctly configured box?

I just forwarded a message from within Webmin/Virtualmin using the ‘Read User Mail’ and I can now see this in roundcube there is an issue however which may relate to roundcube basically in roundcube you can click and read the detail of older messages however the 2 test messages I’ve sent one from my Outlook and the other from the ‘Read User Mail’ within Webmin/Virtualmin give a 500 error in the browser. I think that roundcube maybe one of the applications that was updated recently are there any issues wiht the newer version or could something else be wrong?

Howdy,

The current RoundCube version should work okay… what I’d recommend is taking a look at the Apache error logs to see what is being generated in there anytime you get that 500 error.

The Apache error logs are located in $HOME/logs/error_log.

-Eric

Thanks for that the error log says…

PHP Fatal error: Class ‘DOMDocument’ not found in /path-to/public_html/roundcube/program/lib/washtml.php on line 266

Any ideas?

It looks like you may be missing a PHP module that RoundCube wants… it’s possible that’s a new dependency.

You can install that with “yum install php-xml” on CentOS, or “apt-get install php5-xml” on Debian/Ubuntu.

-Eric

Thank you Eric, this has worked