Error to send email (wrong header message)

Ask all your questions regarding OC 6.x Please read the Support Forum Rules
Forum rules
ownCloud 6.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
Hoper.me
Newbie
Posts: 5
Joined: Fri Apr 04, 2014 9:25 am
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3.10

Error to send email (wrong header message)

Postby Hoper.me » Tue Apr 08, 2014 10:10 am

I have the owncloud on linux Ubuntu 12.04 LTS x64

Code: Select all

>uname -a
Linux ownCloud-v2-142 3.11.0-19-generic #33~precise1-Ubuntu SMP Wed Mar 12 21:16:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Users from LDAP
config file owncloud config/config.php

Code: Select all

  'ldapIgnoreNamingRules' => false,
  'log_type'=>'owncloud',
  'logfile'=>'owncloud.log',
  'logdateformat'=>'F d, Y H:i:s',
  'loglevel'=>'3',
  "mail_domain" => "mydom1.com",
  "mail_smtpdebug" => true,
  "mail_smtpmode" => "smtp",
  "mail_smtphost" => "mail.mydom1.com",
  "mail_smtpport" => 587,
  "mail_smtptimeout" => 10,
  "mail_smtpsecure" => "tls",
  "mail_smtpauth" => true,
  "mail_smtpname" => "noreplay@mydom1.com",
  "mail_smtppassword" => "passwd",
);

I have MTA postfix on other server (domain @mail.mydom1.com).
Users have e-mails in domain @mydom2.com

I try to share a file or folder (the user have a email user-c@mydom2.com) and send to link by mail to other domain user-b@mydom1.com.
Log owncloud.log

Code: Select all

{"app":"mail","message":"SMTP Error: The following recipients failed: user-b@mydom1.com","level":3,"time":"April 07, 2014 12:31:30"}
{"app":"PHP","message":"Only variables should be passed by reference at \/var\/www\/owncloud\/core\/ajax\/share.php#238","level":3,"time":"April 07, 2014 12:31:30"}
{"app":"PHP","message":"Cannot modify header information - headers already sent by (output started at \/var\/www\/owncloud\/3rdparty\/class.smtp.php:804) at \/var\/www\/owncloud\/lib\/private\/json.php#122","level":3,"time":"April 07, 2014 12:31:30"}
{"app":"PHP","message":"Cannot modify header information - headers already sent by (output started at \/var\/www\/owncloud\/3rdparty\/class.smtp.php:804) at \/var\/www\/owncloud\/lib\/private\/json.php#17","level":3,"time":"April 07, 2014 12:31:30"}


Log postfix

Code: Select all

Apr  7 15:31:21 post-lin64-s4 postfix/smtpd[18587]: connect from unknown[192.168.1.12]
Apr  7 15:31:21 post-lin64-s4 postfix/smtpd[18587]: NOQUEUE: reject: RCPT from unknown[192.168.1.12]: 553 5.7.1 <user-c@mydom2.com>: Sender address rejected: not owned by user noreplay@mydom1.com; from=<user-c@mydom2.com> to=<user-b@mydom1.com> proto=ESMTP helo=<192.168.1.12>
Apr  7 15:31:21 post-lin64-s4 postfix/smtpd[18587]: lost connection after RCPT from unknown[192.168.1.12]
Apr  7 15:31:21 post-lin64-s4 postfix/smtpd[18587]: disconnect from unknown[192.168.1.12]


The server ownCloud use user account noreplay@mydom1.com and try to send message from user-c@mydom2.com to user-b@mydom1.com, the postfix rejected this message because it is not right a header.
What wrong?

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Error to send email (wrong header message)

Postby tflidd » Tue Apr 08, 2014 5:22 pm

Your postfix rejects the recipient. This is not an owncloud issue.

Is the mail-server on a different host? You should activate relaying for host 192.168.1.12.

Hoper.me
Newbie
Posts: 5
Joined: Fri Apr 04, 2014 9:25 am
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3.10

Re: Error to send email (wrong header message)

Postby Hoper.me » Wed Apr 09, 2014 12:57 pm

tflidd wrote:Your postfix rejects the recipient. This is not an owncloud issue.

Is the mail-server on a different host? You should activate relaying for host 192.168.1.12.

activate relaying
- it's not good idea :shock: .
And if I want to use smtp.gmail.com - I can't do this. Google will reject me too.
Header must have:
from: noreplay@mydom1.com
to: user-b@mydom1.com
BODY
User <user-c@mydom2.com> send to you link...

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Error to send email (wrong header message)

Postby RandolphCarter » Wed Apr 09, 2014 8:52 pm

Your postfix rejects the recipient.

Actually it says the sender address is rejected.
So I think either your users need to change their address to @mydom2.com, or you need to configure your postfix to allow arbitrary sender addresses (consult postfix configuration for that).

Hoper.me
Newbie
Posts: 5
Joined: Fri Apr 04, 2014 9:25 am
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3.10

Re: Error to send email (wrong header message)

Postby Hoper.me » Thu Apr 10, 2014 10:04 am

RandolphCarter wrote:
Your postfix rejects the recipient.

Actually it says the sender address is rejected.
So I think either your users need to change their address to @mydom2.com, or you need to configure your postfix to allow arbitrary sender addresses (consult postfix configuration for that).


I did all in one domain:
1. account for owncloud (in config file) - noreplay@mydom1.com
2. User have an email - user-b@mydom1.com
3. User destination - user-c@mydom1.com
user-b try to send link to user-c and got error (see attach).
user-c.png
recepient
user-c.png (13.86 KiB) Viewed 2866 times

err.png
error
err.png (7.14 KiB) Viewed 2866 times


Log postfix:

Code: Select all

Apr 10 10:00:50 post-lin64-s4 postfix/smtpd[11708]: NOQUEUE: reject: RCPT from unknown[192.168.1.12]: 553 5.7.1 <user-b@mydom1.com>: Sender address rejected: not owned by user no-replay@mydom1.com; from=<user-b@mydom1.com> to=<user-c@mydom1.com> proto=ESMTP helo=<cloud>

It's mean server owncloud trying to send from a username which differs from the username it logging in as, e.g. cloud set the From: to be no-reply@mydom1.com, which is obviously not the same as user-b@mydom1.com

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Error to send email (wrong header message)

Postby RandolphCarter » Thu Apr 10, 2014 10:36 am

It seems your server is only configured to send mails from this one address (noreplay/no-replay@mydom1.com)...

Hoper.me
Newbie
Posts: 5
Joined: Fri Apr 04, 2014 9:25 am
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3.10

Re: Error to send email (wrong header message)

Postby Hoper.me » Thu Apr 10, 2014 11:45 am

RandolphCarter wrote:It seems your server is only configured to send mails from this one address (noreplay/no-replay@mydom1.com)...

that would send a mail client must authenticate to the mail server (noreplay@mydom1.com/pass) and send mail from noreplay@mydom1.com to user-c@mydom1.com
It's right:
authentication: norelpay@mydom1.com
from: noreplay@mydom1.com
to: user-c@mydom1.com

The owncloud do:
It's NOT right
authentication: norelpay@mydom1.com
from: user-b@mydom1.com <--- it's not right
to: user-c@mydom1.com

The user authentication must be = user from

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Error to send email (wrong header message)

Postby RandolphCarter » Thu Apr 10, 2014 2:19 pm

There is a mail_from_address setting, but I don't think it will override the user email.
Not sure how this is supposed to work in a multi-user environment, or when people enter mail addresses with even different domains. I suppose owncloud expects to have a mailserver which accepts arbitrary FROM addresses.

You could report an issue at the issue tracker: https://github.com/owncloud/android/core/issues

Hoper.me
Newbie
Posts: 5
Joined: Fri Apr 04, 2014 9:25 am
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.3.10

Re: Error to send email (wrong header message)

Postby Hoper.me » Mon Apr 14, 2014 9:55 am



  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 6.x”

Who is online

Users browsing this forum: No registered users and 2 guests