Update: since some of my ISP's customer don't properly protect their machines, the ISP had to block ports 25 and 53 since last November.
What is still surprising, though, is that fvdw firmware acts as an email client, and thus shouldn't be subject to any port block. I can send emails without a problem from my computer, why not the NAS? Can it detect that I am using a dynamic IP range and refuse the connection on that basis? Because the issue is not from the SMTP: computers can send emails to the SMTP.
Strangely it also works using a fictive FQDN.
From RFC2821 4.1.1.1, I read the following:
In situations in which the
SMTP client system does not have a meaningful domain name (e.g., when
its address is dynamically allocated and no reverse mapping record is
available), the client SHOULD send an address literal (see section
4.1.3), optionally followed by information that will help to identify
the client system
And in the 4.1.3 section:
4.1.3 Address Literals
Sometimes a host is not known to the domain name system and
communication (and, in particular, communication to report and repair
the error) is blocked. To bypass this barrier a special literal form
of the address is allowed as an alternative to a domain name. For
IPv4 addresses, this form uses four small decimal integers separated
by dots and enclosed by brackets such as [123.255.37.2]
The question would be, is icanhazip.com raw IP address returned properly enclosed in brackets? As I understand it, it will be refused if no brackets are provided. So I used my external IP put in brackets, and
it works! The problem is that the $ippub variable is not properly enclosed as the standards require. On receiving the email, though, the email is marked as spam with a very high score of 8.3, according to SpamAssassin. So although it works when the variable is corrected, the correct way to do it on common home connections would be to use a DDNS name.