Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
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
@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
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.