Mailing Configuration with Django SMTP Backend

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
calvinsug
Posts: 13
Joined: Mon Sep 30, 2019 5:29 am

Mailing Configuration with Django SMTP Backend

Post by calvinsug »

Hi guys, i'm a new user for Python Django and Mayan-edms.

Basically, i tried to test the mailing system. First, i added a new mailing profile from System -> Setup -> Mailing Profiles. Second, i choose django SMTP backend. Third, here is what i set up in this form:
https://drive.google.com/open?id=1TfcNL ... 417pfp7gIh
https://drive.google.com/open?id=1yj_Oj ... VSaGWsqAxj

from that configuration, i click the test button in this url: http://localhost/#/mailer/user_mailers/
and after i filled recipient's email address, the response is Internal Server Error.
What am i missing here to activate the mail system? What i suspicious here are the username and password for the SMTP server, but i don't think i have the username or password for the SMTP server, so i just filled it blank.

nb: I'm running mayan-edms using docker-compose up command in docker folder for the LAN and i just plan to using it in my Local Area Network.

===UPDATED====
When i see the logs from my terminal which running the docker compose-up
i see this logs:
[2019-10-04 15:29:39,634: ERROR/MainProcess] Task mayan.apps.mailer.tasks.task_send_document[3058e0fd-aab4-42bf-aca4-4a25d4b2e133] raised unexpected: error(99, 'Cannot assign requested address')

the email is correct, just confused what does it mean?
Last edited by calvinsug on Tue Oct 08, 2019 2:38 am, edited 1 time in total.

pixiesfr
Posts: 4
Joined: Wed Oct 02, 2019 10:06 pm

Re: Mailing Configuration with Django SMTP Backend

Post by pixiesfr »

hi,

you local smtp is working ?
telnet 127.0.0.1 25
What software you use on local ?
any mailer log ?

thanks

calvinsug
Posts: 13
Joined: Mon Sep 30, 2019 5:29 am

Re: Mailing Configuration with Django SMTP Backend

Post by calvinsug »

how do i know my local smtp is working?

btw i have updated the configuration to user gmail settings:

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'your-username@gmail.com'
EMAIL_HOST_PASSWORD = 'your-password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True


with this configuration, the error has changes to:
SMTPAuthenticationError: (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials z13sm14016318pfg.172 - gsmtp')

This is weird because the credentials is correct and i have turn on the 'Allow less secure apps'
https://www.google.com/settings/security/lesssecureapps

based on this advise: https://stackoverflow.com/questions/165 ... gmail-smtp

calvinsug
Posts: 13
Joined: Mon Sep 30, 2019 5:29 am

Re: Mailing Configuration with Django SMTP Backend

Post by calvinsug »

======SOLVED======

The email has been sent successfully when i change the username (my other email address). Very weird though the password is same, but nevermind, the email has been successfully sent,

Joaogomes
Posts: 1
Joined: Wed May 20, 2020 1:41 pm

Re: Mailing Configuration with Django SMTP Backend

Post by Joaogomes »

Hi,

I have installed Mayan EDMS in my ubuntu server using docker container. Software is great but I haven't been able to send emails. Could you explain what you have done in more detail to make it work?

kozmi
Posts: 11
Joined: Wed May 13, 2020 12:04 am

Re: Mailing Configuration with Django SMTP Backend

Post by kozmi »

Hello,
you have to go to Settings and Mail profile.
If you like to use the gmail as SMTP server first you have to go to your gmail account and set "Less secure app access" from On to Off.
Use your credentials and secure protocols as per google settings(search for google smtp port).
In case you can't configure it I can assist you remotely if you like.

Regards
kozmi

Post Reply