LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix - email getting delayed (https://www.linuxquestions.org/questions/linux-server-73/postfix-email-getting-delayed-937739/)

kongfranon 04-02-2012 02:57 PM

Postfix - email getting delayed
 
I setup Postfix on a centos 6 box. First time I have used Postfix, usually use sendmail.

I set it up to forward all mail to an internal relay host.

I just need it to send email for cron jobs that run and notify when an error happens.

Every once in a while email might take up to 5 days to get from the box. I am able to test it and happens randomly.

I look at /var/log/maillog but don't see any errors.

I am not sure what is the best way to debug this? If anyone has any advice?

Thanks

Noway2 04-02-2012 03:47 PM

Not much information to go on. Normally, Postfix will deliver immediately, unless there is a temporary error in which case the message will be "deferred" but still stay in the queue. Since you are able to test and see it happen, I would look for any such condition. I would also see if Postfix claims that there are messages in the queue and try to flush them and see what happens.

Can you post a log entry showing one that doesn't go through and one that does for comparison purposes?

kongfranon 04-03-2012 08:50 AM

I should have corrected myself, it not something I can replicate easy, it seems to happen maybe once out of 100 emails sent from cron. For example I just checked que and it is empty.

I have the email that was received yesterday, and it shows that it was sent 3/29 @ 10 pm

So I looked in /var/log/maillog-20120401

and could not find an exact mail at that time only thing was close was sent at 23:00


Mar 29 23:00:40 server1 postfix/smtp[23230]: 6E8D616179C: to=<user@test.com>, relay=smtp.test.com[192.168.1.1]:25, delay=0.09, delays=0.02/0.02/0.02/0.04, dsn=2.0.0, status=sent (250 2.0.0 q2TNmX8t013865 Message accepted for delivery)

I am not sure if this even the email, since it only shows the to and from in the logs, is there a way to turn on more debugging information so would show maybe the subject?

Noway2 04-03-2012 09:24 AM

Quote:

is there a way to turn on more debugging information so would show maybe the subject?
Have a look at the following: http://www.postfix.org/DEBUG_README.html#debug_peer

kongfranon 04-03-2012 12:45 PM

Thanks I turned it on so far I found this:



warning: the Postfix sendmail command has set-uid root file permissions
warning: or the command is run from a set-uid root process
warning: the Postfix sendmail command must be installed without set-uid root file permissions


I did a google search and looks like it is a bug with cron? Have you ever seen this?

Thanks

Noway2 04-03-2012 01:00 PM

This is a first for me and it does raise a question: are the "delayed" mail all from a CRON task or does it happen with regular user mail?
To me these warnings sound more like a minor security issue than something that would cause mail to be delayed / deferred.

kongfranon 04-03-2012 01:51 PM

Yes so far all the testing I have done is from cron jobs from a particular user.

Noway2 04-04-2012 04:35 AM

Interesting. I wish I could offer your more specific advice at this point, but the best I have to offer at this time is to use the known facts as filters to try and sort through your mail logs. In addition to the general info log, a lot of times there is an error and warning log that might be of more value to you. In particular look for "deferred" or "reject" messages associated with this user.

pantdk 04-04-2012 07:51 AM

Hi

You have to check number of the mail in "queue/deferred/active/hold/" number of smtp request & alos check the memory utilization & disk utilization

#mailq |wc -l
#qshap hold
#qshape deferred
#qshape active
top & iostat check the disk i/o wait


Postfix mainly utilized the memory so may you need to increase the memory but check all statics then go for that
It also depend how many users you have in that postfix server
some other parameter can change in that

Just get all these statics & figure out where is the problem

Also check the nice value of qmgr & postfix & can change to -10

kongfranon 04-18-2012 03:44 PM

Thanks for the help I meant to come back to this.

unfortunately whatever was happening has not replicated itself, and for the past week or so email is working right on the dot. I really don't know what happened.

Thanks


All times are GMT -5. The time now is 09:23 AM.