where did you configure the smarthost? in the cockpit?
If it is configured in the cockpit you have to put as smarthost 127.0.0.1, the port that you have indicated on stunnel and you have to uncheck “encrypted connections” (stunnel does the encryption).
Keep in mind that the PEC requires that each user has his personal login and password for receiving and sending, so you should follow this guide and leave the smarthost in cockpit empty or use it to send standard mails.
Example:
if your PEC are
pippo@pecsicura.it
pluto@pecsicura.it
paperino@pec.it
minni@pec.it
Which are its different PEC mail providers
in stunnel.conf
[smtp-pecsicura]
accept=127.0.0.1:11125
client=yes
sslVersion=TLSv1.2
connect=smtps.sicurezzapostale.it:465
[smtp-pec]
accept=127.0.0.1:11126
client=yes
sslVersion=TLSv1.2
connect=smtps.pec.aruba.it:465
in 29Relayhost_map put
pecsicura.it 127.0.0.1:11125
pec.it 127.0.0.1:11126
In 30Authentication put
pippo@pecsicura.it PecLoginOfUserPippo:PecPasswordOfUserPippo
pluto@pecsicura.it PecLoginOfUserPluto:PecPasswordOfUserPluto
paperino@pec.it PecLoginOfUserPaperino:PecPasswordOfUserPaperino
minni@pec.it PecLoginOfUserMinni:PecPasswordOfUserMinni
Remember when you make changes to these files to re-run the commands to load each file and service as written below each post
To download mail from external PEC boxes to Nethserver users you can use the cockpit pop3connector which has some limitations
To see the current limitations and an “enhanced” version look here:
Also remember to set the from field of the mail clients hooked to the PEC users with the correct PEC address and don’t leave the one of the Nethserver user or empty because it’s that field that determines with which smarthost the mail must go out.