From nobody Fri Jan 9 20:17:26 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dntNl3fTbz6B9fM for ; Fri, 09 Jan 2026 20:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dntNk6n8Mz3KcW for ; Fri, 09 Jan 2026 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767989847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvl1eU+0I7bFQiELZim5tqyD4eK4bwPg6qNaAK2lMqg=; b=FaxHizVMbdr4ZHEeWzakX93TX0Jw1zF/zwRSSCu7Z/Q05zDmOv28+vJyNx/iNOFX6gumlH nWh0jS5FHt4OG52O76rHejRLSd32Yev66I5s1dqjpI5/2lN23OPZQD0aYNXOpgLmCVKtMH 8NWow3rUqpg/LpzKm24ukQvTyV+WbHuDGZikhrq4qMLHGv+p4BiiFqC3j0bKtbz0fHGrsv PlcRsOfP3urMq9Oo0Opy3haV4yeSoJkjiEvqr05ud5hxveRoREb6ysUtIMDiJhQ66fPr6k LveSaJMSOd1lox3rXfyTWTP1Pi/ViSQ8VBqwcYeaKoPHBv93Kf2CktuAlqCriQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767989847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xvl1eU+0I7bFQiELZim5tqyD4eK4bwPg6qNaAK2lMqg=; b=SUlNaS20MsKF8wVtwkivanqV+3Y2VgoQej6YdDEk8hl+GczcX2YLWX95yAmF1h9JgzpkfC ifXTRSOHENxCfs7tlsAUq0Ty+NRNMJpMVVeIei0XnqWevFSPJJuVUzTgMxRwuQAMHoF/rg mEQBgQ8kWifHeO0Di186JaTpgYA+utyClb70c1SH4O3RYC1Jm7He6NgFWnEX7Gihs9KQMK FKtFW80A+O9kKCgUqqhU35wydI5Jw9ono4DHa/wJyT80HS2+QhFR1H2rqnLm5iJjT5n9T1 f6gpW+nOzvlIGzB1ocKkEYn6WrXVi7PerlsWRDCZXWLSfUdPfpEq27ppqgXgcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767989847; a=rsa-sha256; cv=none; b=VVKVwv9g1yfRQ6GLLM/J0cEm8L0ntCP3i14Orfh+FSQPSA5ImTM8CrA9CZaPexIcKhfs5x rSvfvKa6p9tcXaIQgHouHOdEnES4xv+xz0FwQgNmkBmsjbpzsoOuMheqEJuAofa3tc3CQj A2Fv/qx3LbQJx+d322FhSN4lyMzY5OqMxY71nOaOqPJxA1qT3d8rBQuzVh5za/y0Dluue8 If43JvIlwrEzcQxFzUvn2VbPadjZRJBF2OaRP1q3h5TA/+8L04fPNwWysmX86L6stesJhj Bm8fFjRBeRxzzL5J4BwxQVNM0r7sL1q6kxGROso+k5LUUKJj3Yg9Yqu9i+QYFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dntNk64nqz7bc for ; Fri, 09 Jan 2026 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8983 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Jan 2026 20:17:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Lakshmikanth Ayyadevara From: Warner Losh Subject: git: 3e72ce4081f4 - main - Cron: add CC and BCC option for crontab variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e72ce4081f4a8d6b1d879dae201d569ce450261 Auto-Submitted: auto-generated Date: Fri, 09 Jan 2026 20:17:26 +0000 Message-Id: <69616256.8983.4372cc3b@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e72ce4081f4a8d6b1d879dae201d569ce450261 commit 3e72ce4081f4a8d6b1d879dae201d569ce450261 Author: Lakshmikanth Ayyadevara AuthorDate: 2025-10-02 16:08:09 +0000 Commit: Warner Losh CommitDate: 2026-01-09 20:17:12 +0000 Cron: add CC and BCC option for crontab variables Signed-off-by: Lakshmikanth Ayyadevara Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1865 --- usr.sbin/cron/cron/do_command.c | 6 +++++- usr.sbin/cron/crontab/crontab.5 | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index 43b3269d3087..58eed70c1be6 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -82,7 +82,7 @@ child_process(entry *e, user *u) { int stdin_pipe[2], stdout_pipe[2]; char *input_data; - const char *usernm, *mailto, *mailfrom; + const char *usernm, *mailto, *mailfrom, *mailcc, *mailbcc; PID_T jobpid, stdinjob, mailpid; FILE *mail; int bytes = 1; @@ -104,6 +104,8 @@ child_process(entry *e, user *u) */ usernm = env_get("LOGNAME", e->envp); mailto = env_get("MAILTO", e->envp); + mailcc = env_get("MAILCC", e->envp); + mailbcc = env_get("MAILBCC", e->envp); mailfrom = env_get("MAILFROM", e->envp); #ifdef PAM @@ -547,6 +549,8 @@ child_process(entry *e, user *u) fprintf(mail, "From: Cron Daemon <%s>\n", mailfrom); fprintf(mail, "To: %s\n", mailto); + fprintf(mail, "CC: %s\n", mailcc); + fprintf(mail, "BCC: %s\n", mailbcc); fprintf(mail, "Subject: Cron <%s@%s> %s\n", usernm, first_word(hostname, "."), e->cmd); diff --git a/usr.sbin/cron/crontab/crontab.5 b/usr.sbin/cron/crontab/crontab.5 index e4e6fae0b01b..5353e3de1b00 100644 --- a/usr.sbin/cron/crontab/crontab.5 +++ b/usr.sbin/cron/crontab/crontab.5 @@ -128,9 +128,19 @@ If is defined (and non-empty), mail is sent to the user so named. If +.Ev MAILCC +is defined (and non-empty), mail is carbon copied to the user(s) so named. +.Ev MAILBCC +is defined (and non-empty), +mail is blind carbon copied to the user(s) so named. +If .Ev MAILFROM is defined (and non-empty), its value will be used as the from address. .Ev MAILTO +, +.Ev MAILCC +and +.Ev MAILBCC may also be used to direct mail to multiple recipients by separating recipient users with a comma. If @@ -298,7 +308,9 @@ is started or the crontab entry is reloaded. SHELL=/bin/sh # mail any output to `paul', no matter whose crontab this is MAILTO=paul -# +# CC and BCC mail to `lakshmikanth@example.com' and 'paul@example.com' +MAILCC=lakshmikanth@example.com,paul@example.com +MAILBCC=peter@example.com # run five minutes after midnight, every day 5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1 # run at 2:15pm on the first of every month -- output mailed to paul