this was discussed with jacekm@ and the issue is actually a bit trickier than i initially assumed, we'll fix that soon but it's not a five minutes fix as it looks like ;)
Gilles On Tue, Oct 13, 2009 at 09:51:59AM +0200, Nicolas Letellier wrote: > I tested with the latest files on CVS (this morning), the error is > always here. > > To reproduce the problem: > > - edit crontab root > - set a fake cronjob which print anything: */1 * * * * ls / > - set a root alias (/etc/mail/aliases) to an other mail (root: > [email protected]) > > And wait to receive the mail... See the header (I replaced my full > hostname by sub.domain.net, and the root alias by [email protected]) > > From - Tue Oct 13 09:34:56 2009 > X-Account-Key: account4 > X-UIDL: 1255419242.14725.mrelay6-g25 > X-Mozilla-Status: 0001 > X-Mozilla-Status2: 00000000 > X-Mozilla-Keys: > Return-Path: <[email protected]> > Delivered-To: [email protected] > Received: (qmail 14687 invoked from network); 13 Oct 2009 07:34:02 -0000 > Received: from mx23-g26.free.fr (HELO sub.domain.net) (212.xx.xx.xx) > by mrelay6-g25.free.fr with SMTP; 13 Oct 2009 07:34:02 -0000 > Received: from sub.domain.net ([82.xxx.xx.xxx]) > by mx2-g20.free.fr (MXproxy) for [email protected] ; > Tue, 13 Oct 2009 09:34:02 +0200 (CEST) > X-ProXaD-SC: state=HAM score=10 > Received: from localhost (0...@localhost [IPv6:::1]) > by sub.domain.net (OpenSMTPD) with ESMTP id 1255419241.POaAAxCh6duP43wr > for <[email protected]>; Tue, 13 Oct 2009 09:34:01 +0200 (CEST) > Date: Tue, 13 Oct 2009 09:34:01 +0200 (CEST) > Message-Id: <[email protected]> > From: root (Cron Daemon) > To: root > Subject: Cron <r...@esgaroth> ls / > Auto-Submitted: auto-generated > X-Cron-Env: <SHELL=/bin/sh> > X-Cron-Env: <PATH=/bin:/sbin:/usr/bin:/usr/sbin> > X-Cron-Env: <HOME=/var/log> > X-Cron-Env: <LOGNAME=root> > X-Cron-Env: <USER=root> > > As you can see, the problem is the "From" field. There is no hostname > here. So, a MUA can't answer to it. > > If you send a mail with : echo "hello world" | mail > [email protected], no problem. The problem is *only* when a mail > is sent from and by a crontab with OpenSMTPd (no problems with Sendmail > or Postfix). > > Regards, > > Nicolas > > Le 13/10/2009 08:52, Gilles Chehade a icrit : > > I'll fix this by this week-end, yesterday's late bug tracking of this > > issue > > was not successful, I can totally reproduce it on my production > > server, but > > not on the box im hacking on ... > > > > Gilles > > > > Nicolas Letellier wrote: > >> Hello. > >> > >> I'm on a OPENBSD_4_6. I use smtpd insted of sendmail. All works > >> perfect with it, except one point. When a mail is sent from a > >> crontab, the mail received has this in the header: > >> > >>> From: root (Cron Daemon) > >> > >> I have no hostname, no domain, nothing. Just the user in the From part. > >> > >> This case is only when a mail is sent from a crontab (crontab -e -u > >> root). With this line for example: > >> > >>> */1 * * * * echo test > >> > >> So, we wan't answer to this mail, or know who is the machine which > >> send it. However, in other informations in the header, we wan see the > >> domain in 'Received' parts. > >> > >> > >> See my /etc/mail/smtpd.conf: > >>> listen on sk0 > >>> > >>> hostname my.hostname.tld > >>> > >>> map "aliases" { source db "/etc/mail/aliases.db" } > >>> > >>> accept from all for local deliver to mbox > >>> accept for all relay > >> > >> See the end of /etc/mail/aliases > >>> root: [email protected] > >> > >> > >> And, other question... Why "Cron Daemon" AND "root" are printed in my > >> "From"? > >> > >> Thanks. > >> > >> Regards, > > > > > -- > Nicolas > -- Gilles Chehade freelance developer/sysadmin/consultant http://www.poolp.org

