OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: procsik on February 01, 2018, 04:44:53 pm

Title: [SOLVED] Postfix Import
Post by: procsik on February 01, 2018, 04:44:53 pm
Hello!

Whether there is a possibility to import users into lists of recipients/senders via web-gui? Or will such functionality appear?

thx!
Title: Re: Postfix Import
Post by: bartjsmit on February 01, 2018, 04:49:41 pm
If your postfix users are in a Radius or LDAP directory, you can use those as authentication sources in OPNsense.

Bart...
Title: Re: Postfix Import
Post by: fabian on February 01, 2018, 05:49:21 pm
Whether there is a possibility to import users into lists of recipients/senders via web-gui? Or will such functionality appear?

Postfix has an API. Use can use that for bulk imports.
Title: Re: Postfix Import
Post by: procsik on February 01, 2018, 11:16:27 pm
Postfix has an API. Use can use that for bulk imports.
I use postfix as MTA. For example, I do not want multiple users to receive emails from the outside world. For this, I would write the corresponding entries in the file /usr/local/etc/postfix/recipient_access. But I'm afraid that with the next updates and upgrades, my information will not be preserved. Otherwise, I'll have to add everyone separately through the web-gui.

If your postfix users are in a Radius or LDAP directory, you can use those as authentication sources in OPNsense.
Yes, I can use an authorization server with LDAP, but how it will help me add a lot of users to the recipient_access file via the web interface? Or I have to create all Internet users so that they can authenticate to my gateway? As far as I know, the smtpd_recipient_restrictions = check_recipient_access parameter is responsible for checking incoming mail relative to the recipient.

Still, I will have to manually add users until there is a System:Access:Server integration in the installer plugins, if that happens.
Title: Re: Postfix Import
Post by: mimugmail on February 02, 2018, 06:04:22 am
You should get familiar with the API to do this:

https://forum.opnsense.org/index.php?topic=6116.msg25681#msg25681
Title: Re: Postfix Import
Post by: procsik on February 02, 2018, 09:56:57 am
Postfix has an API. Use can use that for bulk imports.

You should get familiar with the API to do this:

https://forum.opnsense.org/index.php?topic=6116.msg25681#msg25681

Thanks for the help. It works:

Code: [Select]
curl -X POST -d '{"recipient":{"enabled":"1","address":"<email>","action":"OK"}}' -H "Content-Type: application/json" -k -u "<key>":"<secret>" http://<ipaddr>/api/postfix/recipient/addRecipient