1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

QMail : Slow, added -Rt0 in xine, but another problem

Discussion in 'Plesk for Linux - 8.x and Older' started by Swakoo, Aug 23, 2005.

  1. Swakoo

    Swakoo Guest

    Hi guys,

    I had a non-critical problem with my qmail, in which, for SMTP sending, it takes ages to send.

    Did a search and I've added -Rt0 to the server_args line to reduce the timeout and disable reverse lookup...

    it works wonderful, everything is smooth

    But now i realise, mails send out to external domains are not being processed! all stuck in remote queue, but local queue no problem whatsoever...

    have removed the -Rt0.. hope you guys got a clue or 2..


    ps: I got the -Rt0 from here (http://forum.plesk.com/showthread.php?s=&threadid=9387&perpage=15&pagenumber=2)
  2. jamesyeeoc

    jamesyeeoc Guest

    The -Rt0 by itself should not be the cause of stuck mails in the queue.

    Unless during the editing of the smtp_psa file, the editor inserted line breaks where it should not have (I have seen this happen with pico, nano, vi editors sometimes)

    The Server Args line is quite long and after you edit it, it should still be a single continuous line!

    I have also seen this happen if you use a Windows based editor to edit Linux files.

    And are you sure that the stuck emails are not Spam bounces/double bounces?
  3. Swakoo

    Swakoo Guest

    because all my clients complained their recipients have not received their mails (those outside the domains controlled by PLESK)

    My line is quite long..
    server_args = /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

    And it happens after I added -Rt0.

    First time, i thought it was a conincidence. When I restore the arguement, today users complained again...

    my mail queue swelled to 40000 already... I tried to use qmHandle to remove those mails but the qmHandle script doesn't work.. need to configure the pidof.. i replaced it with ps command..

    after which the pidof error message doesn't appear, but it says it deteced QMail as not running, thus it won't be starting it.

    But a check.. the message in queue is still there :S
  4. Swakoo

    Swakoo Guest

    my immediate concern now is to clear the mail queue, so people's mail cnan move in and out smoothly..

    qmHandle isn't working.. tried a search no net but nothing... :(

    at my wit's end now...

    am quite a noob with linux thats why

    would appreciate help :)
  5. jamesyeeoc

    jamesyeeoc Guest

  6. Swakoo

    Swakoo Guest

    ok will stick to here..

    btw your commad, it should be -f 1 instead ;) that will give the pid.. but your command help nonetheless!
    -f 2 gave me pts/02 hehe

    ok here's the headache... i have deleted ALL the email in the queue now as it was getting stuck and not being moved...

    i just tried mailing to my own email account and to my external (gmail) account..

    nothing yet... sob sob
  7. jamesyeeoc

    jamesyeeoc Guest

    OS specifics... f2 vs f1

    Sorry I don't have an EL3 test system :)

    Sounds like you may have other problems. Have you been keeping an eye on your mail log?


    (again, may be OS specific location)
  8. Swakoo

    Swakoo Guest

    Oh the command is OS specific? Thanks for enlightening.. trying to pick up the tricks of the trade here (the hard way apparently!)

    Log don show anything abnormal..or not that I recognise it as abnormal

    problem started whenever i add the -Rt0 to the server_args
    while I find it wierd too... thats the occurance... hope you guys can be patient with me as I seek to solve this step by step

    Below is my smtp_psa
    After adding -Rt0, I will be enjoying the quick sending of mail.. but soon after I will start hearing complaints of users' mails out to external parties not being received...

    For now, everything is back to normal...
    but what a terrible conincidence :(

    On a side note: How do I do a cron script that I can purge the mail queue of "failure notice" using qmHandle...

    many thanks to the patient people out here :)
  9. Swakoo

    Swakoo Guest

  10. jamesyeeoc

    jamesyeeoc Guest

    Sorry, the -f2 was actually a typo on my part, it should have been -f1.

    As to cron job, you can either use the Plesk control panel (Server - Crontab) and enter a new cron job for user root, or it can be done from the SSH command line.

    For example if you want it to run every 10 minutes, create a cron job such as:

    */10 * * * * /usr/bin/qmHandle -S"failure notice" >/dev/null 2>&1

    What this does is: runs every 10 minutes (*/10) of every hour/day/month/day of the week (* * * *), runs the command '/usr/bin/qmHandle' with parameter '-Stext' where the subject text is 'failure notice'. Per qmHandle:
    -Stext : delete all messages that have/contain text as Subject
    And any output is sent to dev/null (>/dev/null), error messages redirected to stdout (2>&1)

    As to the problem with adding '-Rt0' to your smtp_psa, I have no further clues as to why it would cause a problem, because it shouldn't cause any, it just turns off rDNS lookup and sets the timout to zero.

    Are you running on a VPS type server or a standalone dedicated??
  11. Swakoo

    Swakoo Guest

    Just that both time the mail stop sending out.. it was after I added the -Rt0... so now I am apprendensive about it.. but i really want to add it :(

    My is a dedicated server.. i set it up from scratch.. it is a DNS/EMail server

    my qmHandle runs from /tmp
    does it matter?

    outputting to /dev/null - means? any special funmction for that folder

    stdout.. means print on screen?
  12. jamesyeeoc

    jamesyeeoc Guest

    Just that both time the mail stop sending out.. it was after I added the -Rt0... so now I am apprendensive about it.. but i really want to add it
    That is a zero, not an Oh, right? And spaces on both sides of it. That's what is really weird, this has been a fix for years now and about the only things I have seen go wrong is if ^M chars are put in the file from Windows type editors (non-Linux editors), or if the ServerArgs line got broken up by the Linux editor inserting a line break in the middle of the line.

    My is a dedicated server.. i set it up from scratch.. it is a DNS/EMail server
    Ok, just checking, if it were on a VPS there may be other considerations regarding Qmail

    my qmHandle runs from /tmp
    does it matter?
    Hmm, not sure. Why is it in /tmp??

    outputting to /dev/null - means? any special funmction for that folder
    It means the output goes to the bit-bucket, into never-never land, a great black hole of electrons.

    stdout.. means print on screen?
    Generally, yes.
  13. Swakoo

    Swakoo Guest

    Thanks for your patience with me..

    hmmm i understand its quite an old fix.. dunno should I try it again... :S

    Oh so /dev/null its like a rubbish bin for us to throw our output and ensure that it gets thrown out for good?

    I usually download stuff into /tmp to try first..
    whats /usr/bin about? What kind of files are there usually?

    As you can see, I am a pretty noob to linux.. many thing is just pick up here and there...

    thanks once again for your undying patience ;)

  14. jamesyeeoc

    jamesyeeoc Guest

    hmmm i understand its quite an old fix.. dunno should I try it again... :S
    That is the million dollar question, for myself, I certainly would want to 'fix' the delay problem. If adding the -Rt0 again caused the problem, you bet I would be digging until I found the cause.

    Oh so /dev/null its like a rubbish bin for us to throw our output and ensure that it gets thrown out for good?
    Yup. And you don't even have to 'empty' the bin like in Windows

    I usually download stuff into /tmp to try first..
    whats /usr/bin about? What kind of files are there usually?
    User Binaries (user programs)

    As you can see, I am a pretty noob to linux.. many thing is just pick up here and there...
    No problem. We all have to learn sometime. At least this forum has a bunch of great and knowledgeable guys. There are some forums where the replies range from sarcastic to insulting.

    thanks once again for your undying patience
    My pleasure. If I had wanted to be any poorer, I actually would have become a teacher :) I actually like explaining things when I can, rather than short, curt/terse answers which only make one scratch one's head.......I guess that comes from raising 5 boys and now a couple of grand kids
  15. Swakoo

    Swakoo Guest

    What do you reckon could or may be the problem and where i should try starting? I have absolutely no idea now.

    Woah, I see you have cross many bridges :)
  16. jamesyeeoc

    jamesyeeoc Guest

    Since you say that the problem only begins sometime after adding this mod (not immediately), when it happens I would check the status of qmail, SA, bind/named, imap, and other critical services to make sure they are running. I know you have probably already done some or all of these, but without further details...

    Example: ps -ax |grep 'qmail'
    Example: ps -ax |grep 'imap'
    Example: ps -ax |grep 'spam'

    I would also check (using netstat) to make sure that something is 'listening' on the ports.

    Example: netstat -pan |grep ':25'
    Example: netstat -pan |grep ':143'
    Example: netstat -pan |grep ':110'
    Example: netstat -pan |grep 'spam'

    I would be checking the log files for any type of clues

    Example: tail /var/log/messages
    Example: tail /usr/local/psa/var/log/maillog
    Example: tail /usr/local/psa/var/log/smtp_pendings.log

    And probably a hundred other things which my fingers do without any brain cell interaction :)
  17. Swakoo

    Swakoo Guest

    How I wish I'll be able to obtain that stage! More Jedi training! :p

    I only check for qmail status.. which always is running... though sometimes it isn't, then again, that is ONLY after me frantically trying to settle the problem - may have stop it myself.

    - What's imap task? and 'spam' - Is there such a process? How about sendmail?

    - I suppose what netstat does is to listen to ports?

    if say the problem comes again, mail get stuck in queue, what you reckon i can do? The last time round i had to delete the queue! and remove -Rt0

    the first time I removed the command, do a bit of restarting of service, run qmhandle to clear it.. i think it helps.. somehow.. the last time it didn't...
  18. jamesyeeoc

    jamesyeeoc Guest

  19. Swakoo

    Swakoo Guest

    hi guys,

    sorry took a while to get back here: been busy with other matters (aren't we all hehe)

    anyway, i have added the -Rt0 again.. the full thing is now
    I'll update you guys again...
  20. Swakoo

    Swakoo Guest

    Ok guys, I did it twice 1st time...it didn't work straight away.. my mail queue build up almost immediately :(

    Some details

    qmHandle has been added with
    my ($pidcmd) = "ps -e |grep 'qmail-send' |cut -d ' ' -f 1";

    The moment i change, i check the queue by using qmHandle -s
    Straight away my remote queue builds up

    Thanks to jamesyeeoc, most arguements work for qmHandle (like deleteion etc)

    I wanted to list all the mail in remote queue with -R, I got...

    Doesn't work? Then I used -S"failure" and after that -R works.

    Anyway, the mail queue is piling up fast...
    so I removed the -Rt0 again.

    I then tried a second time whereby I added one more space before "-Rt0", as follows: Additional space can't be shown as the forum truncates additional spaces
    This time round.. up till now more than an hour has pass so far still ok. some interesting things to note...

    netstat -pan |grep 'spam' returns nothing

    ps -ax |grep 'spam' returns only "2757 pts/2 S 0:00 grep spam

    Any point for concern?

    One thng abt -Rt0, after adding it, while there is always mail in the queue, seems to be always more in the remote queue.. but so far.. acceptable

    on top of the above questions.. some more here...

    1) Where does the mail with "failure notice" goes to? Considering I haven't added the cron yet.. cos I have set to bounce all mail with invalid recipient(s) in my PLESK control panel.. so if I remove, there won't be any bounce mail so to speak, right?

    2) Why is it when it get stuck.. mostly are them (failure notices)? Where will they go after a while? will qmail be able to get rid of them automatically?

    3) There was a point the qmHandle didn't work. I had to change the my_pid to 'f 2' to get the pid... weird...? it seems randomly there's a space at the front... :confused:

    Especially so after i do a -S"failure notice".. then when i try to do a -a, it will tell me qmail is not running, then i know i have to do the above mentioned.... didn't know output position can be changed like that...

    after i did another delete, i had to change back to f 1 again....

    4) Any possible suggestion as to why my remote mail queue builds up more faster (and not get sent out) after i added the -Rt0? Right now some valid mails are stuck.. even after i delete the "failure notice", those mails never move...

    How else can i try to push it out? I have already try qmHandle -a

    5) all the failure notices are send out using MAILER-DAEMON@serverhostname, someare even send to "postmaster@serverhostname, which is not a valid domain.
    In sendmail, I could edit sendmail.mc to solve the problem by change the hostname when it sends out, to something valid. Especailly so when some email servers out there are sensitive to this...

    How do I do this for qmail?

    For now will still monitor.. while still acceptable.. the rising concern is that since i added, the remote queue is getting higher slightly.. and some valid mails are still stuck there...

    I'm afraid by tomorrow morning it will shoot up to tens of thousands...

    so till then.. would appreciate the feedback.. thanks!

    ps: I took more than 1hr to finish this post as I monitor and added stuff... so timing maybe off