LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 07-26-2007, 09:24 AM   #1
aeby
Member
 
Registered: Mar 2007
Posts: 109

Rep: Reputation: 15
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
 
Old 07-26-2007, 10:12 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,570

Rep: Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510
.muttrc is in the user's home directory. If it's not there, create it.
 
Old 07-27-2007, 02:39 AM   #3
aeby
Member
 
Registered: Mar 2007
Posts: 109

Original Poster
Rep: Reputation: 15
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
 
Old 07-27-2007, 06:54 AM   #4
aeby
Member
 
Registered: Mar 2007
Posts: 109

Original Poster
Rep: Reputation: 15
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 .
 
Old 05-11-2011, 08:27 PM   #5
nkrvivek
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: 0
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
 
Old 07-20-2011, 12:34 PM   #6
vikas027
Senior Member
 
Registered: May 2007
Distribution: RHEL, CentOS
Posts: 1,241

Rep: Reputation: 96
This can be done as below -


Code:
export EMAIL=sender@domain && mutt -a /path/to/attachment -s "Subject" ABC@ABC.com < /dev/null
 
Old 04-04-2012, 04:03 AM   #7
paklan
LQ Newbie
 
Registered: Jun 2006
Distribution: OpenSuSe
Posts: 5

Rep: Reputation: 0
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.
 
Old 11-21-2012, 11:20 AM   #8
diabolusss
LQ Newbie
 
Registered: Nov 2012
Location: Riga, Latvia
Distribution: Ubuntu Precise Pangolin
Posts: 1

Rep: Reputation: Disabled
Talking IF someone is still monitoring

Quote:
Originally Posted by paklan
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.
Know nothing about cron, however i noticed that if you set in /etc/Muttrc file these setings:
Code:
set realname="Ashok Kumar"
set from="Ashok.Kumar@unknown.domain"
set use_from=yes
And even if "set use_from" is set to "no" default name will override environment variable, so i commented these lines and everything work fine in script.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail outbound relaying based on senders address dbnor Linux - Networking 2 01-27-2007 09:44 AM
Using mutt for two different email accounts spydrmn Linux - General 2 03-08-2005 07:16 AM
Configuring necessary items so MUTT can send email nigma Linux - Networking 0 01-17-2005 12:07 PM
send email with mutt on command line naijaguy Linux - General 1 12-29-2004 06:33 PM
Sendmail --> Blocking email from senders ForumKid Linux - General 2 10-25-2002 02:46 PM


All times are GMT -5. The time now is 08:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration