Lost all mail in inbox

Discussion in 'General' started by RHITNL, May 10, 2015.

  1. RHITNL

    RHITNL Member

    Hi all,

    running ispconfig 3 on a vps centos 6.5 box. I works like a charm but without any reason I lost all but 1 email in 1 of my main mailboxes. The created folders are still populated with mail but the inbox is empty.
    I tried to find out what happend as I did not do anything with the server for days but there is nothing I can find that makes it clear.
    Dovecot is used to connect via imap (several devices) and roundcube is my default webmail system.
    Could anybody please point me where to start searching. Non of the opened logfiles shows me any info.
    I do have to say that the VPS network was in maintanance last week (update router firmware) and just after a short downtime most of my email in the empty folder was duplicated. also strange behaviour but i removed those duplicated (and unread) mails slowly checking the importance.

    I need my mail!
     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Have you tried to run check the filesystem and made sure, that everything is mounted? Can´t you see the mails in your email-program or can´t you see them on the shell? If you lost your mails on the hdd, you should restorte them from a backup.
     
  3. RHITNL

    RHITNL Member

    Hi Florian, thanks for the reply.
    I use Winscp to browse in the file system (windows user) and saw that the vmail folder of that user (did not checked the other users of the same domain) was empty in the main cur folder (only 2 files/mailes there instead over 2000)
    I stopped the dovecot service, renamed dovecot.index.cache, dovecot.index.log and dovecot.index.
    Started the service again, just to m ake sure the index files were not corrupted.
    When I check the existing folders, they are populated with mail. both in client as in the cur folder.
    I have used this mailbox earlier today on my tablet so I'm really shocked the mail is gone.

    What else can I do?
     
  4. RHITNL

    RHITNL Member

    maillog showes me this line today over 1000 times
    Line 12918: May 10 16:36:19 start getmail: msg 820/1006 (766406 bytes) msgid 1427972526/3361 from <getmail@*.*.ext> delivered to MDA_external command sendmail (), deleted
    Replace the actual domain to *.*.ext
    This is the reason i'm afraid....
    what is going on?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you use courier or dovecot imap? Please post the exact path where you see the emails on the shell.
     
  6. RHITNL

    RHITNL Member

    Hi Till,
    Like I mentioned in my original post, I use Dovecot.
    The full path to the location I use to see the mails is /var/vmail/domain.ext/user/Maildir/cur
    The pathe were I rename the earlier mentioned files is /var/vmail/domain.ext/user/Maildir
    Replace the real domain and user for dummy info. If you need this, I can send you a PM.
    Thanks!
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The path /var/vmail/domain.ext/user/Maildir/cur should be correct for dovecot. Incoming mails go to /var/vmail/domain.ext/user/Maildir/new and as soon as they were read, the mails get moved to /var/vmail/domain.ext/user/Maildir/cur by dovecot. Did you change something in the dovecot.conf file? Maybe you somehow changed from maildir format to a different format like mdbox?
     
  8. RHITNL

    RHITNL Member

    Hi Till,
    No did not do anything to the config. Updated to the last patch the night before which went well. The getmail action is running for weeks now grabbing mail from my local server which are 2 or 3 mails a day. New mail like notification from this forum just comes in as it used to but the getmail simply started deleting all my mails without a reason.
    Is there a way to get them back?
     
  9. RHITNL

    RHITNL Member

    Anybody? Or is it just to bad, deal with it?
    I'm talking about 1000 emails deleted by a used service on a pretty default setup.
    I must be happy it happened to my own email and not customers. I would say not to use fetchmail service on centos combined with dovecot
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Never had any problems with fetchmail and dovecot any I manage quite a few servers. The only way that you can get problems is if you try to let fetchmail fect emails from the same mailbox where it delivers the emails to. But fetchmail is not related to your issue that mails are stored in a wrong directory as fetchmail delivers emails by smtp, so they go the same way trough postfix like any other incoming email.
     
  11. RHITNL

    RHITNL Member

    Looks like the log file tells otherwise. Fetchmail is getmail, right? It claimed over a 1000 times it deleted a mail.
    what other info will be helpful to get the issue pinpointed?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. The name of the program it getmail while the mnu item in ispconfig is labeled fetchmail.

    I guess you misinterpret the log line. Do you refer to this?

    Line 12918: May 10 16:36:19 start getmail: msg 820/1006 (766406 bytes) msgid 1427972526/3361 from <getmail@*.*.ext> delivered to MDA_external command sendmail (), deleted

    This line contains 2 actions:

    1) delivered to MDA_external command sendmail ()
    2) deleted

    so what did the program do:

    It fetched a email, then it delivered it successfully to sendmail command (in aother words, postfix received the email from getmail) and then it deleted the email( as it was successfully delivered).

    The interesting part are now the next lines in the mail.log, what did postfix do with the email that it received from getmail.
     
  13. RHITNL

    RHITNL Member

    Ah, ok. sorry for the lack of my skills.
    Is there a way I can see which line in the log below to eachother.
    I see a msgid in the line I send already and that one in there a lot of times (msgid 1427972526) but the number behind the slash (3361) is counting. The line I send is just a random line.

    Code:
    May 10 16:36:19 start postfix/pickup[12934]: 827946AC9: uid=5001 from=<getmail>
    May 10 16:36:19 start postfix/cleanup[12709]: 827946AC9: message-id=<[email protected]>
    May 10 16:36:19 start getmail: msg  820/1006 (766406 bytes) msgid 1427972526/3361 from <getmail@*.*.ext> delivered to MDA_external command sendmail (), deleted
    May 10 16:36:19 start postfix/qmgr[1609]: 827946AC9: from=<getmail@*.*.ext>, size=766659, nrcpt=1 (queue active)
    May 10 16:36:19 start postfix/smtpd[11184]: 9109C67DD: client=unknown[127.0.0.1]
    
     
  14. florian030

    florian030 Well-Known Member HowtoForge Supporter

    And the next log-entries?
    You should see
    amavis (if installed)
    (dovecot)
    postfix/pipe
    postfix/qmgr (with removed)
    If the postfix´ qmgr does not remove the successfull delivered mail to postfix/pipe, you should check your mailque.
     
  15. RHITNL

    RHITNL Member

    The lines further on are related to another removed mail I guess.
    I added the whole file as it currently is as download if you don't mind. Since I don't know the unique identifier per mail I don't know which lines belong to each other.
    http://server.rh-it.nl/maillog.txt
     
  16. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Do you see
    May 10 16:36:20 start postfix/pipe[11191]: 451FB6ACE: to=<[email protected]>, relay=dovecot, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail forwarding loop for [email protected])
    I think, you should check the mailbox for [email protected]-it.nl and fix your confg.
     
  17. RHITNL

    RHITNL Member

    [email protected]-it.nl is not a mailbox I created. The server runs on start.rh-it.nl
    The domain that is concerned here is rh-it.nl
    The config of the setup fetchmail is below (auto generated by ISPconfig)
    [options]
    # message_log = /var/log/getmail.log
    message_log_syslog = true
    delete = false
    read_all = false

    [retriever]
    type = SimpleIMAPSSLRetriever
    server = server.rh-it.nl
    username = [email protected]
    password = ******

    [destination]
    type = MDA_external
    path = /usr/sbin/sendmail
    arguments = ("-i", "-bm", "[email protected]")
    unixfrom = true
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

  19. RHITNL

    RHITNL Member

    Yes. Fetch from my home server and deliver to my vps running ispconfig. Both on totally different network. It worked for weeks if not months. I read my mails earlier that day. And just after dinner I opened my mailapp and saw only one mail left. Got another fetchmail setup and fetch mail from same home server and delivers to same vps without any issues. On both sides (home and vps) both mail accounts are exactly the same.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    For me it seems as if the mail got fetcjed and delivered on the same server. Maybe server.rh-it.nl is pointing to the local server in dns or server.rh-it.nl is in the hosts file of the server so that it connects to itself.
     

Share This Page