How to set up emails?

Hi!

I have my own email server (docker-mailserver). It’s a classic email server, it’s not relaying to another server or something fancy. It works fine (I can send and receive emails).

However, I can’t figure out how to set it up in NextCloud. When I try to send the test email it says that the “authentication failed”. I’ve tried the same credentials in Thunderbird and it works.

Maybe the credentials that are asked are not the one of a regular user, but credentials to use the server as a relay. I don’t know, I’m new to email servers. If this is the case, how can I configure Postfix in that way? Because I see a lot of tutorials to make Postfix use a relay but not the other way around.

Thanks for your help!

Hi Cl00e9ment, and welcome to the forum!

It depends what you mean by setting up email, I think. The simplest way would be something like:

  • Send mode: SMTP
  • Encryption: None
  • From address: whatever@yourdomain.tld
  • Authentication method: None

…and leave “server address” and “port” empty; I think this (above) should be enough to send notification emails if postfix is installed on the server.

But if you’re running a mail server via docker (i.e. postfix etc is running inside a container) perhaps you need to do a bit more(?) I’m not sure about this; I run a mail server myself - using postfix, dovecot, spamassassin and roundcube - but it’s not containerised.

The mail server and NextCloud are on 2 distinct machines. I think that the NextCloud configuration that I have currently is correct: NextCloud can connect to the mail server. The problem is that it fails authentication. So I was wondering 2 things:

  • Does NextCloud use the mail server like a regular user or does it use it as a relay?
  • Does NextCloud has to connect to the mail server with a regular user or is there something a bit special to set up?

The mail server and NextCloud are on 2 distinct machines.

(This is different: in my case, the mail server and the Nextcloud instance are on the same server).

  • Does NextCloud use the mail server like a regular user or it does it use it as a relay?
  • Does NextCloud has to connect to the mail server with a regular user or is there something a bit special to set up?

No, I don’t believe Nextcloud uses it as a relay.

But I’m not sure what you mean by “regular user” here(?) Do you mean: “as distinct from a virtual[1] user”…?

[1] i.e. In my case, there’s a dedicated “virtual mailer” account, and I would describe this as “a regular user”, because it’s a normal user account in Linux. But the mail users themselves aren’t “regular users” in this sense: they don’t have accounts in Linux, because they don’t need to (e.g.) SSH in to the server; they exist primarily as entities in a database. Having said that, “regular users” (like www-data, fail2ban etc.) can also send mail, of course.

Yes, by a regular user I meant an email user, but not necessarily a Linux user. And like I said in my original post, when I try to use this user in ThunderBird, it works fine.

Nevermind, I reset the password and filled again all the fields and now it works. I don’t really known what I did wrong the first time. Sorry for the inconvenience and thanks for your help!

I meant an email user, but not necessarily a Linux user.

Ah, OK; understood :slight_smile:

I reset the password and filled again all the fields and now it works

Good - I’m glad to hear it!

Sorry for the inconvenience and thanks for your help!

I’m not sure I was much help, TBH …but you’re welcome nonetheless! :slight_smile:

1 Like