Sending email with postfix

Hello everyone,

I would like to setting up postfix in order to send email for nextcloud activity. However, I have seen dozens of tutorials, all differents, and I do not succeed in correctly setting postfix and nextcloud.
Do you have links to tutorials or idea to do it ?

Any help would be appreciated, thank you.

Hi @hbove Do you know the excellent search function of this forum :wink:

@hbove – Can you explain to me your setup? Like are you using a linux host or docker images? Where do you plan to install postfix? I have a working postfix server setup within Arch linux. It wasn’t all that difficult however I just use it as a mail transfer agent for outgoing mail. Do you need more functionality?

And yes its possible to use either ports 465 or port 589 depending on how you setup your postfix milter.

Yeah I know it and I aldready checked on this tutorial but it still does not work. It is not a very usefull answer :sweat_smile:

Thank you for your answer.

I am working on a Raspberry Pi 4 64 bits with Ubuntu Server 20.04 LTS. I plan to install postfix on the same device as nextcloud.
I would like to send emails to my users. I am able to send them with a public smtp (like google) but I would rather use mine. It is entertaining and I prefer to be self dependent.

If you are using postfix as the MTA (mail transfer agent), usually you need to forward these emails through another smtp server such as gmail, or some other service like mailjet, mailgun, etc. What service are you planning on using? If you send directly from your server, most likely your email will be rejected.

If you just want to send out notification mails, take a look at ssmtp (or similar services).

You can reduce functionality of full mail servers, but there is a risk of mis-configuration and then you have a open relay. It’s easier and more secure to use a program that was just made for that.

1 Like

Indeed it seems to be less complicated and I only need that.

I tried to set up it however I have an error : Unable to locate mailhub, Cannot open mailhub:25.

Here is my ssmtp.conf :

And here is my revaliases file :

Do you have any idea what to do ?

I think you need to correct the syntax of this parameter :wink:

Sorry for the typo, my bad, I have the correct version running in my server.