Unable to change the sender from root to user in postfix
Hi All,
I have a Linux 2.6 x86 machine and currently I am battling with email deployment on it. The problem is by default the server sends emails through the address root@localdomain.com which is not valid. I want the sender to be changed to username@newdomain.com. So far, after days of googling, I have been able to change only the domain part and now the server sends mail through root@newdomain.com which is again invalid. I have updated the following entries: /etc/postfix/generic /etc/postfix/main.cf /etc/postfix/alias But still the mail appears to use the root username for sending which does not get delivers, here are the logs : [root@myserver]# tail -f /var/log/maillog Jun 27 05:11:54 myserver postfix/pickup[12653]: C86C9115027: uid=0 from=<root> Jun 27 05:11:54 myserver postfix/cleanup[16739]: C86C9115027: message-id=<20120627091154.C86C9115027@myserver.localdomain> Jun 27 05:11:54 myserver postfix/qmgr[12654]: C86C9115027: from=<root@newdomain.com>, size=301, nrcpt=1 (queue active) Jun 27 05:11:56 myserver postfix/smtp[16741]: C86C9115027: to=<abc@xyz.com>, relay=smpt.relay.server[10.135.40.20]:25, delay=1.6, delays=0/0/1.2/0.42, dsn=5.1.7, status=bounced (host smpt.relay.server[10.135.40.20] said: 550 5.1.7 <root@newdomain.com>... Unknown sender (in reply to MAIL FROM command)) Jun 27 05:11:56 myserver postfix/cleanup[16739]: BB551115028: message-id=<20120627091156.BB551115028@myserver.localdomain> Jun 27 05:11:56 myserver postfix/qmgr[12654]: BB551115028: from=<>, size=2215, nrcpt=1 (queue active) Jun 27 05:11:56 myserver postfix/bounce[16742]: C86C9115027: sender non-delivery notification: BB551115028 Jun 27 05:11:56 myserver postfix/qmgr[12654]: C86C9115027: removed Jun 27 05:11:58 myserver postfix/smtp[16741]: BB551115028: to=<root@newdomain.com>, relay=smpt.relay.server[10.135.40.20]:25, delay=1.6, delays=0/0/1.2/0.43, dsn=5.1.1, status=bounced (host smpt.relay.server[10.135.40.20] said: 550 5.1.1 <root@newdomain.com>... Unknown user (in reply to RCPT TO command)) Jun 27 05:11:58 myserver postfix/qmgr[12654]: BB551115028: removed [root@myserver]# Can anyone please help me? |
So what is creating the mail?
You need to configure that. Also what rules does your relay server enforce? |
Where should I configure ?
I used the following command to send the mail:
Echo "Hello World" | mail -s "GM" abc@xyz.com and received the log which I pasted above. As far as SMTP Relay setting are concerned, the entries are updated properly. Issue is to change the sender from root@newdomain.com to user@newdomain.com. |
So log in as 'user' not 'root', and then send the mail...
|
Netbackup Application
My need is to make netbackup deliver emails. Netbackup uses the mailx utility on the server to send mails (which is root by default).
But here root's address is invalid and it does not sends mail. That's why I am looking for an alternative to send emails. |
From 'man mailx'
Quote:
|
I suggest lines in sender_canonical like:
Code:
/root@localdomain.com/ user@newdomain.com Code:
sender_canonical_maps = regexp:/etc/postfix/sender_canonical Documentation |
Still not working
Is there anything I need to change in main.cf file ?
The system continues to send mails through root. @descendant_command The "-r" switch cannot be specified. Netbackup communicates with the server in the background and calls mailx. There is no way I can put a switch to the emails sent. |
The sender_canonical_maps line is in main.cf and you restarted postfix?
|
Yes I did restart.
The postfix was reloaded after making changes.
|
All times are GMT -5. The time now is 12:46 PM. |