Error: reject_sender_login_mismatch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error: reject_sender_login_mismatch

LEON
Hi,

   I have running a server with postfix-mysql+dovecot+postfixadmin,in
main.cf:

smtpd_sender_login_maps =
        mysql:/etc/postfix/mysql_mailbox_maps.cf,
        mysql:/etc/postfix/mysql_alias_maps.cf

smtpd_sender_restrictions =
        reject_non_fqdn_sender,
        reject_sender_login_mismatch


virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox_maps.cf
user = mail
password = password
hosts = 127.0.0.1
dbname = mail
query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username =
'%s' AND active = 1

virtual_alias_maps = mysql:/etc/postfix/mysql_alias_maps.cf
user = mail
password = password
hosts = 127.0.0.1
dbname = mail
query = SELECT goto FROM alias WHERE address = '%s' AND active = 1

When sending a mail,i got a error message.
An error occurred while sending mail. The mail server responded:  4.3.0
<[hidden email]>: Temporary lookup failure. Please check the message
recipient [hidden email] and try again.

In google,many advice is to create another sender maps,but it is so
difficult and no automatic when creating new user in postfixadmin to do
that with thousands of mail users. I think there must be a better way to
set "smtpd_sender_login_maps = myql:***".

Regards

--
Leon
www.kingdest.com

Reply | Threaded
Open this post in threaded view
|

Re: Error: reject_sender_login_mismatch

Ansgar Wiechers
On 2012-09-20 Leon wrote:

> smtpd_sender_login_maps =
> mysql:/etc/postfix/mysql_mailbox_maps.cf,
> mysql:/etc/postfix/mysql_alias_maps.cf
>
> smtpd_sender_restrictions =
> reject_non_fqdn_sender,
> reject_sender_login_mismatch
>
>
> virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox_maps.cf
> user = mail
> password = password
> hosts = 127.0.0.1
> dbname = mail
> query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username
> = '%s' AND active = 1
>
> virtual_alias_maps = mysql:/etc/postfix/mysql_alias_maps.cf
> user = mail
> password = password
> hosts = 127.0.0.1
> dbname = mail
> query = SELECT goto FROM alias WHERE address = '%s' AND active = 1

These configuration settings apply to mail for which your server
is the final destination (i.e. mail you *receive*).

> When sending a mail,i got a error message.
> An error occurred while sending mail. The mail server responded:
> 4.3.0 <[hidden email]>: Temporary lookup failure. Please check the
> message recipient [hidden email] and try again.

This is an error for a message for which your server is *not* the final
destination (i.e. mail you *send*).

Check your mail.log for the respective line and also verify that name
resolution on your server is working properly.

Regards
Ansgar Wiechers
--
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky
Reply | Threaded
Open this post in threaded view
|

Re: Error: reject_sender_login_mismatch

mouss-4
In reply to this post by LEON
Le 20/09/2012 05:41, Leon a écrit :

> Hi,
>
>   I have running a server with postfix-mysql+dovecot+postfixadmin,in
> main.cf:
>
> smtpd_sender_login_maps =
>     mysql:/etc/postfix/mysql_mailbox_maps.cf,
>     mysql:/etc/postfix/mysql_alias_maps.cf
>
> smtpd_sender_restrictions =
>     reject_non_fqdn_sender,
>     reject_sender_login_mismatch
>
>
> virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox_maps.cf
> user = mail
> password = password
> hosts = 127.0.0.1
> dbname = mail
> query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username =
> '%s' AND active = 1
>
> virtual_alias_maps = mysql:/etc/postfix/mysql_alias_maps.cf
> user = mail
> password = password
> hosts = 127.0.0.1
> dbname = mail
> query = SELECT goto FROM alias WHERE address = '%s' AND active = 1
>
> When sending a mail,i got a error message.
> An error occurred while sending mail. The mail server responded:  4.3.0
> <[hidden email]>: Temporary lookup failure. Please check the message
> recipient [hidden email] and try again.
>
> In google,many advice is to create another sender maps,but it is so
> difficult and no automatic when creating new user in postfixadmin to do
> that with thousands of mail users. I think there must be a better way to
> set "smtpd_sender_login_maps = myql:***".
>

what do you mean? what exactly do you want to implement?

if the login must match the full email address for whatever domain, then
SELECT %s
could do. (but then do not create logins without the domain part).
note that the above can be implemnted with pcre/regex:
/(.*)/ $1


if you want to do some logic/transformations, then find out the sql
statement that implements what you need. start from something like

SELECT username FROM mailbox
        WHERE username = '%s' AND active = 1

then adjust as needed.