Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    14

    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
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,737

    Smile

    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:

    Code:
    Mail sent from Local Linux machine to Remote Linux
    Mail Server which will sent the mails to outside world.
    
    
    Local Linux machine:10.232.13.99
    Remote Linux Server machine:12.167.43.117
    
    Things done at remote machine (12.167.43.117)
    ==============================================
    1)First login to that destination machine as root.
    ssh root@12.167.43.117
    
    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,
    #make
    
    5)open sendmail.mc 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=127.0.0.1, Name=MTA')dnl
    
    6)creat new configuration file using following command,
    #m4 sendmail.mc > sendmail.cf
    
    7)Restart the sendmail program.
    #service sendmail restart
    
    Things done at local machine (10.232.13.99) 
    ==========================================
    
    1) Make sure local sendmail port 25 is not blocked  & Add ip address of remote machine in /etc/hosts file
    #vi /etc/hosts
    12.167.43.117   xxxcomdev.xxx.com       xxxcomdev
    
    2) In sendmail.mc provide your sendmail server name and make sure DAEMON_OPTIONS is commented,
    
    #vi /etc/mail/sendmail.mc
    
    define(`SMART_HOST',`xxxcomdev.xxx.com') 
    
    dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    
    3)creat new configuration file using following command,
    #m4 sendmail.mc > sendmail.cf
    
    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 www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

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