cli "mail" program no longer working after update.

Status
Not open for further replies.

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Hi,

I have a webpage running in a jail in which there is a .php form that allows people to send contact details via email. That has stopped working since a FreeNAS update in Jan. I tried manually sending mail from a shell in both the webpage jail and in FreeNAS, and neither message is received by the recipient.

My mail send server is gmail and that works ok as I still get my server emails from security and SMART outputs. .. and the mail test works ...

Can someone help me work out what could have changed?

EDIT: Actually mail sent from FreeNAS shell works, it is just the webpage jail that mail has stopped working ....
(IE.: echo "some message" | mail -s "some subject" somemail@address )
 
Last edited by a moderator:

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Can anyone help, this is very frustrating .. :(
 

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Hi,
I don't get any error in /var/log/messages just after executing the "mail" command. The only errors I see in there regarding mail is the likes of:
Code:
Mar 14 03:01:34 webpage_2 sm-mta[47859]: w2DE1Y1J047856: SYSERR(root): hash map "Alias0": missing map file /etc/mail/aliases.db: No such file or directory

Don't know if it is related ..
(...there is a /etc/mail/aliases file, just not an aliases.db ....)

By the way, I presume you mean /var/log/messages in the Jail.
 

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
No, still havn't resolved this. I am surprised this has not happened to anyone else ..
Maybe some FreeNAS Guru can tell us how the mail passes through the Jail so we can work out what has failed ..

(NOTE: Network connectivity from the jail is just fine)
 

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Still not working. Surely there is a developer that can comment on this, or do I file a bug report.

Verbose output from mail in jail is as follows:

Code:
root@webpage_nginx:/ # echo "testing" | mail -v -s "test" mymail@gmail.com
mymail@gmail.com... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.15.2/8.15.2; Tue, 3 Apr 2018 15:25:30 +1200 (NZST)
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=46
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<mymail@gmail.com>
>>> DATA
250 2.1.5 <mymail@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 w333PUed023463 Message accepted for delivery
mymail@gmail.com... Sent (w333PUed023463 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection

 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
there is a /etc/mail/aliases file, just not an aliases.db
This particular problem can be fixed: from the shell, run newaliases.

Without an error, it is difficult to say what is causing the other problem.
 

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Thanks, I now have an aliases.db file and those messages have stopped. However, Mail still does not work from the Jail.
I wish I knew how to get more information on the issue ... this silent failing is frustrating ..

I just had a good look in /var/log/maillog and it does show a verify=fail error, but that is all ... (last line below)

Code:
Apr  4 07:01:45 webpage_nginx sendmail[77610]: w33J1j6b077610: from=root, size=48, class=0, nrcpts=1, msgid=<201804031901.w33J1j6b077610@localhost.localdomain>, relay=root@localhost
Apr  4 07:01:45 webpage_nginx sm-mta[77611]: STARTTLS=server, relay=localhost [127.0.0.1], version=TLSv1.2, verify=NO, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Apr  4 07:01:45 webpage_nginx sendmail[77610]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1.2, verify=FAIL, cipher=DHE-RSA-AES256-GCM-SHA384, bits=256/256
Apr  4 07:01:45 webpage_nginx sm-mta[77611]: w33J1jWk077611: from=<root@localhost.localdomain>, size=388, class=0, nrcpts=1, msgid=<201804031901.w33J1j6b077610@localhost.localdomain>, proto=ESMTPS, daemon=IPv4, relay=localhost [127.0.0.1]
Apr  4 07:01:45 webpage_nginx sendmail[77610]: w33J1j6b077610: to=bmentink@gmail.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30048, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (w33J1jWk077611 Message accepted for delivery)
Apr  4 07:01:47 webpage_nginx sm-mta[77613]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128

 
Last edited:

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Update:



I have even tried creating an iocage jail, and mail does not work from there either ...
My /etc/rc.conf is:
Code:
host_hostname="test"
cron_flags="$cron_flags -J 15"

# Disable Sendmail by default
sendmail_enable="YES"
sendmail_submit_enable="YES"
sendmail_outbound_enable="YES"
sendmail_msp_queue_enable="YES"

# Run secure syslog
syslogd_flags="-c -ss"

# Enable IPv6
# ipv6_activate_all_interfaces="YES"

nginx_enable="YES"
php_fpm_enable="YES"

 

Bernard Mentink

Contributor
Joined
Apr 2, 2016
Messages
193
Looking into this further:

My iocage jail is called "test" and once inside a console I ran the mail command and found this bounced email report ..
Code:
  ----- The following addresses had permanent fatal errors -----
test
	(reason: 550 5.1.1 <test@localhost.my.domain>... User unknown)
	(expanded from: test)

   ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <test@localhost.my.domain>... User unknown
550 5.1.1 test... User unknown

--w341JqB0099769.1522804792/localhost.my.domain
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.my.domain
Arrival-Date: Wed, 4 Apr 2018 13:19:52 +1200 (NZST)

Final-Recipient: RFC822; test@localhost.my.domain
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 <test@localhost.my.domain>... User unknown
Last-Attempt-Date: Wed, 4 Apr 2018 13:19:52 +1200 (NZST)

--w341JqB0099769.1522804792/localhost.my.domain
Content-Type: message/rfc822

Return-Path: <root>
Received: (from root@localhost)
		by localhost.my.domain (8.15.2/8.15.2/Submit) id w341JqAx099769;
		Wed, 4 Apr 2018 13:19:52 +1200 (NZST)
		(envelope-from root)
Date: Wed, 4 Apr 2018 13:19:52 +1200 (NZST)
From: Charlie Root <root>
Message-Id: <201804040119.w341JqAx099769@localhost.my.domain>

asdasdasd

--w341JqB0099769.1522804792/localhost.my.domain--



The key being "<test@localhost.my.domain>... User unknown"
What should my domain be for the jail? Should it be the same as for FreeNAS? Do I have to create another user instead of root .... I did not have to do that with the old jails ..
 
Status
Not open for further replies.
Top