LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-15-2013, 04:26 PM   #1
_cs
LQ Newbie
 
Registered: May 2011
Posts: 9

Rep: Reputation: 10
change "From:" address format


I configured several servers from different IPs to email all their log messages to one certain PC.
I already changed in all Boxes in question via /etc/email-addresses the from-address part of mails to send, but on the receiving PC (within kmail) in the "From" column I nevertheless get only username "root" displayed (of course).
So how can I change the from-address-FORMAT sent by the sending exim servers from
"USER <USER@DOMAIN>"
to just
"USER@DOMAIN".
Anyone has an idea??
Thanks
Chris
 
Old 01-15-2013, 04:29 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Well you can configure the outbound email to be whatever you want it be when its generated. Where are the emails being generated(application, PHP, etc.)

This is the way to do it, there are places where you can hard code the from address depending upon the way it is sent but it is hard to embed BASH variables such as $HOSTNAME into them.
 
Old 01-16-2013, 10:11 AM   #3
_cs
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 10
Thank you for your prompt response (other than me...)
The mails are generated by my own scripts or otherwise mainly by cron or other system services. I understand that it's possible to set a "From:..." header in my own scripts, but how can I do this for all the other daemons?
EDIT: Hardcoding is ok, anything is better than just "root" as sender name for all hosts in the From column of kmail.
Chris

Last edited by _cs; 01-16-2013 at 10:15 AM. Reason: typo
 
Old 01-16-2013, 10:42 AM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
There are some MTAs that have plugins that allow you to hardcode a from email address, but any application that is passing a from address will overwrite it. The best practice is to generate the email you want it to be delivered. You can use things like procmail or postfix and try and rewrite your message headers but that can be a bit tricky. There are a few guides on re-writing message header on google. First figure out what MTA you are using, such as postfix or sendmail and then do a quick search.

Here is one for postfix.

http://ubuntuforums.org/showthread.php?t=38429
 
Old 01-16-2013, 12:44 PM   #5
_cs
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 10
The MTA is exim on every host. Sorry for not stressing this enough in my first post.
And I know, it is not only tricky but usually quite a pain to go into MTA's config details, that's why I made this post, hoping someone knows a SIMPLE answer - was probably a little bit naive.....
Thank you for your help anyway.
Chris
 
Old 01-17-2013, 01:50 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you send using mailx (which will then send via your exim MTA), you can use the -r flag thus
Code:
(uname -n)|mailx -s "Test email" -r fake@domain.com real@otherdomain.com
http://linux.die.net/man/1/mailx
 
Old 01-22-2013, 10:43 AM   #7
_cs
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 10
@chrism01
I didn't check this thread for a while, so I did not see your post.

The problem are not mails sent activly via a MUA, but all the mails sent by system services. They all arrive here with sender address "root", and I wish to make it a little bit more clear in my receiving MUA, without filtering each sending host's mails to a separate folder. So it really should be something to configure...
Chris
 
Old 01-22-2013, 12:41 PM   #8
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Here is the exim documentation for rewriting. This should give you what you need to get there, if you have specific questions about the implementation let us know.


http://www.exim.org/exim-html-curren...rewriting.html
 
Old 01-26-2013, 10:02 AM   #9
_cs
LQ Newbie
 
Registered: May 2011
Posts: 9

Original Poster
Rep: Reputation: 10
thank you very much, I think, this is what I was looking for.
When I was searching in several manuals for exim I found on the net, what I found always made me think I had to read a whole book to find out what to do to rewrite a single header line. But THIS looks reasonably simple so I can understand it with my existing knowledge right away.
If still it is too much for me I'll come back here...
Thanks again.
Chris

Last edited by _cs; 01-27-2013 at 01:30 PM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change of suffix format on "split" tar archive files scramble64 Linux - Software 2 11-24-2011 05:41 AM
insmod hello.ko: -1 Invalid module format ("vermagic" and "uname -r" are the same!) courteous Linux - Kernel 8 02-16-2011 11:09 PM
wanting file format for Evolution "address book" SaintDanBert Linux - Software 12 01-10-2011 06:15 PM
OpenBSD: Adding a "lladdr" command to netstart to change MAC address at boot Voltar *BSD 2 04-14-2006 12:41 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration