LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 04-02-2012, 03:57 PM   #1
kongfranon
Member
 
Registered: Aug 2010
Posts: 30

Rep: Reputation: 0
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
 
Old 04-02-2012, 04:47 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
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?
 
Old 04-03-2012, 09:50 AM   #3
kongfranon
Member
 
Registered: Aug 2010
Posts: 30

Original Poster
Rep: Reputation: 0
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?
 
Old 04-03-2012, 10:24 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
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
 
Old 04-03-2012, 01:45 PM   #5
kongfranon
Member
 
Registered: Aug 2010
Posts: 30

Original Poster
Rep: Reputation: 0
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
 
Old 04-03-2012, 02:00 PM   #6
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
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.
 
Old 04-03-2012, 02:51 PM   #7
kongfranon
Member
 
Registered: Aug 2010
Posts: 30

Original Poster
Rep: Reputation: 0
Yes so far all the testing I have done is from cron jobs from a particular user.
 
Old 04-04-2012, 05:35 AM   #8
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
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.
 
Old 04-04-2012, 08:51 AM   #9
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 207
Blog Entries: 3

Rep: Reputation: 16
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

Last edited by pantdk; 04-04-2012 at 08:53 AM.
 
Old 04-18-2012, 04:44 PM   #10
kongfranon
Member
 
Registered: Aug 2010
Posts: 30

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and forward email to multiple email servers using postfix haleem Linux - Newbie 1 12-31-2009 05:28 AM
Email server running Postfix will not accept email... trekgirl Linux - Server 12 03-04-2009 02:43 AM
how to make postfix send email to another postfix in local network (LAN)? h4k33m Linux - Server 7 01-19-2009 05:26 PM
Sending delayed email with Evolution Wesociety Linux - Software 3 07-05-2005 03:55 PM
How do I configure postfix master to forward all email to an email server ? hello321_1999 Linux - Software 1 11-18-2004 05:43 AM


All times are GMT -5. The time now is 02:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration