July 07, 2003
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)

Posted July 07, 2003 11:17 PM in Geek Stuff
TrackBack URL for this entry: http://www.unix-girl.com/mt/mt-tb.cgi/779
Comments
On July 7, 2003 11:41 PM Derek added:

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

#
On July 8, 2003 02:05 PM kasia added:

Nope.. that wouldn't work :)

#
Trackbacks