Verbatim reports wrong hostname when sending emails

VERIFIED FIXED

Status

VERIFIED FIXED
7 years ago
5 years ago

People

(Reporter: Milos, Assigned: jason)

Tracking

Details

(Reporter)

Description

7 years ago
When one registers an account, Verbatim(on sm-verbatim01 node/cluster? on MPT VPN) sends an verification email to user, which can be rejected by some hosting providers as it sends it from hostname sm-verbatim01 which is obviously our internal hostname.

To fix that, we'd need to send emails from localize.mozilla.org(domain that hosts Verbatim app).
Or you need to use a 3rd party service, like Socketlabs. I'm not sure individual boxes should be sending emails anymore.
(Reporter)

Comment 2

7 years ago
Adding Chris to CC for advice on this one.
(Reporter)

Comment 3

7 years ago
Thanks Shyam,

Can we please have that fixed before we figure out how will we deal with this? Anyhow, we're sending mails from that box, and this we can file a separate one if you think we should discuss whether we should be doing that at all.

But in the meantime, it would be nice that email that are actually sent from that box include proper hostname.

Thanks!
Milos and I changed the localsettings.py form:
  DEFAULT_FROM_EMAIL = 'root@sm-verbatim01.mozilla.org'
to:
  DEFAULT_FROM_EMAIL = 'noreply@localize.mozilla.org'

I haven't restarted apache yet (assuming that `apachectl graceful` will just work, will it?)
We tested this and it appears to send out nicely. 

Strangely, I also noticed that a bunch of files in /data/www/localize.mozilla.org/verbatim/pootle_env/Pootle/ where owned by root! I chown'ed everything recursively to be owned by verbatim:apache

Is it ok if I just apache gracefully restart it now?
This a rather weird note-to-self so I have it documented somewhere. To be able run the shell I had to...:

 
[verbatim@sm-verbatim01 Pootle]$ python
Python 2.4.3 (#1, Apr 14 2011, 20:41:59) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import syspath_override
>>> from pootle import settings
>>> import django
>>> from django.core.management import setup_environ
>>> setup_environ(settings)
'/data/www/localize.mozilla.org/verbatim/pootle_env/Pootle-2.1.2/pootle'
>>> from django.conf import settings
>>> settings.EMAIL_HOST
'localhost'
>>> from django.core.mail import send_mail
>>> send_mail('Subject here', 'Here is the message.', 'noreply@localize.mozilla.org', ['peterbe@mozilla.com', 'peterbe@gmail.com', 'mdinic@mozilla.com'], fail_silently=False)

Comment 6

7 years ago
Peter, the standard way to get the right shell with everything loaded is simply:
  ./manage.py shell
If run from the directory containing manage.py this should work and save some of that hassle. Thanks for looking at the mail issue!
(In reply to Friedel Wolff from comment #6)
> Peter, the standard way to get the right shell with everything loaded is
> simply:
>   ./manage.py shell
> If run from the directory containing manage.py this should work and save
> some of that hassle. Thanks for looking at the mail issue!

I know but it doesn't work in this environment. You get errors about lxml not being installed. Trying --plain and --verbosity=2 doesn't help :(
Component: Server Operations → Server Operations: Web Operations
(Assignee)

Updated

7 years ago
Assignee: server-ops → jthomas
(Assignee)

Comment 8

7 years ago
I see that localsettings.py has an updated DEFAULT_FROM_EMAIL but apache has not been restarted. 

Do you want me to install python-lxml so you can test this settings using the shell before restarting apache?
(In reply to Jason Thomas [:jason] from comment #8)
> I see that localsettings.py has an updated DEFAULT_FROM_EMAIL but apache has
> not been restarted. 
> 
That's correct. Still waiting for confirmation from any other stakeholder in this system to confirm the change and the apache restart instructions. So far, no further response :( 

> Do you want me to install python-lxml so you can test this settings using
> the shell before restarting apache?

Nae. That would be like putting a band-aid on the cancer. The fact that shell doesn't load without python-lxml nor giving a useful error is an indicator of something bigger being wrong/broken. For now I can get to the shell in another way (as noted-to-self above) and I have managed to test sending emails.

If you can solve the problem with the shell I think it would be useful but don't worry about it for my sake for now.
(Reporter)

Comment 10

7 years ago
stas, gandalf, any words on this?
The server has now been restarted with the new change. If someone who gets the emails can confirm this then please verify this bug.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(In reply to Peter Bengtsson [:peterbe] from comment #12)
> The server has now been restarted with the new change. If someone who gets
> the emails can confirm this then please verify this bug.

Original report was based on my report on IRC and problem with czech provider Centrum.cz. I have tried it again and now it works. Thanks!
Status: RESOLVED → VERIFIED
QA Contact: cshields → pcvrcek
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
You need to log in before you can comment on or make changes to this bug.