How to change send email from user@hostname.localdomain to user.hostname@mydomain.com

Latest response

Hi. In our enviroment we have few RHEL 7 dateabase servers. The server auto-sends alerts to DBAs. They show the sender as user@hostname.localdomain . How can I change it to this format user.hostname@mydomain.com ? I have been playing around with sendmail.mc /cf files and genericstable.db with whatever information I can google. but has not achieved the desired result. Any help will be appreciated ?

Responses

Hi,

How does your sendmail.mc metaconfig file look like?

You should have lines similar to this:

...
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomain.dom)dnl
define(`SMART_HOST',`smtp.mysrv.dom')dnl
FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
...

Regards,

Dusan Baljevic (amateur radio VK2COT)