mutt + changing senders email address
Hi,
I have a cron job that runs a script and emails the result , but the problem is that the sender's email address is root and i want to change it to username@domain.com, i can always set the cron to run as a user but it gives me permission problems . i am using the mutt mail client , i googled around and they asked me to set the options in the .muttrc file but i cannot find that file. Is there an option on mutt to chane the senders email address?????????????????/ Kind Regards |
.muttrc is in the user's home directory. If it's not there, create it.
|
hi
i have created the .muttrc in roots home directory and gave the option set from = "xyz@domain.com" but still when i run mutt it gives me the senders address as root<xyz@domain.com> now what??? Thanks for the reply |
hi
to change the from email address while using mutt create a .muttrc in the users home directory if it doesnot exist, then enter the feild set realname="username" this will change the name in the senders name . |
or you can just simply have an entry
set from="Name <email@example.com>" in your .muttrc file. No need for an additional realname entry |
This can be done as below -
Code:
export EMAIL=sender@domain && mutt -a /path/to/attachment -s "Subject" ABC@ABC.com < /dev/null |
Hello,
I need some help related to this topic if anyone is still monitoring this thread. My problem is similar to this and in googling for information came upon this thread. I have a shell script that sends a simple email from user root. The aim is to eventually use this mechanism for sending health check information from the machine. The domain the machine resides is not externally known; ie it is on an internal LAN. For example say its hostname is machine1@internal.company.com. Without setting the EMAIL environment variable mutt sends the email to a local SMTPD server for forwarding as root@internal.company.com. This causes the final mail system to reject the mail (rules to stop spamming etc) because it can not resolve the domain internal.company.com. So in the script I coded 'export EMAIL="myname@realdomain.com"' and when run in the foreground in a bash interactive shell the email is accepted by the final mail system and it is received correctly. However if I run this same script under CRON it is as though mutt ignores the EMAIL environment variable and sends the email as though it is from root@internal.company.com. The script looks like this: export EMAIL="myname@realdomain.com" EMAILTO="recipient1@otherdomain.com" SUBJECT="$(hostname) test" mutt -s "${SUBJECT} ${EMAILTO} </tmp/message.txt BTW my ~/.muttrc for root looks like this (but does not appear to make any difference if I have the -f or not for sendmail) set sendmail="/usr/sbin/sendmail -oem -oi -fmyname@realdomain.com" It appears, to me, that mutt ignores the EMAIL environment variable when it is invoked from a shell that is not interactive. Has anyone else seen this behaviour? Could this be an anti-spamming mechanism? thanks Patrick. |
IF someone is still monitoring
Quote:
Code:
set realname="Ashok Kumar" |
All times are GMT -5. The time now is 04:43 AM. |