Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

exim4 email retry

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
graemev2
Posts: 95
Joined: 2019-01-08 17:28
Has thanked: 2 times

exim4 email retry

#1 Post by graemev2 »

I feel quite embarrassed asking this question. I suspect I've simply phrased my Google searches wrong.

1: I use exim4 to deliver mail on my server
2: Several users have a ~/.forward file to forward to their gmail account
...now a number of these are rejected by google, because it thinks they are spam:

Code: Select all

SMTP error from remote mail server after end of data: 552 7vJ4nb6aK62fn7vJ5nmALG message rejected due to spam or virus......
I've done a number of things to stop/catch SPAM but none the less some get though. So what I'd like to do is ONLY TRY ONCE.

Now I can do this (I guess) in /etc/exim4/conf.d/retry/30_exim4-config . Something like:

Code: Select all

google.com   errorname       ....then nothing else (i.e. don't retry)
The problem I have is what to use for errorname? The code google return is 552 , what does this translate into?

The choices seem to be things like:
  • auth_failed
  • data_4xx
  • lost_connection
  • mail_4xx
  • ...
  • tls_required
So I guess somewhere, there is a table of "translations" so 552 converts to ???? ...just guessing seems a poor solution.

Ahhh ...probably quite important , I use smarterhost

trinidad
Posts: 290
Joined: 2016-08-04 14:58
Been thanked: 14 times

Re: exim4 email retry

#2 Post by trinidad »

Do you have a fixed message size? Usually the common cause of 552 is a message with an attachment that is too big or detected as dangerous content. Sharing some links from forwarding can cause such errors.

google: google error code 552 SMTP, and you will find lots of info

TC
You can't believe your eyes if your imagination is out of focus.

User avatar
graemev2
Posts: 95
Joined: 2019-01-08 17:28
Has thanked: 2 times

Re: exim4 email retry

#3 Post by graemev2 »

Quite possibly it could be "size" but the textual part suggests it's failed a "spam/virus checker" I don't really care WHY google are rejecting it, I simply want to stop my server retrying sending it:

Code: Select all

# exim4 -brt google.com                                                                                                                                                                  
Retry rule: *  *  F,2h,15m; G,16h,1h,1.5; F,4d,6h;
As you can see, it'll try quite a lot. This comes from:

Code: Select all

# cat /etc/exim4/conf.d/retry/30_exim4-config                                                                                                                                            
                                                                                                                                                                                                               
### retry/30_exim4-config                                                                                                                                                                                      
#################################                                                                                                                                                                              
                                                                                                                                                                                                               
# This single retry rule applies to all domains and all errors. It specifies                                                                                                                                   
# retries every 15 minutes for 2 hours, then increasing retry intervals,                                                                                                                                       
# starting at 1 hour and increasing each time by a factor of 1.5, up to 16                                                                                                                                     
# hours, then retries every 6 hours until 4 days have passed since the first                                                                                                                                   
# failed delivery.                                                                                                                                                                                             
                                                                                                                                                                                                               
# Please note that these rules only limit the frequency of retries, the                                                                                                                                        
# effective retry-time depends on the frequency of queue-running, too.                                                                                                                                         
# See QUEUEINTERVAL in /etc/default/exim4.                                                                                                                                                                     
                                                                                                                                                                                                               
# Address or Domain    Error       Retries                                                                                                                                                                     
# -----------------    -----       -------                                                                                                                                                                     
                                                                                                                                                                                                               
*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h                                                                                                                                             

Since these are forwarded emails I don't have great deal of control. I filter mails based on e.g. spamassassin scores etc but some still get through. There are failures on both sides, some are SPAM and I miss then , some are OK but Google flag them.

I just want to give up on these after ONE attempt to deliver to google

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: exim4 email retry

#4 Post by dilberts_left_nut »

Something is wrong with your setup.
5xx is a permanent error and should never be retried.
4xx is a temporary error for which retry rules should control behaviour.
AdrianTM wrote:There's no hacker in my grandma...

User avatar
graemev2
Posts: 95
Joined: 2019-01-08 17:28
Has thanked: 2 times

Re: exim4 email retry

#5 Post by graemev2 »

dilberts_left_nut wrote: 2022-01-14 20:30 Something is wrong with your setup.
5xx is a permanent error and should never be retried.
4xx is a temporary error for which retry rules should control behaviour.
I agree, as in "5xx is a permanent error and should never be retried." ...none the less,
it does get retried and also I see the effect.

I've not edited these rules, these are AFAIK the default rules installed on Debian .

If it helps the messages appear on the "frozen" list (I'd expect them to just fail and never get frozen) does this sound right?

...I guess it's possible that they get rejected, like:


mail to fred@home
--> forward to fred1234@gmail.com .... rejected due to spam
--> return to fred@home
--> forward to fred1234@gmail.com ...


But that would make ~/.forward unusable ? ...so I guess it does not work that way?

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: exim4 email retry

#6 Post by dilberts_left_nut »

Yes, that is exactly the way it works (for a simple "forward everything" rule)
,...none the less,
it does get retried and also I see the effect.
Maybe not - it's probably the failure message.
I can't tell from here.
AdrianTM wrote:There's no hacker in my grandma...

Post Reply