Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
long delay when reciving emails [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Dreadfull2007
n00b
n00b


Joined: 28 Feb 2007
Posts: 54

PostPosted: Mon Oct 08, 2007 11:23 am    Post subject: long delay when reciving emails [SOLVED] Reply with quote

anyone has any idea why would i recive emails after hours ?
running postfix + sqlgrey + amavis + courier

when i send an email it gets send and arrives in the other place instantly .. but when someone sends me an email i need to wait for hours
if needed, i'll post my configs.
P.S: mailq is empty


Last edited by Dreadfull2007 on Tue Oct 09, 2007 6:05 am; edited 1 time in total
Back to top
View user's profile Send private message
di1bert
l33t
l33t


Joined: 16 May 2002
Posts: 963
Location: Oslo, Norway

PostPosted: Mon Oct 08, 2007 12:23 pm    Post subject: Reply with quote

Perhaps there is an issue with your grey listing which is causing the extra long delay.

Also a few servers don't play well with grey listing which is why I choose not to implement it.
Could this not be the cause of the issue ? I'd start with disabling sqlgrey to see if
it helps at all....

HTH

-m
Back to top
View user's profile Send private message
Dreadfull2007
n00b
n00b


Joined: 28 Feb 2007
Posts: 54

PostPosted: Mon Oct 08, 2007 5:41 pm    Post subject: Reply with quote

the problem is i don't remember how to disable it without screwing this off :<
made the mail server long time ago ..

well i belive it's all in /etc/postfix/main.cf
and i belive it's "greylist_policy" .. how do i disable it ? remove/comment the lines with check_policy_service ?

Code:

smtpd_restriction_classes =
        greylist_policy

greylist_policy =
        check_policy_service inet:127.0.0.1:2501


and

Code:

        greylist_policy
... from smtpd_recipient_restrictions

Later EDIT: did exactly that, and it worked, now it works like a charm, hope i won't be full of spam :|


Last edited by Dreadfull2007 on Mon Oct 08, 2007 5:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Mon Oct 08, 2007 5:53 pm    Post subject: Reply with quote

All Postfix requires is this line in your /etc/postfix/main.cf

check_policy_service inet:127.0.0.1:2501

If you comment that line out and then restart Postfix you will have removed greylisting. However it might be worthwhile to change the reconnect_delay in your /etc/sqlgrey/sqlgrey.conf file. I set mine to the lowest possible of 1 minute. Many mail systems like Hotmail attempt two or three times in the first five minutes. Then they retry the next hour or so if those failed. By setting your daley time low more mail should show up with less delay.

reconnect_delay = 1

I'd also check that you're using the small site settings which are the following.
awl_age = 60
group_domain_level = 2

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Dreadfull2007
n00b
n00b


Joined: 28 Feb 2007
Posts: 54

PostPosted: Mon Oct 08, 2007 6:04 pm    Post subject: Reply with quote

for the moment i tryied with sqlgrey disabled, and it worked like a charm, trying now with your settings .. if i CAN .. then i want to keep sqlgrey up .. it really keeps the spam off.

EDIT:

Ok, so here are the results:

Code:

Oct  8 21:13:20 csworld postfix/smtpd[6386]: NOQUEUE: reject: RCPT from web34410.mail.mud.yahoo.com[66.163.178.159]: 450 4.7.1 <dreadfull@csworld.ro>: Recipient address rejected: Greylisted for 1 minutes; from=<site_producer2005@yahoo.com> to=<dreadfull@csworld.ro> proto=SMTP helo=<web34410.mail.mud.yahoo.com>


why greylisted ?

so i sent another email .. and then both appeared in my queue list .. and as i saw in sqlgrey.conf .. this setting: group_domain_level = 2 .. it made me wonder .. what happens if i change it to "1" ?

Later edit: same thing, still need to send the second email to "unlock" the 1st one ..
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Mon Oct 08, 2007 7:39 pm    Post subject: Reply with quote

Dreadfull2007 wrote:

Later edit: same thing, still need to send the second email to "unlock" the 1st one ..


Yes, that is exactly what greylisting is supposed to do. Here is a rough explanation.

Someone sends you mail. Postifx opens a connections and then passes a number of things to sqlgrey, sender username and sender domain, receiver user and domain, and IP address of the sending server. Sqlgrey stores those in it's database and also checks to see if that sender is allowed to that receiver. If sqlgrey has never send that combination before it tells Postfix to pass 450, temp error to the sender.

A proper Sender sees the 450 error and then queues the original email to be sent later. Later should be something less than 15 minutes unless the MTA or admin sucks. A spam server will not queue the email, since that requires more resources and never retry.

In order to speed mail delivery sqlgrey does a few nice things. Once a mail has been resent and received sqlgrey will whitelist that sender/receiver pair for 60 days. sqlgrey will also accept a retry from a mail machine on the same /24 subnet as the original email attempt. Additionally it will whitelist a domain if five sender/receiver pairs have been whitelisted. And so on. All of this is configurable, but should be default if you're running a recent version.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Dreadfull2007
n00b
n00b


Joined: 28 Feb 2007
Posts: 54

PostPosted: Mon Oct 08, 2007 7:59 pm    Post subject: Reply with quote

didn't know it makes the sender requeue, ok so then i think it's ok, here's my current config, hope it's ok or maybe i could tweak some settings.

Code:

reconnect_delay = 1
awl_age = 60
group_domain_level = 2
db_type = mysql
db_name = sqlgrey
db_host = localhost
db_port = 3306
db_user = sqlgrey
db_pass = *
db_cleandelay = 1800
clean_method = sync
prepend = 1
optmethod = optout


the rest .. default
seems this:
Code:

max_connect_age = 24
connect_src_throttle = 5
greymethod = smart
discrimination = off
discrimination_add_rulenr = off
reject_first_attempt = delay
reject_early_reconnect = delay
reject_code = 451


also, thank you for your replies.
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Mon Oct 08, 2007 9:03 pm    Post subject: Reply with quote

That looks like my config. The greymethod = smart bit turns on most of the things I mentioned in my last post. Greylisting tends to suck a bit when you first turn it on, but once it gets going you should be fine. I do recommend keeping an eye on your mail logs to look for poorly configured MTAs that might have issues resending to you and to whitelist the one or two you might find.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Dreadfull2007
n00b
n00b


Joined: 28 Feb 2007
Posts: 54

PostPosted: Tue Oct 09, 2007 6:05 am    Post subject: Reply with quote

alright, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum