LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change ( masquerade) shell user name when sending mails via Postfix (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-masquerade-shell-user-name-when-sending-mails-via-postfix-921448/)

saagar 12-31-2011 10:56 PM

How to change ( masquerade) shell user name when sending mails via Postfix
 
Hi Happy New Year to all,


My query is as follows:

In my server, where postfix is running, I have a shell account as
sagar, I actually wanted to be seen by the world when they get
mail as "premsaagar@MyOriginatingDomainName.com".


So, I used the canonical_maps in /etc/postfix/main.cf as follows:

Code:

canonical_maps=hash:/etc/postfix/canonical
Then, in /etc/postfix/canonical :

Code:

sagar  premsaagar
then, from command line:

Code:

postmap /etc/postfix/canonical
/etc/init.d/postfix reload

When my friends receive my mail, it appears to them as:
Code:

from:        sagar premsaagar@OriginatingDomainName.com
to:        Receiver'sName@gmail.com
date:        Sat, Jan 31, 2011 at 8:33 AM

It is working fine as far as username@domain.com, but I dont want the name "sagar" there ( that is my shell account name) How can I masquerade in such a way that it appears as premsaagar and not sagar?

Please help

VertigoRay 01-04-2012 06:17 PM

I just had a very similar issue. I wanted to masquerade my shell account when sending mail via a script to my customers. Unfortunately, I'm not sure how you're sending e-mail so I'm just going to tell you how I got my issue resolved:
Code:

$ echo "This is a test." | mail -a "From: \"Ray P.\" <vertigoray@mailinator.com>" -s "Test" you@mailinator.com
Hope this helps!

saagar 01-10-2012 09:10 PM

Hi VertigoRay,

Sorry for the belated reply. I will check this out and update you.
Thanks


All times are GMT -5. The time now is 11:38 PM.