LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   SENDMAIL as an SMTP RELAY SERVER that can send email to internet. how? (http://www.linuxquestions.org/questions/linux-software-2/sendmail-as-an-smtp-relay-server-that-can-send-email-to-internet-how-105511/)

kublador 10-18-2003 08:18 AM

SENDMAIL as an SMTP RELAY SERVER that can send email to internet. how?
 
SENDMAIL as an SMTP RELAY SERVER that can send email to internet. how?
im using rh8..
downloaded the latest version of sendmail and installed it..
i have 2 computers here..

PC1 - 192.168.0.1 - rh8 - this should be the sendmail smtp server - dial up connection
PC2 - 192.168.0.2 - winxp - internet connection shared through PC1, both pingable

well, i just want to make PC1 as an SMTP SERVER that can send email to the internet, like sending email to kublador@yahoo.com, so PC2 will use MS OUTLOOK and set the SMTP Server to the IP or the computer name of PC1 and send the email.
well, actually, im sure that my ISP is allowing to send data through port 25, because i tried a SMTP RELAY SERVER in WindowsXP and it works, i just want to do that thing also in Redhat 8.
please help.
what should i do?

pablob 10-18-2003 09:19 AM

First of all I'd upgrade from sendmail to Postfix, which could be seen as a "mask" over sendmail which makes easier administration, and fixes the million bugs with sendmail.

It's an easy procedure, well documented, more secure and the most important:

No human being is able to configure sendmail. If they tell you so, they are indeed aliens. Call Mulder & Scully.

postfix config is at least human readable.

As an example:

SENDMAIL config:

##################
P=/usr/bin/procmail, F=lsSDFMAw5:/|@qPfhn9, S=10/30, R=20/40,
T=DNS/RFC822/X-Unix,
A=procmail -Y -a $h -d $u,
U=root:root
#R$*<@$*.$=T>$* $#$M $@$R
$:$1<@$2.$3>$4 user@domain.known
#R$*<@$*.$+>$* $#$M $@$R
$:$1<@$2.$3>$4 user@any.domain
R$*<@$*.$+>$* $#ddn $@ $2.$3
##################

POSTFIX config:

##################
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
relay_domains =test.com
smtpd_recipient_restrictions = permit_mynetworks
##################


Now you choose.

kublador 10-23-2003 03:27 AM

is that the config of postfix? that short?

sirjosi 10-23-2003 01:17 PM

it may not be as simple as it seems. But the documentations Ive seen for postfix are a lot easier to understand. Im trying it myself now, but cant seem to gett smtp relaying to work...any ideas will be appreciated

sirjosi 10-23-2003 01:24 PM

this might be what youre looking for.

http://www.redhat.com/support/resour...OWTO/x368.html

Im using sendmail now and you have to edit the Local-host files and add the different domains. Then you have to add it to virtusertable, which I believe Postfix also uses.

Im trying to migrate to Postfix. If you can tell me how you made it work, it will be much appreciated.

sirjosi 10-23-2003 01:24 PM

dang wrong box

joseph 10-24-2003 05:16 AM

Quote:

Originally posted by pablob
First of all I'd upgrade from sendmail to Postfix, which could be seen as a "mask" over sendmail which makes easier administration, and fixes the million bugs with sendmail.

It's an easy procedure, well documented, more secure and the most important:

No human being is able to configure sendmail. If they tell you so, they are indeed aliens. Call Mulder & Scully.

postfix config is at least human readable.

As an example:

SENDMAIL config:

##################
P=/usr/bin/procmail, F=lsSDFMAw5:/|@qPfhn9, S=10/30, R=20/40,
T=DNS/RFC822/X-Unix,
A=procmail -Y -a $h -d $u,
U=root:root
#R$*<@$*.$=T>$* $#$M $@$R
$:$1<@$2.$3>$4 user@domain.known
#R$*<@$*.$+>$* $#$M $@$R
$:$1<@$2.$3>$4 user@any.domain
R$*<@$*.$+>$* $#ddn $@ $2.$3
##################

POSTFIX config:

##################
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
relay_domains =test.com
smtpd_recipient_restrictions = permit_mynetworks
##################


Now you choose.

I don't think so, sendmail its easier to configure too, easy as postfix. i am using sendmail but i am not alien.

Please don't call Mulder and Scully to catch me. I am human being.
Actually with sendmail you can do a lot of thing.
If you want to use postfix, you can try www.postfix.org

pablob 10-25-2003 09:43 AM

See !!?
He's an alien !!!!!

Now, for being serious:
The trick fro the relay SMTP is to set all the "my_networks", "my_destinations" ,etc... in a proper way.
The Postfix documentation is very rich about it.

Check "smtpd_recipient_restrictions = " parameters.
I.e.:

smtpd_client_restrictions = permit_mynetworks
smtpd_sender_restrictions = permit_mynetworks

The meaning of all this initial difficulties is NOT allowing accidental misuse of your SMTP server by spammers.



USEFUL COMMENTS I FOUND GOOGLEING:

############################################

The simplest form of relay control is accept mail for relay only from IP addresses owned by your organization, or otherwise known to be trustworthy.

mynetworks = 127.0.0.0/8 192.0.34.0/8
relay_domains =
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, permit

The permit_mynetworks restriction returns PERMIT if the IP address of the connecting client matches an IP address in $mynetworks. The reject_unauth_destination returns REJECT if the destination is not the local machine or a member of $relay_domains.

#####################################

If your ISP is filtering traffic on port 25, thus blocking you from sending outgoing mail, and so you want to configure your mailserver to relay all your mail out through your ISP's server, like they want you to. If you're running postfix, this turns out to be very easy -- in /etc/postfix/main.cf, just set the variable:

relayhost = smtp.yourisp.com

then restart postfix (/etc/init.d/postfix restart, as root).

#####################################


More:
http://www.metaconsultancy.com/whitepapers/smtp.htm
http://www.redhat.com/support/resour...OWTO/x368.html


All times are GMT -5. The time now is 05:00 AM.