FreeBSD-14.1-RELEASE send email not working

I can't send an email from FreeBDD 14
I downloaded FreeBSD-14.1-RELEASE-amd64-zfs to check and it doesn't work to send email.
Code:
uname -a

FreeBSD freebsd 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64

echo "Mesaj de test" | mail -s "Subiect de test" bizpenet@yahoo.com
echo "Mesaj de test" | mail -s "Subiect de test" adcsytes@gmail.com

tail -f /var/log/maillog

Nov 22 02:54:07 freebsd dma[7214.1fce4e048000][773]: connect to mta6.am0.yahoodns.net [98.136.96.75] failed: Operation timed out
Nov 22 02:54:07 freebsd dma[7214.1fce4e048000][773]: trying remote delivery to mta6.am0.yahoodns.net [98.136.96.91] pref 1
Nov 22 02:55:22 freebsd dma[7214.1fce4e048000][773]: connect to mta6.am0.yahoodns.net [98.136.96.91] failed: Operation timed out
Nov 22 02:55:22 freebsd dma[7214.1fce4e048000][773]: trying remote delivery to mta7.am0.yahoodns.net [67.195.204.72] pref 1
Nov 22 02:56:34 freebsd dma[720f.21a78da48000][769]: <adcsytes@gmail.com> trying delivery
Nov 22 02:56:34 freebsd dma[720f.21a78da48000][769]: trying remote delivery to gmail-smtp-in.l.google.com [2a00:1450:400c:c04::1a] pref 5
Nov 22 02:56:34 freebsd dma[720f.21a78da48000][769]: connect to gmail-smtp-in.l.google.com [2a00:1450:400c:c04::1a] failed: No route to host
Nov 22 02:56:34 freebsd dma[720f.21a78da48000][769]: trying remote delivery to gmail-smtp-in.l.google.com [74.125.71.26] pref 5
Nov 22 02:56:37 freebsd dma[7214.1fce4e048000][773]: connect to mta7.am0.yahoodns.net [67.195.204.72] failed: Operation timed out
Nov 22 02:56:37 freebsd dma[7214.1fce4e048000][773]: trying remote delivery to mta7.am0.yahoodns.net [67.195.228.109] pref 1
I see that it insists on using ipv6 even though the isp only offers me ipv4I have an internet connection and the name is resolved only on ipv4.
My rc.conf is
Code:
hostname="freebsd"
zfs_enable="YES"
zpool_reguid="zroot"
zpool_upgrade="zroot"
#ifconfig_DEFAULT="DHCP inet6 accept_rtadv"
ipv6_network_interfaces="none"                 # Default is auto
ipv6_enable="NO"                                # Default is NO
ifconfig_DEFAULT="inet 192.168.100.100 netmask 0xffffff00 broadcast 192.168.100.255"
defaultrouter="192.168.100.1"
growfs_enable="YES"
sshd_enable="YES"
Thanks for any ideas that will work
 
Not sure if you've had it working on another OS but it's also not uncommon for ISPs to block port 25 by default on end user connections.
 
Well, something is blocking the connection attempts somewhere between you and the internet. Are you sure 192.168.100.0/24 is the correct range? What's connecting you further upstream to the internet? There has to be some form of NAT too. Or is this a company network? Maybe internal systems simply don't have a direct connection to the outside world, I certainly would never allow this.
 
My isp only blocks ports 23, 25, 53, 445, 123, 135, 139, 161, 1900

Code:
ifconfig em0
em0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
  options=48505bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,LRO,VLAN_HWFILTER,VLAN_HWTSO,HWSTATS,MEXTPG>
        ether 08:00:27:6e:35:0a
        inet 192.168.100.100 netmask 0xffffff00 broadcast 192.168.100.255
        inet6 fe80::a00:27ff:fe6e:350a%em0 prefixlen 64 scopeid 0x1
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Code:
ping6 google.com
ping6: UDP connect: No route to host

Code:
telnet smtp.gmail.com 587
Trying 64.233.166.108...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP ffacd0b85a97d-3825fb27196sm2012613f8f.55 - gsmtp
telnet> quit
Connection closed.

Code:
traceroute smtp.gmail.com
traceroute to smtp.gmail.com (74.125.206.108), 64 hops max, 40 byte packets
 1  192.168.100.1 (192.168.100.1)  2.226 ms  1.330 ms  2.376 ms
 2  10.0.33.51 (10.0.33.51)  3.428 ms  3.872 ms  3.030 ms
 3  10.32.9.97 (10.32.9.97)  3.593 ms  3.812 ms  3.272 ms
 4  10.220.136.28 (10.220.136.28)  14.876 ms  17.386 ms
    10.220.140.200 (10.220.140.200)  10.085 ms
 5  10.220.153.20 (10.220.153.20)  19.406 ms
    10.220.208.244 (10.220.208.244)  15.756 ms  16.318 ms
 6  72.14.216.212 (72.14.216.212)  21.273 ms
    209.85.168.182 (209.85.168.182)  21.398 ms  23.929 ms
 7  172.253.65.251 (172.253.65.251)  20.343 ms  17.109 ms *
 8  142.251.228.30 (142.251.228.30)  15.824 ms
    142.251.65.216 (142.251.65.216)  22.334 ms
    192.178.72.180 (192.178.72.180)  15.431 ms
 9  * 192.178.81.126 (192.178.81.126)  17.161 ms
    142.251.53.57 (142.251.53.57)  32.869 ms
10  142.251.53.57 (142.251.53.57)  38.324 ms
    172.253.50.50 (172.253.50.50)  48.874 ms *
11  192.178.75.170 (192.178.75.170)  49.503 ms  54.031 ms
    142.251.68.157 (142.251.68.157)  39.832 ms
12  216.239.40.11 (216.239.40.11)  53.389 ms  60.209 ms  47.548 ms
13  216.239.43.113 (216.239.43.113)  49.952 ms * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  wk-in-f108.1e100.net (74.125.206.108)  49.502 ms * *

192.168.100.100 is the local virtual machine with freebsd, virtualbox is set BrighetAdapter
192.168.100.1 is a Mercusys MR50G router
 
My isp only blocks ports 23, 25, 53, 445, 123, 135, 139, 161, 1900
Incoming? Or outgoing too? Mail transfers between MTAs typically works on port 25. dma(8) does too, by default at least.

Code:
# Use this SMTP port.  Most users will be fine with the default (25)
#PORT 25
 
If the ISP is blocking port 25 then you are not going to be able to do direct email delivery. You will need to use some sort of relay that allows you to submit the messages over port 587 instead.

When setting up a mail client for an ISP's email account, they will usually allow you to use port 587 or 25 as the smtp port for outgoing messages. Arguably, 587 is actually the "correct" port for this use case. However, the vast majority of "inbound" smtp servers on the Internet (i.e the ones listed in MX records), will not accept port 587. Actual smtp delivery is done over port 25.

My isp only blocks ports 23, 25, 53, 445, 123, 135, 139, 161, 1900
That's actually quite a few ports to block, although most are for obvious reasons. 53 is a bit much as it stops you using any 3rd party DNS services. I'm wondering if some of these, such as 53 & 123, are blocked inbound only? (having said that it's entirely possible they're also blocked for DDoS mitigation)

Just to address some of the other points in your last message.

  • ping6 is of no use if you don't have ipv6 support
  • traceroute is often a waste of time as it doesn't really tell you much in this case and is often blocked further down the chain, as in your output.
  • connecting to Gmail's outbound smtp server on 587 at least confirms you have no problem getting to the Internet, but isn't going to help much with delivering email over smtp. It only shows that you can successfully connect to their servers that allow Gmail customers to send emails out from a gmail address to other people. smtp.gmail.com is a completely different service to the smtp servers that actually accept messages being delivered from a 3rd party to Gmail recipients. As in your first message, emails being delivered to gmail go via gmail-smtp-in.l.google.com, which only accepts port 25.
 
Back
Top