[Base] Sending mails only with base module installed brokes.

Asked by Nhomar - Vauxoo

Just install the initial db.

-- Without data demo..
-- Select your first partner (you).
-- Put an email address in contact.
-- Click on action "send email".
-- Fill the data on wizard.

The wizard close almost inmediatly and The error showed below appear on server log.

sh: lsb_release: command not found
[2010-08-09 16:40:27,108] ERROR:email_send:[01]:
[2010-08-09 16:40:27,109] ERROR:email_send:[02]: Environment Information :
[2010-08-09 16:40:27,109] ERROR:email_send:[03]: System : Linux-2.6.26-2-amd64-x86_64-with-debian-5.0.5
[2010-08-09 16:40:27,109] ERROR:email_send:[04]: OS Name : posix
[2010-08-09 16:40:27,109] ERROR:email_send:[05]: Operating System Release : 2.6.26-2-amd64
[2010-08-09 16:40:27,109] ERROR:email_send:[06]: Operating System Version : #1 SMP Thu Feb 11 00:59:32 UTC 2010
[2010-08-09 16:40:27,110] ERROR:email_send:[07]: Operating System Architecture : 64bit
[2010-08-09 16:40:27,110] ERROR:email_send:[08]: Operating System Locale : es_VE.UTF8
[2010-08-09 16:40:27,110] ERROR:email_send:[09]: Python Version : 2.5.2
[2010-08-09 16:40:27,110] ERROR:email_send:[10]: OpenERP-Server Version : 5.0.12
[2010-08-09 16:40:27,110] ERROR:email_send:[11]: Last revision No. & ID : 2090 <email address hidden>
[2010-08-09 16:40:27,110] ERROR:email_send:[12]:
[2010-08-09 16:40:27,111] ERROR:email_send:[13]:

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #615576.

This question was reopened

Revision history for this message
Anup(SerpentCS) (anup-serpent) said :
#1

Hello,

    The smtp server is not configured.

Thanks.

Revision history for this message
Anup(SerpentCS) (anup-serpent) said :
#2

Hello Nhomar,

       I have installed a new db with no demo data. I have created a partner having an email. I clicked the "Send Email". The error was raised but, for sending an email we need to configure the smtpserver. So for that the required parameters like smtp-server, smtp-port, username,password and ssl must be given in the config.py file. After configuring the server I tried the same and I found no such error and the mail is being sent successfully.
     Hope this helps.

Thanks.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#3

Hello Anup.

Where is my ssl option? i created this file with the -s opton on server and i dont see the ssl option for email....
I tried this credentials directly trought my email gateway and them works, but it has "ssl" and i can't see this option.

BTW.... The server is returning an exception in debug mode, It shouldn't return a WARNIGN message more clear? in my point of view this is a bug for the reason that the server is returning a no clear exception.

My Config Fle:
[options]
without_demo = False
netport = 8070
server_actions_allow_code = False
secure = False
demo = {}
syslog = False
list_db = True
cache_timeout = 100000
port = 8069
reportgz = False
secure_pkey_file = server.pkey
netinterface =
log_level = info
admin_passwd = foopasswd
smtp_port = 25
smtp_server = foobar.com.ve
db_user = openerp
db_password = foopswd
login_message = False
import_partial =
soap = False
pidfile = None
db_maxconn = 64
smtp_password = Eingai5i
xmlrpc = True
price_accuracy = 2
db_port = False
debug_mode = False
netrpc = True
secure_cert_file = server.cert
interface =
##logfile = /home/openerp/instancias/produccion/server/server.log
csv_internal_sep = ,
pg_path = None
translate_modules = ['all']
stop_after_init = False
root_path = /home/openerp/instancias/produccion/server/bin
smtp_user = foo
db_name = False
db_host = False
assert_exit_level = warn
email_from = <email address hidden>
addons_path = /home/openerp/instancias/produccion/server/bin/addons

regards

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) said :
#4

Could you check if python-openssl is installed on your computer ?

Thanks

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#5

Hello Stephane.

Yes, python-openssl package is installed.

Output from my console.
:~# aptitude search python-openssl | grep python-openssl
i python-openssl - Python wrapper around the OpenSSL library

I tried my credential in this way:

email_from = <email address hidden>
smtp_server = foobar.com.ve
smtp_ssl = True
smtp_user = <email address hidden>
smtp_password = FooPasswd
smtp_port = 25

The error is happening yet. Some Idea?

Regards

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#6

Hello Stephane.

Yes, python-openssl package is installed.

Output from my console.
:~# aptitude search python-openssl | grep python-openssl
i python-openssl - Python wrapper around the OpenSSL library

I tried my credential in this way:

email_from = <email address hidden>
smtp_server = foobar.com.ve
smtp_ssl = True
smtp_user = <email address hidden>
smtp_password = FooPasswd
smtp_port = 25

The error is happening yet. Some Idea?

Regards

Revision history for this message
Anup(SerpentCS) (anup-serpent) said :
#7

Hello,

      I think you have just passed wrong parameters. Can you please debug by putting print statements in server/bin/tools/misc.py file in email_send() method at line no 397 and 404 to check what parameters are causing the error. As I have checked the same again and it still is working as it should.

    And you can give ssl at the time of starting the server as ./openerp-server.py --smtp-ssl=True

Thanks.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#8

Hello Anup:

I made this changes on misc.py :
    try:
        oldstderr = smtplib.stderr
        s = smtplib.SMTP()

        try:
            # in case of debug, the messages are printed to stderr.
            if debug:
                smtplib.stderr = WriteToLogger()

            s.set_debuglevel(int(bool(debug))) # 0 or 1

            s.connect(config['smtp_server'], config['smtp_port'])
            print "SMTP Server....%s %s" % (config['smtp_server'],config['smtp_port'])
            if ssl:
                s.ehlo()
                s.starttls()
                s.ehlo()
                print "Is SSL Im in"
            if config['smtp_user'] or config['smtp_password']:
                print "I have uer and password"
                s.login(config['smtp_user'], config['smtp_password'])
                print "SMTP User and passwd....%s %s" % (config['smtp_user'],config['smtp_password'])
            s.sendmail(email_from,
                       flatten([email_to, email_cc, email_bcc]),
                       msg.as_string()
                      )

The debug return me this.

SMTP Server....heladosgilda.com.ve 25
Is SSL Im in
I have uer and password
sh: lsb_release: command not found
[2010-08-10 09:17:35,727] ERROR:email_send:[01]:
[2010-08-10 09:17:35,728] ERROR:email_send:[02]: Environment Information :
[2010-08-10 09:17:35,728] ERROR:email_send:[03]: System : Linux-2.6.26-2-amd64-x86_64-with-debian-5.0.5
[2010-08-10 09:17:35,728] ERROR:email_send:[04]: OS Name : posix
[2010-08-10 09:17:35,728] ERROR:email_send:[05]: Operating System Release : 2.6.26-2-amd64
[2010-08-10 09:17:35,728] ERROR:email_send:[06]: Operating System Version : #1 SMP Thu Feb 11 00:59:32 UTC 2010
[2010-08-10 09:17:35,728] ERROR:email_send:[07]: Operating System Architecture : 64bit
[2010-08-10 09:17:35,729] ERROR:email_send:[08]: Operating System Locale : es_VE.UTF8
[2010-08-10 09:17:35,729] ERROR:email_send:[09]: Python Version : 2.5.2
[2010-08-10 09:17:35,729] ERROR:email_send:[10]: OpenERP-Server Version : 5.0.12
[2010-08-10 09:17:35,729] ERROR:email_send:[11]: Last revision No. & ID : 2090 <email address hidden>
[2010-08-10 09:17:35,729] ERROR:email_send:[12]:
[2010-08-10 09:17:35,729] ERROR:email_send:[13]:

In other hand, I tried from thunderbird, and it brokes too.. I will check, I thin the try should return an explicit message like :

WARNING: error sending Email Chek Your credentials

In tis way you will never supose that is problem of OpeNERP.

regards.....

PD: I wll comment the results of my checking.

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#9

Hello Anup....

Updating my proof...

I connect in the Intranet with thunderbird, all fine, i linked a printscreen:

http://openerp.org.ve/SMTP.png

Success receive emails with this config.

http://openerp.org.ve/SMTPsuccess.png

My config File [[SMTP Configs]]:

email_from = <email address hidden> [example]
smtp_server = mail.heladosgilda.com.ve
smtp_ssl = False
smtp_user = foo [example]
smtp_password = xxxxxx
smtp_port = 25

I really don't understand it should work......

I need remark that i'm using (as in my before messages i showed you.) Debian Lenny and Python 2.5

The error again with the print statement.

SMTP Server....mail.heladosgilda.com.ve 25
I have user and password
sh: lsb_release: command not found
[2010-08-10 11:09:38,014] ERROR:email_send:[01]:
[2010-08-10 11:09:38,015] ERROR:email_send:[02]: Environment Information :
[2010-08-10 11:09:38,015] ERROR:email_send:[03]: System : Linux-2.6.26-2-amd64-x86_64-with-debian-5.0.5
[2010-08-10 11:09:38,015] ERROR:email_send:[04]: OS Name : posix
[2010-08-10 11:09:38,015] ERROR:email_send:[05]: Operating System Release : 2.6.26-2-amd64
[2010-08-10 11:09:38,015] ERROR:email_send:[06]: Operating System Version : #1 SMP Thu Feb 11 00:59:32 UTC 2010
[2010-08-10 11:09:38,016] ERROR:email_send:[07]: Operating System Architecture : 64bit
[2010-08-10 11:09:38,016] ERROR:email_send:[08]: Operating System Locale : es_VE.UTF8
[2010-08-10 11:09:38,016] ERROR:email_send:[09]: Python Version : 2.5.2
[2010-08-10 11:09:38,016] ERROR:email_send:[10]: OpenERP-Server Version : 5.0.12
[2010-08-10 11:09:38,016] ERROR:email_send:[11]: Last revision No. & ID : 2090 <email address hidden>
[2010-08-10 11:09:38,016] ERROR:email_send:[12]:
[2010-08-10 11:09:38,016] ERROR:email_send:[13]:

I'm almost sure something in my config is wrong, but What??. Apart of python-openssl what package is using to send emails...=?????

I have other versions on Ubuntu and send emails very well...... I dont understand.

I printed the user and password too! This is passing well....

The problem is exactly on this line.

s.login(config['smtp_user'], config['smtp_password'])

It has problem in the login proccess....

Revision history for this message
Nhomar - Vauxoo (nhomar) said :
#10

Hello Anup....

Updating my proof...

I connect in the Intranet with thunderbird, all fine, i linked a printscreen:

http://openerp.org.ve/SMTP.png

Success receive emails with this config.

http://openerp.org.ve/SMTPsuccess.png

My config File [[SMTP Configs]]:

email_from = <email address hidden> [example]
smtp_server = mail.heladosgilda.com.ve
smtp_ssl = False
smtp_user = foo [example]
smtp_password = xxxxxx
smtp_port = 25

I really don't understand it should work......

I need remark that i'm using (as in my before messages i showed you.) Debian Lenny and Python 2.5

The error again with the print statement.

SMTP Server....mail.heladosgilda.com.ve 25
I have user and password
sh: lsb_release: command not found
[2010-08-10 11:09:38,014] ERROR:email_send:[01]:
[2010-08-10 11:09:38,015] ERROR:email_send:[02]: Environment Information :
[2010-08-10 11:09:38,015] ERROR:email_send:[03]: System : Linux-2.6.26-2-amd64-x86_64-with-debian-5.0.5
[2010-08-10 11:09:38,015] ERROR:email_send:[04]: OS Name : posix
[2010-08-10 11:09:38,015] ERROR:email_send:[05]: Operating System Release : 2.6.26-2-amd64
[2010-08-10 11:09:38,015] ERROR:email_send:[06]: Operating System Version : #1 SMP Thu Feb 11 00:59:32 UTC 2010
[2010-08-10 11:09:38,016] ERROR:email_send:[07]: Operating System Architecture : 64bit
[2010-08-10 11:09:38,016] ERROR:email_send:[08]: Operating System Locale : es_VE.UTF8
[2010-08-10 11:09:38,016] ERROR:email_send:[09]: Python Version : 2.5.2
[2010-08-10 11:09:38,016] ERROR:email_send:[10]: OpenERP-Server Version : 5.0.12
[2010-08-10 11:09:38,016] ERROR:email_send:[11]: Last revision No. & ID : 2090 <email address hidden>
[2010-08-10 11:09:38,016] ERROR:email_send:[12]:
[2010-08-10 11:09:38,016] ERROR:email_send:[13]:

I'm almost sure something in my config is wrong, but What??. Apart of python-openssl what package is using to send emails...=?????

I have other versions on Ubuntu and send emails very well...... I dont understand.

I printed the user and password too! This is passing well....

The problem is exactly on this line.

s.login(config['smtp_user'], config['smtp_password'])

It has problem in the login proccess....

Revision history for this message
Anup(SerpentCS) (anup-serpent) said :
#11

Hello Nhomar,

    would you please pass smtp_ssl True and then recheck it?

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Nhomar - Vauxoo for more information if necessary.

To post a message you must log in.