[NEW]improving smtpclient module behaviour
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
Hi all.
Installing smtpclient module in a new OpenERP production environment under FreeBSD OS, it has been detected an error in "_check_queue" cron function. This function collects not-sent mails from "email.
1.- You can have Internet connection, but your e-mail server may be down.
2.- Used parameters in "ping" call aren't available under FreeBSD ("W" instead of "w", etc)
3.- With a server under a jail environment, this "ping" call doesn't retrieve any results.
4.- Perhaps your openerp implementation is inside an intranet, with no internet access at all.
5.- Even with Internet access, perhaps a firewall is blocking icmp traffic, but not tcp traffic for smtp requests.
To prevent this, a patch has been attached for "smtpclient.py" file. This patch overrides various functions' behaviour in the way that is described here:
1.- "open_connection" : Now it returns a boolean value -instead of "True"- which will turn into "False" when server is down (i.e. when raises a "socket.gaierror" exception). This will be useful in "_send_emails" function to check this case.
2.- "_send_emails": When "open_connection" function is called and it returns "False", this function will return "False" as well.
3.- "test_verify_
This is a first approach, but it has been tested and it's functional. Anyway, feedback would be appreciated.
Changed in openobject-addons: | |
importance: | Undecided → Wishlist |
milestone: | none → 6.0 |
status: | New → Confirmed |
We have no plan to improve this module as it's not part of the addons modules.
The email_temaplte module is a better alternative.