From owner-freebsd-questions@freebsd.org  Sat Sep 11 09:34:15 2021
Return-Path: <owner-freebsd-questions@freebsd.org>
Delivered-To: freebsd-questions@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F4C066ED56
 for <freebsd-questions@mailman.nyi.freebsd.org>;
 Sat, 11 Sep 2021 09:34:15 +0000 (UTC)
 (envelope-from guru@unixarea.de)
Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4H66yG2mt9z4lhf
 for <freebsd-questions@freebsd.org>; Sat, 11 Sep 2021 09:34:14 +0000 (UTC)
 (envelope-from guru@unixarea.de)
Received: from [188.174.52.9] (helo=localhost.unixarea.de)
 by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <guru@unixarea.de>) id 1mOzOf-000548-SF
 for freebsd-questions@freebsd.org; Sat, 11 Sep 2021 11:34:06 +0200
Received: from localhost.my.domain (localhost [127.0.0.1])
 by localhost.unixarea.de (8.16.1/8.14.9) with ESMTPS id 18B9Y3w8011880
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO)
 for <freebsd-questions@freebsd.org>; Sat, 11 Sep 2021 11:34:04 +0200 (CEST)
 (envelope-from guru@unixarea.de)
Received: (from guru@localhost)
 by localhost.my.domain (8.16.1/8.14.9/Submit) id 18B9Y3Gi011879
 for freebsd-questions@freebsd.org; Sat, 11 Sep 2021 11:34:03 +0200 (CEST)
 (envelope-from guru@unixarea.de)
X-Authentication-Warning: localhost.my.domain: guru set sender to
 guru@unixarea.de using -f
Date: Sat, 11 Sep 2021 11:34:03 +0200
From: Matthias Apitz <guru@unixarea.de>
To: freebsd-questions@freebsd.org
Subject: Re: monitoring incoming mailbox in console mode
Message-ID: <YTx4C7zsVOFCSIGo@c720-r368166>
Reply-To: Matthias Apitz <guru@unixarea.de>
Mail-Followup-To: freebsd-questions@freebsd.org
References: <20210908124536.GA17@sh4-5.1blu.de>
 <20210908203244.57309565.freebsd@edvax.de>
 <YTmuVMh0FJ3zTpu8@c720-r368166>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <YTmuVMh0FJ3zTpu8@c720-r368166>
X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64)
X-message-flag: Mails containing HTML will not be read!  Please send only
 plain text.
X-Con-Id: 51246
X-Con-U: 0-guru
X-Originating-IP: 188.174.52.9
X-Rspamd-Queue-Id: 4H66yG2mt9z4lhf
X-Spamd-Bar: -
Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none;
 spf=none (mx1.freebsd.org: domain of guru@unixarea.de has no SPF policy when
 checking 178.254.4.101) smtp.mailfrom=guru@unixarea.de
X-Spamd-Result: default: False [-1.23 / 15.00];
 HAS_REPLYTO(0.00)[guru@unixarea.de];
 RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XOIP(0.00)[]; HAS_XAW(0.00)[];
 TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3];
 NEURAL_HAM_SHORT(-0.63)[-0.630];
 RECEIVED_SPAMHAUS_PBL(0.00)[188.174.52.9:received];
 FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[];
 ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE];
 MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000]; REPLYTO_EQ_FROM(0.00)[];
 FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain];
 PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org];
 AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1];
 DMARC_NA(0.00)[unixarea.de]; R_SPF_NA(0.00)[no SPF record];
 RWL_MAILSPIKE_POSSIBLE(0.00)[178.254.4.101:from];
 MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[];
 MAILMAN_DEST(0.00)[freebsd-questions]
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Sep 2021 09:34:15 -0000

El día jueves, septiembre 09, 2021 a las 08:48:52a. m. +0200, Matthias Apitz escribió:

> 
> Thanks for the hints about biff(1). I wasn't aware of it, even if I was
> used to use xbiff in the past.
> 
> But, biff(1) does not do anything. I run
> 
> $ truss -o biff.tr -f biff b
> 
> and attached is the output of biff.tr. Any ideas?

I've had a glance through the source in /usr/src/usr.bin/biff/biff.c and
it only tweaks on some bits in the perms of the tty you're login on:

	...
	switch (argv[0][0]) {
	case 'n':
		if (chmod(name, sb.st_mode & ~(S_IXUSR | S_IXGRP)) < 0)
			err(2, "%s", name);
		break;
	case 'y':
		if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXUSR)
		    < 0)
			err(2, "%s", name);
		break;
	case 'b':
		if (chmod(name, (sb.st_mode & ~(S_IXUSR | S_IXGRP)) | S_IXGRP)
		    < 0)
			err(2, "%s", name);
		break;
	default:
		usage();
	}
	return (sb.st_mode & (S_IXUSR | S_IXGRP) ? 0 : 1);
	...

and then exits. The rest should depend on the login shell and its env
var MAIL and/or MAIL_PATH.

Said that, it does not do what I want because in many times my netbook
is only booted, receives mails to /var/mail/guru and I'm only connected
via SSH to it.

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
August 13, 1961: Better a wall than a war. And, while the GDR was still existing,
no German troups and bombs have been killed in Yugoslavia, Afghanistan, Afrika...