[NBLUG/talk] How to set FROM field in script-generated email?

Dave Sisley dsisley at sonic.net
Mon Nov 5 15:36:39 PST 2007


E Frank Ball III wrote:
> On Mon, Nov 05, 2007 at 02:10:19PM -0800, Dave Sisley wrote:
>  > Hey:
>  > 
>  > I use a couple of scripts to send out some emails, using mutt in the 
>  > shell script.  I'd never noticed that the FROM field was blank in these 
>  > emails.
>  > 
>  > One recipient has a mail.com address, and that email would not go 
>  > through.  I added 'export EMAIL=myaddress at work' to my .bash_profile and 
>  > tried sending an email (from a script) to my sonic address.  It was 
>  > blocked -  "(reason: 554 5.7.1 localhost.localdomain isn't valid for 
>  > HELO/EHLO, please fix your server.)".  Sonic won't accept my email, 
>  > either, since I don't have a real domain name for my box.
>
>
> Sonic doesn't care what you use for a From: address, just that you have
> one (it should be a real address, but it can be any real address, like a
> gmail address).
>   
I guess the question is, 'how do I set that, outside of an email program 
like Thunderbird?'
> Did you put 'export EMAIL=myaddress at work' inside your script?
>   
No.  I tried it from my .bash_profile, but I took it out to try your 
.muttrc idea.
> I've never set the EMAIL variable.  I use mutt and set the From field in
> the .muttrc file (set from=).
>   
That looked the most promising, so I tried that, but got the same 
rejection as before.
> Exactly what is in your script?  Are you using mail, mailx, mutt, formail, ??
>   
Here's the script:

    #!/bin/bash

    mutt -s "A bogus email" \
    -a /home/dsisley/some_attachment.xls \
    dsisley at sonic.net < email_body.txt

Thanks for the tips.

-dave.

-- 
Dave Sisley
dsisley at sonic.net
roth-sisley.net




More information about the talk mailing list