0

I am using my mail server to send mail using Django. When I try to use the send_mail function, I am met with an authentication error. I know that it is not the password, because I can use it to login to my mail account.

How My Mail Server is Setup

I am running Ubuntu 16.0.4 with Nginx and Gunicorn for my Django application. I have installed Roundcube, postfix and dovecot.

How Do I add Users to Roundcube?

For me, the only way I know how to do this is by just adding a new user from the CLI using adduser <user> and from there, logging into Roundcube so that my new user is added to the Roundcube database, and I have an accessible account on Roundcube.

What I Suspect to be The Issue

Since I am creating the users for Roundcube directly from the CLI and they are full Unix users, I can only login to Roundcube using their actual username, and not username@domain.tld. I suspect that Django is trying to authenticate with user@domain.tld rather than user and that is what is causing the issue.

How Can I Fix This?

I am not sure, hence why I am here. I have done my research and cannot find the proper information on making it so that I can login to Roundcube using user@domain.tld instead of just user, but I don't think this will solve my issue.

I have also done research and cannot find an answer on how to create just a mail user, and not a full-blown Unix user. I was thinking this might be my best option. Although, I could be completely wrong.

PythonReactor
  • 483
  • 4
  • 18
  • Why do you suspect that Django is trying to authenticate with `user@domain.tld`? What are you using for `EMAIL_HOST_USER`? Have you tried `EMAIL_HOST_USER = 'user'` instead of `EMAIL_HOST_USER = 'user@dimain.tld'` – Alasdair Jun 13 '18 at 12:39
  • @Alasdair , silly enough, i have not tried that. It is because I am using user@domain.tld because I thought I needed it. Let me try user by itself – PythonReactor Jun 13 '18 at 14:56
  • 1
    @Alasdair so I changed my EMAIL_HOST_USER to just user and it worked. I feel silly, yet happy that I learned something new! Thanks :) – PythonReactor Jun 13 '18 at 18:22

0 Answers0