Link to home
Start Free TrialLog in
Avatar of fashuai
fashuai

asked on

How to fix "Sender address rejected: not owned by user" ?

Hello,

I have a mail server well configured on a debian for 2 domain names who actually works great.

Postfix is configured to work with mysql and sasl auth. I followed this tutorial.

Few days ago, I add a new domain to manage emails and add dkim signature (I also manage zone dns) but when i try to get auth on smtp to send emails like my others domain who works fine, i get this error message in log file of mail.log :

Jun 23 15:57:32 ns365598 postfix/smtpd[5649]: connect from ks301281.kimsufi.com[94.23.49.46]
Jun 23 15:57:32 ns365598 postfix/smtpd[5649]: NOQUEUE: reject: RCPT from ks301281.kimsufi.com[94.23.49.46]: 553 5.7.1 <contact@brazilianbikinishop.com>: Sender address rejected: not owned by user contact@brazilianbikinishop.com; from=<contact@brazilianbikinishop.com> to=<febrez@originart.ws> proto=ESMTP helo=<localhost>
Jun 23 15:57:32 ns365598 postfix/smtpd[5649]: disconnect from ks301281.kimsufi.com[94.23.49.46]

Open in new window


Could you help me to resolv this problem ? I can provide files you need, thanks
Avatar of helpquick
helpquick
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

It looks like your client software has not sent the authentication request... I would expect to see some mention of AUTH in the logs, but it isn't there.

Double check that you have configured your client to send authentication information.

Regards
Avatar of fashuai
fashuai

ASKER

To do tests, I use this php script :

<?php
 require_once "Mail.php";

 $from = " bbs test <contact@brazilianbikinishop.com>";
 $to = "febrez ows <febrez@originart.ws>";
 $subject = "Sujet!";
 $body = "Hi,\n\nHow are you?";

 $host = "ssl://mail.brazilianbikinishop.com";
 $port = "465";
 $username = "contact@brazilianbikinishop.com";
 $password = "passwd";

 $headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
 $smtp = Mail::factory('smtp',
   array ('host' => $host,
     'port' => $port,
     'auth' => true,
     'username' => $username,
     'password' => $password));

 $mail = $smtp->send($to, $headers, $body);

 if (PEAR::isError($mail)) {
   echo $mail->getMessage();
  } else {
   echo "Message successfully sent!";
  }
?>


When I execute it, it returns me the error I posted, but when I use it with another $username and put a wrong password it tells me the right thing :

Jun 24 05:21:30 ns365598 postfix/smtpd[14730]: connect from ks301281.kimsufi.com[94.23.49.46]
Jun 24 05:21:31 ns365598 postfix/smtpd[14730]: warning: ks301281.kimsufi.com[94.23.49.46]: SASL LOGIN authentication failed: authentication failure
Jun 24 05:21:31 ns365598 postfix/smtpd[14730]: disconnect from ks301281.kimsufi.com[94.23.49.46]


No way to get auth for user contact@bbs ! I don't know why, all services are restarded.

I need to see how postfix is configured, can you send the output of postconf please.
Avatar of fashuai

ASKER

Here is.
postconf.txt
Which DKIM milter are you using?

smtpd_sender_restrictions starts with permit_mynetworks, so connections from localhost don't need to authenticate, so it's not a SASL problem... but...

You have

smtpd_sender_login_maps = mysql:/etc/postfix/mysql/virtual_forwardings.cf
smtpd_sender_restrictions =  reject_sender_login_mismatch

So sender needs to be authenticated in order to verify the user and sender match...

Have you setup the users in your virtual_forwarding table correctly?


Avatar of fashuai

ASKER

Actually, virtual_forwardings.cf contains the entry : table = postfix_forwardings which in this table (source, destination) is only to do forwards and not used to manage users, in relation to the tutorial I followed.

Because I can send emails from another domain name where user figures in table postfix_users and isn't in postfix_forwarding.

Still confused!
ASKER CERTIFIED SOLUTION
Avatar of helpquick
helpquick
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fashuai

ASKER

It is exactly what I missed. Thank you.