Change 451 Temp Lookup code to permanent 550 code for unknown local recipients

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Change 451 Temp Lookup code to permanent 550 code for unknown local recipients

James Brown
Postfix 3.4.0, using Dovecot for SASL authentication and MySQL.

I have set:

unknown_local_recipient_reject_code = 550

But when an email comes through to an unknown user, a 451 Temporary Lookup Failure code is given, not a 550:

2019-03-04 15:52:00.949864+1100  localhost smtpd[25337]: connect from localhost[127.0.0.1]
2019-03-04 15:52:01.246686+1100  localhost smtpd[12280]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)
2019-03-04 15:52:01.246723+1100  localhost smtpd[12280]: warning: mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf lookup error for "[hidden email]"
2019-03-04 15:52:01.246747+1100  localhost smtpd[12280]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[hidden email]>: Temporary lookup failure; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<astaro1.bordo.com.au?-?192.168.1.2?-?mail.bordo.com.au?-?mail.bordo.com.au>

This causes the sending mail server to store the email and try several times.

This is the sort of thing the sending mail server sees:

Connected to mail.bordo.com.au.
Escape character is '^]'.
220 mail.bordo.com.au ESMTP Postfix
EHLO me     
250-STARTTLS
250-SIZE 102400000
250-AUTH PLAIN
250-AUTH=PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 NOOP
mail from: [hidden email]
250 2.1.0 Ok
451 4.3.0 <[hidden email]>: Temporary lookup failure
Connection closed by foreign host.

How can I get it to send a permanent failure code?

Thanks,

James.

smime.p7s (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Change 451 Temp Lookup code to permanent 550 code for unknown local recipients

Pau Amma
On Mon, March 4, 2019 5:29 am, James Brown wrote:

> Postfix 3.4.0, using Dovecot for SASL authentication and MySQL.
>
> I have set:
>
> unknown_local_recipient_reject_code = 550
>
> But when an email comes through to an unknown user, a 451 Temporary Lookup
> Failure code is given, not a 550:
>
> 2019-03-04 15:52:00.949864+1100  localhost smtpd[25337]: connect from
> localhost[127.0.0.1]
> 2019-03-04 15:52:01.246686+1100  localhost smtpd[12280]: warning: connect
> to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost'
> (using password: YES)

I think Postfix is temp-rejecting in this case to give you a chance to fix
this before the next sender retry attempt.

Reply | Threaded
Open this post in threaded view
|

Re: Change 451 Temp Lookup code to permanent 550 code for unknown local recipients

Viktor Dukhovni
In reply to this post by James Brown
[ Just this once, I'm going to make an exception and send HTML email. It's only
   new content is colour added to two snippets of the original text. ]

On Mar 4, 2019, at 12:29 AM, James Brown <[hidden email]> wrote:

2019-03-04 15:52:00.949864+1100  localhost smtpd[25337]: connect from localhost[127.0.0.1]
2019-03-04 15:52:01.246686+1100  localhost smtpd[12280]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)
2019-03-04 15:52:01.246723+1100  localhost smtpd[12280]: warning: mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf lookup error for "[hidden email]"
2019-03-04 15:52:01.246747+1100  localhost smtpd[12280]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[hidden email]>: Temporary lookup failure; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<astaro1.bordo.com.au?-?192.168.1.2?-?mail.bordo.com.au?-?mail.bordo.com.au>

[ For anyone reading this in mutt, pine, elm, ... the "mysql" table warnings
  have been emphasized for the OP.  With a bit of luck he'll realize that failure
  to access the database is not an instance of "unknown local recipient". ]

-- 
-- 
Viktor.

Reply | Threaded
Open this post in threaded view
|

Re: Change 451 Temp Lookup code to permanent 550 code for unknown local recipients

James Brown
> On 4 Mar 2019, at 4:40 pm, Viktor Dukhovni <[hidden email]> wrote:

>
> [ Just this once, I'm going to make an exception and send HTML email. It's only
>    new content is colour added to two snippets of the original text. ]
>
>> On Mar 4, 2019, at 12:29 AM, James Brown <[hidden email]> wrote:
>>
>> 2019-03-04 15:52:00.949864+1100  localhost smtpd[25337]: connect from localhost[127.0.0.1]
>> 2019-03-04 15:52:01.246686+1100  localhost smtpd[12280]: warning: connect to mysql server 127.0.0.1: Access denied for user 'postfix'@'localhost' (using password: YES)
>> 2019-03-04 15:52:01.246723+1100  localhost smtpd[12280]: warning: mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf lookup error for "[hidden email]"
>> 2019-03-04 15:52:01.246747+1100  localhost smtpd[12280]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <[hidden email]>: Temporary lookup failure; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<astaro1.bordo.com.au?-?192.168.1.2?-?mail.bordo.com.au?-?mail.bordo.com.au>
>
> [ For anyone reading this in mutt, pine, elm, ... the "mysql" table warnings
>   have been emphasized for the OP.  With a bit of luck he'll realize that failure
>   to access the database is not an instance of "unknown local recipient". ]
Thanks Pau and Victor. Sorry about the HTML email.

The access denied warning has now been fixed - I had not changed the password in mysql_virtual_mailbox_maps.cf. No longer getting that error - thanks!

And sender is now getting a 550 error!

2019-03-04 17:38:35.647068+1100  localhost smtpd[75996]: connect from localhost[127.0.0.1]
2019-03-04 17:38:36.636562+1100  localhost smtpd[75996]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown in virtual mailbox table; from=<[hidden email]> to=<[hidden email]> proto=ESMTP helo=<astaro1.bordo.com.au?-?192.168.1.2?-?mail.bordo.com.au?-?mail.bordo.com.au>
2019-03-04 17:38:36.914926+1100  localhost cleanup[79609]: CDAC911DFB34: message-id=<[hidden email]>
2019-03-04 17:38:37.043967+1100  localhost smtpd[75996]: disconnect from localhost[127.0.0.1] ehlo=1 starttls=0/1 mail=1 rcpt=0/1 quit=1 commands=3/5

Thanks again,

James.

smime.p7s (9K) Download Attachment