Tuesday, January 25, 2011

How to change the sender of admin mails on a Linux server

Hi,

I am sure it is a dumb question, but I want to change the sender of mails sended by my Linux server (centos 5). All mails sent to user "dev" are forwarded via a /home/dev/.forward file, with this sender : dev@host.epiconcept.fr.

host.mydomain.fr is the hostname of this server, but it's an internal server and it does not even have a public IP. How to have a sender like admin@mydomain.fr? I try to change the "official domain name" (line begining by "Dj" but it change nothing).

Regards
Cédric

  • Normally for this i use generic maps from postfix (imho one of the best - if not the best- mailserver for *nix).

    http://www.postfix.org/ADDRESS_REWRITING_README.html#generic

    On centos If i remember correctly the default smtp daemon is sendmail.
    In this case i'd suggest you to install postfix (much more easy to manage).

    From Pier
  • The actual address used as the sender is determined by the application doing the sending, unless you decide to get the MTA involved for some reason. See the documentation of the specific application to discover where to change it.

    Cédric Girard : I think the sending is done by the MTA, because mails are sent to user root and forwarded to another adress because of a /root/.forward file.
  • If you need only to send mail from services and do not need to receive incoming mail or have local mailboxes, I'd rather use ssmtp than postfix or some other heavyweight mail system.

    The whole config of ssmtp fits in just couple of lines and it has an easy and straightforward way to rewrite the sender's address.

    From Erthad

0 comments:

Post a Comment