LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-24-2009, 02:12 AM   #1
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Rep: Reputation: 43
sendmail - send mail via GATEWAY


I have a Red Hat machine with sendmail.
To send e-mail from command line is more than simple:
Code:
sendmail my@e-mail.com < /home/my/file.txt
Now, what I'd like to do, is to send e-mail using corporate gateway.
The address of it is let's say: corp.mail.com

Any idea how to do this ?
 
Old 07-24-2009, 06:24 AM   #2
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
you need to set sendmail to relay to the corporate gateway. You will also need to tell the corporate gateway that it is OK to relay mail from your server.

Details on how to do this should be in a tutorial or the man page.
 
Old 07-24-2009, 07:05 AM   #3
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Original Poster
Rep: Reputation: 43
Corporate gateway alrdy knows about that.
The thing is how to force my locally installed sendmail to use that gateway ?
 
Old 07-24-2009, 08:06 AM   #4
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
Originally Posted by czezz View Post
I have a Red Hat machine with sendmail.
To send e-mail from command line is more than simple:
Code:
sendmail my@e-mail.com < /home/my/file.txt
Now, what I'd like to do, is to send e-mail using corporate gateway.
The address of it is let's say: corp.mail.com

Any idea how to do this ?
Hi,

you will find in /etc/mail/sendmail.mc "smarthost" change this to your corp gateway and rebuild sendmail.

Code:
make clean
make all
make restart
As well as put into access file the corp gateway's address for relay and the corp gateway needs to accept relaying from your box too.

Laz
 
Old 07-24-2009, 11:49 AM   #5
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Original Poster
Rep: Reputation: 43
Hey man,
the problem is that I cant see sendmail.mc in /etc/mail dir.
Should I build it some how ?
 
Old 07-25-2009, 05:00 AM   #6
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
first, make sure sendmail-cf and m4 RPM packages are both installed

Code:
rpm -qa | grep sendmail-cf
rpm -qa | grep m4
then if its still not there, run a locate
Code:
updatedb
locate sendmail.mc
this README on sendmail configuration files should help you further on your way

http://www.sendmail.org/m4/readme.html
 
Old 07-28-2009, 08:55 AM   #7
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Original Poster
Rep: Reputation: 43
Ok, I have added sendmail-cf.
Then edited /etc/mail/sendmail.mc:
Code:
define(`SMART_HOST',`corpo.mail.com')
executed:
Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Restarted sendmail:
Code:
/etc/init.d/sendmail restart
Now Im looking on tcpdump:
Code:
/usr/sbin/tcpdump host corpo.mail.com
...but cant see any traffic when sending mails.
Any ideas ?

Last edited by czezz; 07-29-2009 at 07:32 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why my 2 mail server cannot send mail to each other via Sendmail? nelson.ck.sit Linux - Newbie 4 12-09-2008 07:22 PM
How to configure sendmail only to send mail to external mail account Nivix Linux - Newbie 2 10-23-2008 12:46 AM
Help me guide to setup mail server as a mail-gateway use spamassasin (use sendmail) adcom99 Linux - Newbie 1 11-03-2007 03:47 PM
sendmail: how to send mail from my yahoo e-mail address harryhaller Slackware 3 11-13-2006 11:00 PM
Mail Server Issues; Can't Send E-mail (using sendmail) Vegetarian Smoker Linux - Software 1 06-18-2006 02:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration