how to change display name of From address in postfix

Discussion in 'Server Operation' started by fantalimon, Feb 21, 2013.

  1. fantalimon

    fantalimon New Member

    Haven't found it yet and am hoping someone here knows. I am trying to change the display name of the From address field. I have managed to change via /etc/postfix/generic
    [email protected] to [email protected]
    but the email from field appears as this:-
    Apache ([email protected])

    I trying to change 'Apache' to something else.

    Does anyone know how to?

    Thanks in advance
     
  2. fantalimon

    fantalimon New Member

    the answer

    I have found the answer to my query finally!!
    To change the display name go to php.ini and change,

    sendmail_path = /usr/sbin/sendmail.postfix -t -i -F "no-reply"
     
  3. JayC

    JayC New Member

    Well that's great if you're targeting a specific application.
    I used this technique in fail2ban actions to produce the same result but this is extremely cumbersome if you have multiple servers/vservers/services which send mail. I wish someone could point me out in the right direction because this is something that's been haunting me for a while.

    My issue is that I would like to change permanently the display name of the from for all mails sent by postfix. I use postfix as a relay to google apps and have one account there with multiple domain aliases. I only really use one set of credentials for authentication stored in sasl_passwd for all my domains and use filters to manage forwarding to proper accounts and/or folders.

    Have tried generic mapping, played around with /etc/aliases but nothing did it and I'm still receiving emails from "root" <[email protected]> while what I really want is "mydomain.me" <[email protected]> no matter the account it was sent from.

    If anyone has any idea on how to solve this issue please let us know.

    Thanks in advance,
    JC
     
  4. TiTex

    TiTex Member

  5. JayC

    JayC New Member

    Hi TiTex,

    Thanks for the input. As I said, I use it for the moment as a workaround but chasing out the sendmail cmds sent by apps is a pain (my last encounter was with ddclient where you have to modify the client itself, meaning that on next update mods are gone).

    I am looking for some type of global solution that works where I can define that if the mail was sent by a particular service/app/account it gets a corresponding header. I thought the /etc/aliases file would allow me to do this but apparently not (or I didn't read the FM enough... lol)

    Best,
    JS
     
  6. mang0slush

    mang0slush New Member

    I've been looking for a global solution as well, just as JayC had mentioned, and I finally found one that worked for me as I needed it to. I just used the chfn command to change/update the GECOS information to whatever I wanted, which can be displayed using the finger command., e.g. 'finger jdoe'. In the following example for user account jdoe, this is the info represented in the fifth field ("John Doe") of a user account entry in /etc/passwd:

    jdoe:*:202:1:John Doe:/home/jdoe:/usr/bin/ks

    In my case, I wanted the display name of root to be something else other than "root" whenever mail was sent from the server. Here are the steps I took. Hopefully, this will help someone out...

    Displayed the current GECOS: finger root
    Changed/updated the GECOS display name to what I wanted: chfn -f "The Tiger Team" root
    Confirmed/displayed the changes: finger root
    Sent myself a test e-mail to confirm: echo "Test." | mailx -v -s "TEST" myselfATmydom.ain
     
    edooze likes this.

Share This Page