LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SMTP access via Smart host (https://www.linuxquestions.org/questions/linux-networking-3/smtp-access-via-smart-host-21452/)

saravanan1979 05-21-2002 04:47 AM

SMTP access via Smart host
 
Hi
I have a Linux machine(Red Hat 6.2) in my network.I have installed sendmail in it.Know i want to use the SMTP service running in one of the machine in my network.Can anyone tell me how to do this.Can u tell me where exactly i should set this configuration .I know we should set in sendmail.cf but where exactly should we set this...
regards
Saravanan

unSpawn 05-21-2002 12:25 PM

In your local /etc/mail/sendmail.mc add a line (w/o quotes)
"define(`SMART_HOST',`the.other.smtp.host')dnl"
and make sure any other RELAY lines don't have the "define" but "undefine" m4 directive.
Now regen your conf file with m4 or "mailconf --generatecf".
Make sure the smtp you're forwarding to allows some form of FEATURE(relay_ (/etc/mail/sendmail.mc). Check this for more.

saravanan1979 05-22-2002 07:33 AM

Re
 
Dear unSpawn
First Thanks a lot for ur reply.
I would like to tell few more things about my settings.I have a Linux Machine which is given a gateway to the router.This machine does not have a registered domainr a valid DNS.One of the machines in my network has its SMTP relayed to a global IP.Know i want the send mail in Linux machine to use global relayed machine.For this to happen i have done the following settings

1.Edited the /etc/mail/sendmail.cf to add the smart host
-------------------------------------------
> # "Smart" relay host (may be null)
> DSsmtp:<SMTPGW>

> -------------------------------------------
>

Then to allow relaying i did the following

2. Edited vi /etc/mail/access and ADDed the following line

<your linux server ip> RELAY


then i ran

makemap hash /etc/mail/access < /etc/mail/access


3.Restarted Send mail using /etc/rc.d/init.d/sendmail restart

Know when i tried to send mail using pine or mail it is not reachineg the destination .Can u help me to solve the issue

xanthium 05-22-2002 09:06 AM

masquerade
 
Hi ,

Now i couldnt get ur requirements properly but here are my assumptions :

LinBox --> local-network-smtp-relay-box -->ISP-BOX--> internet.

Ur linux box will connect to a local network machine which in turn will send the mail to a ISP relay machine (or which ever machine which as granted it relay permission) and then the ISP machine in tru will locate and send the email to its final destination.
I hope iam right.

Now for this arrangement to work, u have to work out following thing :

1. make sure ur local-network-smtp-relay-box allows relaying from ur machine (ie; check if ur ip is among those allowed to relay thru them)
2. Masquerade ur emails.


Hope this helps.

Regards,
Xanthium.



saravanan1979 05-22-2002 09:29 AM

rE
 
hOW TO MASQUEREADE MY EMAIL??

xanthium 05-22-2002 09:54 AM

Hi ,

Hmmm i basically use one of the m4 scripts.
I hope u know what masquerading means ? I think u will have to masquerade ur email so that the headers in the email reads that the email originated from the the SMTP relay box in ur local network .

Lots of tutorial on the net cover this topic. try google or goto the sendmail offcial site .

Regards,
Xanthium.

saravanan1979 05-24-2002 05:45 AM

Problem Solved
 
Dear Xanthium
Now i am able to send mails from my machine.The problem was the Linux Machine was not able to resolve the outside domain.So we had a domain name server bought from an ISP.I gave this DNS value in the Primary name server directive and it started working...But one small question i have stopped the Sendmail Dameons as it was not staring up properly during the initial boot up.But even after stooping the servic the mails are being send i am really surprised how can this happen.The mail either send through the PHP script or through pine reaches the destination without sendmail daemon...but it takes some time to reach the destination.....Eagerly awaitng ur comments

Regards
Saravanan

xanthium 05-27-2002 02:40 AM

Hi Sarvanan ,


Now sendmail is just a MTA ( Mail Transport Agent ).
Just stop the sendmail daemon and open a terminal in the linux box and give the command
mail -s "Test Message" root
>


Now type and thing u want and when ur finished press ctrl-d

now u will see that root user has got the mail u just typed.

So u see sendmail is used for transporting mail to some other MTA . Now in ur case since ur mail are being delivered inspite of sendmail daemon being off its because :

1. Now whenever ur linux machine (in this case take it as a client) tries to sendmail to abc@xyz.com then the the mail is first handled by the smtp server (specified in the clients s/w)
in ur case check what is the smtp server that is specified in the cgi script or in pine ...... now sendmail is a MTA working on SMTP
so because ur sendmail is down does not mean anything for a client as long as that client is not using ur server as a SMTP server!

does this work :

mail -s "Xanthium test email" vipulmb@rediffmail.com
test email
^d

Regards,
Xanthium.

xanthium 05-27-2002 11:34 AM

Hi ,

Programs like "mail" are used to sendmail mails to local host/domains ... usually they accept mail from MTA to be delivered locally. So u cant use them to send mails to external world.

However sendmail s/w can be used to send mail (as an MTA) since u can state in its Conf file the server which u want to use as relay
also MTA like "sendmail" can use MX record to contact other MTA in the external world and deliver the mails themselves without the aid of any other relay server.

So its quite possible that some CGI script is asking sendmail to send mail to external world ( and the DAEMON need not be started ) .... so either sendmail uses it conf file to relay the email to some other server or just tries to deliver it on its own.

Hope u got what iam saying.

Hmmmm well tell me how did u send me the mail at rediff acct .... using pine ?

Regards,
Xanthium.

saravanan1979 05-28-2002 12:08 AM

Re
 
Hi Vipul
I send mail to ur rediffmail id using the below command

mail -s "Xanthium test email" vipulmb@rediffmail.com
test email
^d
By the way even if i use Pine after turning off the sendmail daemon.The mail is being send and when i view the process list after sending the mail i find that the daemon is running but before sending the process when i type

ps aex | grep processname

it does not show the process....
So can i infer that send mail daemon is being implicitly turned on when a mail is sent.
Vipul can u send me the step by step procedures to install Guest FTP in the Linux machine.I don't even have inetd installed in my machine
Regards
Saravanan

Thanks and regards
Saravanan

xanthium 05-28-2002 02:22 AM

Hi ,

As i told u :

utils like "mail", "pine" etc are MUA or Email clients. They accept/fetch mails from SMTP server.

Since the email was for external world (rediff) the MUA (pine, or mail utility) could not possibly handle it ( i mentioned it in my previous post) and hence passed it on to sendmail (a MTA) to send it to rediff's MTA .... since such delivery can be handled only by MTA because of handshaking and all the stuff present so sendmail was invoked by the system ( NOW IAM NOT SURE HOW SENDMAIL GOT INVOKED ... TECHNICALLY!) .... so now u can figure why "sendmail" is called sendmail? as an MTA it can talk to other MTA to deliever mail intended for that domain.

Now after reading ur post even iam not sure about my Mail fundamentals. Do me a favour and ask one of the moderators to comment on all of our posts and to point out mistakes.


Guest FTP :

I will talk about wu-ftpd ( others like pro-ftpd are better one though) ... also there are lots of GUI front ends available to configure this ... also linuxconf does it ! but still here it is :

The file /etc/ftpaccess controls the configuration of ftp.

You can try out the following properties :

class all real,guest *
email sarvanan@outblaze.com
loginfails 3
overwrite no guest
delete no guest
rename no guest
guestuser *
noretrieve passwd
restricted-uid user1 user2 user3
guest-root /home/user1 user1
guest-root /home/user2 user2
guest-root /home/user3 user3


Please check out the man pages to find out more about ftpaccess file .

Thats it . If ur using RH then u dont need to do chroot directory as RedHat some how managed to do it for u !!!


About Inetd : Why do you need it ? Ur machine and daemons can work fine without it as well .... but u can still download the RPMs
and install it !

Regards,
Xanthium.

saravanan1979 05-29-2002 07:28 AM

Dear Xanthium
I am facing one small little problem with regards to sendmail.It is taking a lot of time for the mail command to terminate both via pine via sendmail or via CGI script.As u know i havent given any configuration in the sendmail.cf.I have installed sendmail and have a public ip as the nameserver for the machine(DNS given by an ISP).
By the way how to ask a moderator to come to our help.Sorry for the ignorance

Regards
Saravanan

unSpawn 05-29-2002 09:01 AM

Slow responses could be due to about anything. I think these should be checked: sendmail's Black Hole checking (IIRC, "sndbl" directives)? DNS lookups working (check logs)? Slow connections/remote SMTP's timing out (logs)?

Btw, if you don't need to deliver right away you can set Sendmail up to queue mail, and then cron the "sendmail -q" command to send it out when it suits you.

*I think mods in general are summoned. Conjuring the arrival of a mod usually works best with chants using export brewskies, xtreme wailing & gnashing of teeth or by using intriguing thread titles or trolls, depending on their state of mind :-]

saravanan1979 05-29-2002 10:01 AM

Dear Unspawn

Thanks a million fr ur help i have fixed the problem now.The key point to note in your message was to note the log file.Log file showed me that unable to resolve the short name.Then i found out that in /etc/ hosts file i have mapped my machine ip with name

<ip> <machinename>

Know i changed the above to

<ip> <machinename> <machinename.localhost>.Know it worked very fine
Regards
Saravanan

xanthium 05-30-2002 01:39 AM

hi saravanan ,

Many users of Rh6.2 complained that the system virtually freezes while the sendmail daemon is being brought up .... it was due to name lookup problem!

So the first thing to do during slow mail sending is to check up if
ur able to do name lookup and then check for mail queue !

Now i dont know how adding a "localhost" to host file entry helped you ( for resolving ur valid DNS name!).

Regards,
Xanthium.


All times are GMT -5. The time now is 10:21 PM.