How to make cron send mail from a nonexistent address?

Matthew Flaschen matthew.flaschen at gatech.edu
Fri Mar 13 01:19:53 UTC 2009


David M. Karr wrote:
> No, I'm not planning on setting up a spam house. :)
> 
> I have some cron jobs that send their results to my Gmail account.  I 
> read my Gmail in Thunderbird.
> 
> I've discovered that Gmail has a "feature" such that mail sent from me 
> to me will not be downloaded in a POP request.  I have a feeling that if 
> I munge the "from" address of the cron email, this will avoid this 
> problem.  I know to set "MAILTO" in the crontab to set where cron sends 
> mail to, but I don't see an obvious way to change the FROM address used 
> (not surprising).  I would imagine that Google's SMTP probably barfs on 
> mail authenticating with one address, but specifying a different from 
> address.  I've read about (and used) the information about reconfiguring 
> the "/etc/exim4/exim4.conf.template" file to route mail through Gmail 
> SMTP, but I don't see anything obvious in those options.

I think it might be REMOTE_SMTP_HEADERS_REWRITE .  However, Gmail has
another feature that "Gmail automatically rewrites the "from" line of
any e-mail you send via their SMTP gateway to your Gmail address, and it
overrides any Reply-To settings you may have in your e-mail software in
favor of the one in Gmail's web interface."
(http://lifehacker.com/software/email-apps/how-to-use-gmail-as-your-smtp-server-111166.php).
 I just verified this myself.

Thus, they'll remunge your munge, and you won't get the desired effect.

Matt Flaschen




More information about the ubuntu-users mailing list