euglug.org

[Eug-lug] Email from root

작성자

카테고리:



Bob MillerMon Apr 10 14:54:34 PDT 2006

Garl Grigsby wrote:

> Is there any way, either somewhere in sendmail or from the command line, 
> to have mail sent from root appear to come from another user? I've got a 
> bunch of jobs that run as root and send out status messages via root. 
> I'd like them to appear to come from another address. I'm currently 
> using the 'mail' command to send the messages.

You could do it via SMTP if nothing else...

(
    echo EHLO example.com
    echo RCPT To: recipient at example.com
    echo MAIL From: sender at example.com
    echo DATA
    sed 's/^.$//' < a_file
    echo '.'
) | nc -q10 localhost smtp

Your smtp daemon may mistake you for a spammer; you'll have to debug
that yourself.  Also, I just typed that in; didn't test it.

-- 
Bob Miller                              K<bob>
                                        kbob at jogger-egg.com