Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2008 10:36:52 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jonathan Belson <jon@witchspace.com>
Cc:        glarkin@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: Changing 'From:' address of periodic scripts
Message-ID:  <48B671B4.9070602@infracaninophile.co.uk>
In-Reply-To: <48B66D15.5080104@witchspace.com>
References:  <48A00C8C.4060105@witchspace.com> <48A05902.8060103@FreeBSD.org> <48B66D15.5080104@witchspace.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Jonathan Belson wrote:
| Greg Larkin wrote:
|> Jonathan Belson wrote:
|> | Hiya
|> |
|> | I set up a remote box to e-mail 'periodic' output to me directly.  It
|> | has now
|> | stopped working, and I suspect it's because the 'From:' addresses of 
|> the
|> | status
|> | e-mails is of the form 'root@mybox.local' and the ISP has upped its
|> | anti-spam
|> | checks.
|> |
|> | I see /usr/sbin/periodic itself uses the 'mail' command to send the
|> | mails, but I
|> | couldn't see a command line option to specify a 'From:'.  I guess 
|> 'mail'
|> | uses
|> | 'sendmail' to send e-mail; is there a simple way of forcing a 'From:'
|> | address
|> | via 'sendmail' config?
|> |
|> Hi Jon,
|>
|> Have a look at this: http://www.sendmail.org/m4/masquerading.html and
|> perhaps this, too: http://www.madboa.com/geek/sendmail-genericstable/
|>
|> You can rewrite root@mybox.local to appear as though it's coming from a
|> real email address by using the techniques on those pages.
|>
|> Please post back here if you run into any trouble!
| 
| OK, thanks.  After playing with MASQUERADE_AS(), MASQUERADE_DOMAIN() 
| plus a few FEATURES(), I've managed to change the 'From:' address for 
| e-mails sent via the command line.  Unfortunately, e-mails sent via the 
| cron-ed periodic scripts still don't get through, although if I run e.g. 
| 'periodic daily' from the command line, the mail does reach me.
| 
| The only difference I can think of is that cron runs the scripts as 
| root.  Could this cause the difference?

Yes.  root is specifically exempted from all the masquerading stuff.
There's an EXPOSED_USER macro you can use in $(hostname).mc to control
that.

	Cheers,

	Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.                       Flat 3
~                                                      7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
~                                                      Kent, CT11 9PW, UK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREDAAYFAki2cbQACgkQ3jDkPpsZ+VbRXgCcDzrkWTG0YsLNESOGA3H0Wof9
zk8AoJmW4bdOUC07pQ10nqw+ZluKLXtn
=KZr6
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48B671B4.9070602>