Amavis problem - emails stuck in queue

Discussion in 'Installation/Configuration' started by mislav, Jan 15, 2019.

  1. mislav

    mislav Member

    Clean installation of Deb 8, following howtoforge tutorial - perfect server. Emails have been stucking in mail queue and it seems to be some problem with Amavis.

    Mailq shows the following:
    I've enabled amavis log level debug and here is the full output:
    Any idea what could cause this? Solution for this? Message limit size is set to 0 in main.cf, so as far as I read on the internet - it shouldn't be attachment size related problem.
     
  2. mislav

    mislav Member

    Maybe I've found the root cause of the problem:
    https://www.faqforge.com/linux/cont...e-to-the-socket-broken-pipe-on-openvz-server/

    I've found in mail.log the following entry (after enabling postfix debug in master.cf):
    I'm running virtualized environment with proxmox - but LXC containers are in the background, replacement for openvz. How to set this there, anyone knows?
     
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Have you tried to stop postfix and amavis, maybe ensure they're stopped, then restart the services? If so, what happenes? If it's anything related to socket resource limits like your last suggestion, I would expect that after restarting those services, some mail makes it through delivery, until whatever limit is being hit.

    The issue itself sounds like the smtpd on port 10025 is not responding after the terminating "." for the DATA command. You could try: stop postfix and amavis, start postfix, telnet to port 10025 and send a message manually (ie. send basic smtp commands for a test message) and see if it every returns anything from ".". Maybe there's some filter or policy service setup for that port 10025 smtpd which isn't returning (and probably which shouldn't be configured there).

    See what you find from that, and maybe post your main.cf and master.cf if needing further help tracking things down.
     
  4. mislav

    mislav Member

    I've tried to stop/start services multiple times and re-send all emails and it takes time...very long. Emails are stuck in queue few hours, but in the end they're delivered, so clients complain about messages coming late.
    What I've tested so far is that no matter whatever the emails are sent locally or from local server remotely, with or without attachements - there is no difference. I've tried to even use sengrid as a relay...still the same thing, they just slow process on the server.
    In addition to that, I've also disabled scanning of outgoing emails, though that might help for at least outgoing and to check if maybe amavis/clamav is creating an issue...but nothing.

    I will try now what you've suggested, meanwhile, here is the output of main and master conf.

     
  5. mislav

    mislav Member

    Seems to be limit to 10k chars per post, so...and also master.cf
    As you can see, I've also tried changing amavis maxprocesses, but that also didn't help.
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Comment out those three settings and reload postfix, I suspect that will fix it.

    If not, the next thing I'd wonder about is your dns and mysql config. Is your hostname correct? What is in /etc/hosts? Do all your DNS servers answer promptly and reliably? Is mysql configured to perform name lookups? What do you have in your mysql user table for the 'ispconfig' user, an entry for "localhost" host? Do mysql queries respond promptly?
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Also either remove those or check your greylisting service, as your initial post shows nothing listening on port 10023.
     
  8. mislav

    mislav Member

    I've disabled those - no change. Those settings were copied from previous server and it was working there just fine.

    Next. Hostname is indeed correct, I've double check that (in main.cf, etc/hosts, reverse DNS is also set correctly and verified by datacenter). I'm using in resolv.conf datacenter nameserver that came together with the installation - I've tried switching to google DNS, but that also didn't help.

    As for mysql - there is no skip-name-resolve in my.cnf, I've not enabled it. Mysql user:
    Mysql queries are working fine - there are quite few websites on the server and they're working without problems - fast loading, no problems there.
     
  9. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Other things you could check are the health of the disk(s) (does dmesg show any errors, or smartctl indicate a problem?), and try running mysql check/repair on the dbispconfig database.
     
  10. mislav

    mislav Member

    Disks are completely new - this is new server, so datacenter placed new disks with 0 powerred-on hours with 0 errors in smart values - that was checked just in case also now. Dmesg doesn't show errors.

    Mysql check/optimize/repair has been made on ispconfig db. Just in case I'm running it for all dbs on the server in screen.

    I've done this and I receive email ASAP
     
  11. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Make sure to check and fix or disable greylisting on port 10023 (mentioned above, but might have missed it).

    If port 10025 delivers well, test port 10024 (that runs through amavis scanning).
     
  12. mislav

    mislav Member

    I will get back to you a bit late, I think I've managed to fix the problem, but need to see when work hours starts and people start sending those emails.
    So far, thank you very much for everything!
     
  13. mislav

    mislav Member

    Jesse Norell and till like this.

Share This Page