Link to home
Create AccountLog in
Avatar of AXISHK
AXISHK

asked on

Configure host and default sender name in Linux sendmail

Run sendmail –s “TEST MAIL” test@gmail.com < /dev/null. I find the following is gmail header :

Return-Path: <root@fedoralinux20-test>
Received: from fedoralinux20-test

Where can I change  the host name and domain name used by sendmail ?

Thx
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of AXISHK
AXISHK

ASKER

My PHP website hosts on Apache server. Seem like it send out using user apache@mydomain.com. However, the apache user is not included in the php code. Any idea where will this user "apache" been setup ?

Thx
apache is the user under whose credentials httpd/apache web service runs.
you need to configure your php.ini mail to use the -f command with sendmail to set the email sender.
depending on how you are setting the message header in the PHP code, there is a way to identify who the sender should be .....
sendmail_path = /usr/sbin/sendmail -t -fsenderemail_address -oi

by default sendmail in the absence of the -f sendmail uses the logon as the username portion and its own hostname as the domain....
note the above will send all outgoing messages from your server using that sender....
Avatar of AXISHK

ASKER

Thx