Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Sendmail smarthost

    Hi, I have two servers, one of them is my web server, and one of them is my mail server. On my web server I have php scripts that are looking at my php.ini and calling on sendmail with /usr/sbin/sendmail -t -i

    I want sendmail to relay the mail to my mail server where it will do the actual sending, instead of trying to send the mail itself from my web server. I have already tried this tutorial Smarthost and it appears to be ignoring my additions to the config file or syntax is wrong. I am running postfix on my mail server box if this makes any difference.

    Also right now my mail is working sending from my web server although I don't want it to and it's sending this information in the email headers Received: (from www-data@localhost). Is there any way I can remove this since it's giving away the username my webserver is running under?

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    3rd rock from sun - Often seen near moon


    I did the same kind of stuff with sendmail few months before,

    This is good link
    Quick HOWTO : Ch21 : Configuring Linux Mail Servers - Linux Home Networking

    And this is how i did:

    Mail sent from Local Linux machine to Remote Linux
    Mail Server which will sent the mails to outside world.
    Local Linux machine:
    Remote Linux Server machine:
    Things done at remote machine (
    1)First login to that destination machine as root.
    ssh root@
    2)Then go to mail directory.
    #cd /etc/mail
    3)change access file -(Access file -- controls which hosts are allowed to use sendmail)
    #vi /etc/mail/access
    connect:12.167	RELAY
    4)type make command,
    5)open file and make sure following line is commented.Only then sendmail will listen for connections from other machines on port 25.
    dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl
    6)creat new configuration file using following command,
    #m4 >
    7)Restart the sendmail program.
    #service sendmail restart
    Things done at local machine ( 
    1) Make sure local sendmail port 25 is not blocked  & Add ip address of remote machine in /etc/hosts file
    #vi /etc/hosts       xxxcomdev
    2) In provide your sendmail server name and make sure DAEMON_OPTIONS is commented,
    #vi /etc/mail/
    dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl
    3)creat new configuration file using following command,
    #m4 >
    4)Restart the sendmail program.
    #service sendmail restart
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    FOSS India Award winning ext3fs Undelete tool Online Linux Terminal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts