« Of all the silly complaints.. | Main | Blogs as a tool to impress co-workers »

Gah, work-arounds

I wanted to setup a simple cron job that would send an output of a simple file to a simple e-mail address.. something like..

tail -10 whatever.txt | mail -s "here's whatever" whomever@spamme.com

No, of course that's too easy.. when you use a picky postfix server that rejects addresses like, say root@hostname as invalid..

Back to the drawing board... Write a complex perl script or see if there's any way of doing this with a shell one-liner.. and this is where postfix compatibility with sendmail really pays off..

tail -10 whatever.txt | sendmail -f dumbass@localhost.com -s "here's whatever" whomever@spamme.com

Voila.. Reply-to is set, postifx is happy.. a one liner after all.

I'm a bit annoyed that I couldn't find a way of doing this with mail though.. Google failed me..

(yes, save your "reconfigure postifx" comments.. that's unnecessary and too much work)

Comments

Would it have working with mail if you'd used '<spamme@hostname>' instead of 'spamme@hostname'?

Nope.. that wouldn't work :)