From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iLbIKqi9amV78AAAauVa8A:P1 (envelope-from ) for ; Sat, 02 Dec 2023 06:16:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iLbIKqi9amV78AAAauVa8A (envelope-from ) for ; Sat, 02 Dec 2023 06:16:24 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 775DA43D75 for ; Sat, 2 Dec 2023 06:16:24 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=E+gFtbqe; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701494184; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=KDiNtKeiWrqHr1i5SD6+xdiBeKbQqMhYsS8VG4vIhhk=; b=V1rL1MVY/5qlpvDjMpgkONflBl79VVP82HoiJ4m4mKneCpGiBgVZ+wuLSbZrWnBjwWjMf/ CbLJHoOij+EHnL79CQ0Ni3vTSlokwz0SrUPpTbAns0xHpsmhYM8tLQIpv3CXIhgNno5gvl Vv2136+yVRebFw9vOV9Ml4+gGOuGd8dQwUZm1hK1socoWBszsqIs37DT7qLM29cEtsRG+C w/KvWt9k40VsFZaAH11CcEoL5hz6tbob87MK+TsJN7yxHeUXADTSKZ/Uxltav4c2waekgp t7VLfwj4unqI9y0oYXF4iQpX1KdQfbjjit6voAw7nqzC6sAomEn+ZBOJRq8pMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701494184; a=rsa-sha256; cv=none; b=MIkbDV6YgdJ4pTJW/yLwDku5XkpD0Pgi3pFQgTCHOZRQWUG+MP2sGARYE2GZH4L3w504eS rLuaUDO0PtU94E1H7A1xAqJ36Wj+6/1UlP6Ml2uYl8TudF/3C4Y/dzVtI8i7Dk7wh26lgI ECTE3CwPzymMlOr4RNZKZIxR7fJ5dau4qcwEG+wqfI0S7r72KZ9xKsXztaTD1xT5qujRD4 D6RYWckMwKoU/GhyR/BQ+bFk2avqoquxaIUs80FdKRGEEu2BjyHBY7YXk+7wfM+X+LxnAV NKUlM/OzlQeGLrAg19DrhdnJVjWT9touDCs7VCvipdroujWOoExhQCb/YMqEsw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=timmydouglas.com header.s=key1 header.b=E+gFtbqe; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9IM7-0006qz-RR; Sat, 02 Dec 2023 00:15:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9IM5-0006qg-Bw for bug-guix@gnu.org; Sat, 02 Dec 2023 00:15:53 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9IM5-0002AV-3U for bug-guix@gnu.org; Sat, 02 Dec 2023 00:15:53 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9IMD-0003Vb-Qo for bug-guix@gnu.org; Sat, 02 Dec 2023 00:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53547: Error sending email with OpenSMTPD, fatal: time_to_text: bsnprintf Resent-From: Timmy Douglas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 02 Dec 2023 05:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53547 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: me@tobias.gr, 53547@debbugs.gnu.org X-Debbugs-Original-To: Tobias Geerinckx-Rice , bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170149414313463 (code B ref -1); Sat, 02 Dec 2023 05:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Dec 2023 05:15:43 +0000 Received: from localhost ([127.0.0.1]:56492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9ILu-0003V3-F8 for submit@debbugs.gnu.org; Sat, 02 Dec 2023 00:15:42 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9ILs-0003Ur-Rl for submit@debbugs.gnu.org; Sat, 02 Dec 2023 00:15:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9ILd-0006pX-DF for bug-guix@gnu.org; Sat, 02 Dec 2023 00:15:25 -0500 Received: from out-175.mta1.migadu.com ([95.215.58.175]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9ILa-00020z-V3 for bug-guix@gnu.org; Sat, 02 Dec 2023 00:15:25 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timmydouglas.com; s=key1; t=1701494117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KDiNtKeiWrqHr1i5SD6+xdiBeKbQqMhYsS8VG4vIhhk=; b=E+gFtbqeQXYRtcdZNqECs6kIw3S6B1odAoqRkkyq0LRHhbGLkgYFSgsU1znpYzcNPcPpPw 0c3vQ2NAH5VQ/wq9cwBOXd/83ezzB3RJqW4Zr2okhyONvI4gCx/RfrjQ2Pu/RhDpKsqIwC vvyL8ADo1uKz4rSONUWiHbHwjuNXCJY= In-Reply-To: <87plzq7zwa.fsf@nckx> References: <87mtjjkpsw.fsf@timmydouglas.com> <87jzqba8ha.fsf@timmydouglas.com> <87plzq7zwa.fsf@nckx> Date: Fri, 01 Dec 2023 21:15:12 -0800 Message-ID: <8734wlqj6n.fsf@timmydouglas.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=95.215.58.175; envelope-from=mail@timmydouglas.com; helo=out-175.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Timmy Douglas From: Timmy Douglas via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -6.65 X-Spam-Score: -6.65 X-Migadu-Queue-Id: 775DA43D75 X-TUID: bGeRXNoiWPYY Tobias Geerinckx-Rice writes: > [snip] > I'm running opensmtpd@7.4.0p1. Have you tried that yet? > > Guix would certainly accept a patch to fix a bug, but I'm also > paranoid and would prefer to first see some response from upstream > that this is the correct diagnosis. So I found a workaround on my computer with that script that didn't seem to repro. If I set TZ=UTC instead of what I had (TZ=America/Los_Angeles), I was able to make that script work. I should be able to propagate that to mcron and work around the issue... What I tried before that: When I straced sendmail earlier I saw this: [pid 29134] newfstatat(5, "", {st_mode=S_IFSOCK|0777, st_size=0, ...}, AT_EMPTY_PATH) = 0 [pid 29134] read(5, "220 localhost ESMTP OpenSMTPD\r\n", 4096) = 31 [pid 29134] write(5, "EHLO localhost\r\n", 16) = 16 [pid 29134] read(5, "250-localhost Hello localhost [l"..., 4096) = 128 [pid 29134] write(5, "MAIL FROM: \r\n", 31) = 31 [pid 29134] read(5, "250 2.0.0 Ok\r\n", 4096) = 14 [pid 29134] write(5, "RCPT TO: \r\n", 27) = 27 [pid 29134] read(5, "250 2.1.5 Destination address va"..., 4096) = 51 [pid 29134] write(5, "DATA\r\n", 6) = 6 [pid 29134] read(5, "354 Enter mail, end with \".\" on "..., 4096) = 50 [pid 29134] write(2, "sendmail: time_to_text: bsnprint"..., 34sendmail: time_to_text: bsnprintf ) = 34 [pid 29134] write(5, "From: timmy \r\n", 31) = 31 [pid 29134] exit_group(1) = ? It looks like the code of the sendmail client will try to add a Date header if one wasn't passed to the client. (smtp_session.c:2647) I was able to send an email directly with telnet, so that verified the code wasn't on the server. I tried throwing together a standalone repro (below), but didn't have any luck reproducing it. With opensmtpd's sendmail being setgid, I didn't really feel like debugging further. // compile with // gcc ./a.c // run with // ./a.out #include #include #include #include int bsnprintf(char *str, size_t size, const char *format, ...) { int ret; va_list ap; va_start(ap, format); ret = vsnprintf(str, size, format, ap); va_end(ap); if (ret < 0 || (size_t)ret >= size) return 0; return 1; } const char * time_to_text(time_t when) { struct tm *lt; static char buf[40]; const char *day[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; const char *month[] = {"Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec"}; const char *tz; long offset; lt = localtime(&when); if (lt == NULL || when == 0) perror("time_to_text: localtime"); #if 1 offset = lt->tm_gmtoff; tz = lt->tm_zone; #elif 0 offset = lt->tm_isdst > 0 ? altzone : timezone; tz = lt->tm_isdst > 0 ? tzname[1] : tzname[0]; #endif /* We do not use strftime because it is subject to locale substitution*/ if (!bsnprintf(buf, sizeof(buf), "%s, %d %s %d %02d:%02d:%02d %c%02d%02d (%s)", day[lt->tm_wday], lt->tm_mday, month[lt->tm_mon], lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec, offset >= 0 ? '+' : '-', abs((int)offset / 3600), abs((int)offset % 3600) / 60, tz)) perror("time_to_text: bsnprintf"); else { printf("'%s'", buf); } return buf; } int main(int argc, char** argv){ time_t now=time(NULL); time_to_text(now); struct tm *lt=localtime(&now); }