LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Remapping root account email (https://www.linuxquestions.org/questions/linux-server-73/remapping-root-account-email-4175562004/)

daveginorge 12-21-2015 03:07 AM

Remapping root account email
 
Hi All
Postfix mail server.
I have mapped
Quote:

root@mydomain.com to fw@mydomain.com
but when sending emails it sill has root as the username eg
Quote:

root <fw@mydomain.com>
is there a way to map out the root username, if so how.
Thanks in advamce

robertjinx 12-21-2015 04:53 AM

Code:

root <fw@mydomain.com>
That is not the username, but the name. When you send mails from fw@mydomain.com, you'll need to specify 'Some Name <fw@mydomain.com>' or change the name for fw/root.

An email client will take whatever name it can when that is not properly setup.

daveginorge 12-21-2015 07:33 AM

Hi Robert
Actually that is the username, it's being sent from the root account, so the name & username are the same in this case. I was just asking is it possible to map the root part to another name when sending emails from the root account.

robertjinx 12-22-2015 03:31 AM

You can do this:

Code:

echo 'Some message here' | mailx -s 'My subject' -r 'Some name <fw@mydomain.com>' 'somebody@example.org'
mailx needs to be installed if you dont have it, 'somebody@example.org' is the person who you are writing to. Basically you need to control the 'From' header when sending a mail and you can put whatever you want.

greenbergmethew 12-23-2015 02:04 AM

The system administrator can define email aliases in the file /etc/aliases. This file contains lines like root: cwd@mailhost.example.com, /root/mailbox; the effect is the same as having cwd@mailhost.example.com, /root/mailbox in ~root/.forward. You may need to run a program such as newaliases after changing /etc/aliases.

Note that the workings of .forward and /etc/aliases depend on your MTA. Most MTAs implement the main features provided by the traditional sendmail, but check your MTA's documentation.

greenbergmethew 12-23-2015 02:05 AM

root@mydomain.com to fw@mydomain.com
but when sending emails it sill has root as the username eg
Quote:
root <fw@mydomain.com>


All times are GMT -5. The time now is 06:15 PM.