Operating System - HP-UX
1839432 Members
3041 Online
110146 Solutions
New Discussion

how to specify from@ with ELM

 
Vlad_11
Frequent Advisor

how to specify from@ with ELM

Hi,
I'm using the following command to send email with attachment:

elm -s "$SUBJECT" -a $MAILTO < body
(body contain [include file1 text/play base64])

by default reciepient have user email address that runs this shell and I need to change it to predefined $MAILFROM. Moreover it will run in production thru cron (i.e. without user involvment). Couldn't find any similar options in man elm.
Anybody has a solution ?

Thanks to all.
beer or not beer
3 REPLIES 3
Bhuvaneswari Selvaraj
Valued Contributor

Re: how to specify from@ with ELM

generally while sending mails in a script mailx command is used.

man mailx will be able to help you.
Mark Greene_1
Honored Contributor

Re: how to specify from@ with ELM

From the elm man page:

A file, $HOME/.elm/elmrc, that defines the initial values for elm configuration variables.

So you can setup the $MAILFROM there for the login ID for the crontab in question. Or, you can use "su" to switch to the appropriate use to send the mail. You can do this with the -c option which will allow the crontab ID to run the process to create the attachment (which I assume is the case), and then switch just to send the e-mail:

eval "su - [userID] -c "[elm $SUBJECT -a $MAILTO
mark
the future will be a lot like now, only later
Jordan Bean
Honored Contributor

Re: how to specify from@ with ELM

Even if you were able to set the sender address through Elm, sendmail may clobber it anyway unless the invoking user is trusted (add the username to /etc/mail/trusted-users or another Tuser line in sendmail.cf).

If you want this to be permanent, you may also consider using the genericstable feature in sendmail to always mask a user with whatever e-mail address you want. Are you familiar with this feature?