LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-22-2003, 06:12 AM   #1
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Rep: Reputation: 30
Adding a relay mail server to be able to use "mail"


Hi I'd like to use "mail" to send emails across the internet, not just on the local server. I can use the ISPs SMTP server to relay messages on it but I have no idea how to do that to use it in '"mail". Pine just works perfectly, but when i use "mail -s "Hello" user@another_domain.com" I get this error:

----- The following addresses had permanent fatal errors -----
<majordomo@some_list.org>
(reason: 550 <majordomo@some_list.org>: Relay access denied)

----- Transcript of session follows -----
... while talking to mail.some_list.org.:
>>> DATA
<<< 450 <ganninu@home.homedomain>: Sender address rejected: Domain not found
<majordomo@some_list.org>... Deferred: 450 <ganninu@home.homedomain>: Sender address rejected: Domain not found
<<< 554 Error: no valid recipients
... while talking to bandit.pangeia.com.br.:
>>> DATA
<<< 550 <majordomo@some_list.org>: Relay access denied
550 5.1.1 <majordomo@some_list.org>... User unknown
<<< 503 Error: need RCPT command


thanks a lot,
ganninu.
 
Old 01-18-2004, 02:52 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Have you properly configured your mail server, whichever one your using like sendmail?
 
Old 01-18-2004, 09:58 AM   #3
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
If you are using postfix (and why wouldn't you? ;> ) you can set this up easily by following the documentation here ->

http://dev.gentoo.org/~spider/local-...cal-email.html
 
Old 01-18-2004, 10:27 AM   #4
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Original Poster
Rep: Reputation: 30
I'm using sendmail... The docs seem neverending !! how i can i just set sendmail to use my ISPs SMTP server?
 
Old 01-18-2004, 10:42 AM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by ganninu
I'm using sendmail... The docs seem neverending !! how i can i just set sendmail to use my ISPs SMTP server?
Why would you need to setup a mail server to use another mail server for sending? Just set this up in whatever client mail program you using to use your ISP's smtp server.
 
Old 01-18-2004, 10:55 AM   #6
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Original Poster
Rep: Reputation: 30
Remember that my intention is to be able to use the "mail" command to send an email. Consider that i write a bash script which will email me some statistics gathered by another program every 5 days.. The simplest way to do it is by using mail I think.
 
Old 01-19-2004, 12:36 AM   #7
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
Do you need to be running an MTA locally for reception of email? If not then I would recommend you ditch Sendmail and install nullmailer. This is a send-only MTA that relays to a server of your choice. If you are running on Deb then just apt-get install nullmailer. The setup is a doddle.

If you do need a local MTA for reception of email then I personally would ditch sendmail and install postfix. It might be just me, but I find the configuration of postfix to be a lot easier than the sendmail config.
 
Old 01-19-2004, 12:40 AM   #8
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
You could also try editing sendmail.cf and locate the the section that begins with DS and edit as follows:

DShost.domain.com

with the 'host.domain.com' being the fully qualified host name of the mail server that you will be "relaying" mail messages to.
 
Old 01-19-2004, 03:38 AM   #9
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Original Poster
Rep: Reputation: 30
Do i need to do something else after editing the DS line, because it is not working. However I didn't get the error of unknown domain.
 
Old 01-19-2004, 04:39 AM   #10
Satriani
Member
 
Registered: Mar 2003
Location: The Netherlands
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418

Rep: Reputation: 30
Depending on the way you setup sendmail, there should be a sendmail.mc in your /etc/mail directory...

This makes configuring your sendmail waaaayyyyy easier!
Look for a line looking something like this:
Code:
define(`SMART_HOST',`smtp.yourprovider.com')
And (of course) change smtp.yourprovider.com with your providers smtp server name or address..

If it has DNL it, delete that. After you finished up all your settings, run :
Code:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
You should restart sendmail and see what happens!!!

(Also very nice to do in this mc file is this:
Code:
FEATURE(`masquerade_envelope')
MASQUERADE_DOMAIN('server.domain.com')
MASQUERADE_AS(whatever.com)
This will cause sendmail to change the full servername after the @ to only your domainname (No matter what domain you are in). If you do such a thing, remember to adjust your /etc/mail/access and put in the line
whatever.com RELAY
and then run
makemap hash access < access
This will allow sendmail to relay mail for your (even fake) whatever.com domain.


Ahhhhh, read your post again, and it seems that your providers mailserver(bandit.pangeia.com.br) checks out your domainsuffix before sending it. Since you did not masquerade your domain: "ganninu@home.homedomain", it will check your domain to a DNS server to make sure your domain exists. But unfortunately, home.homedomain does not exist, thus causing the mail server to reject any further handling.

(It could also be the other way round: some_list.org in this case, as the cause of the problems...)

Use that masquerade thingie to change it so something that is actually your (existing) email address, and i think your problems are over....

Last edited by Satriani; 01-19-2004 at 04:49 AM.
 
Old 01-19-2004, 05:29 AM   #11
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Original Poster
Rep: Reputation: 30
Thanks a lot! That answered many questions to me and to many people I know However, when I tried it, it's still not working. I have no doubt that I am missing something. This is an extract from the sendmail.mc file:

Code:
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
MASQUERADE_AS(`ganninu.com')
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
FEATURE(`masquerade_envelope')
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
FEATURE(`masquerade_entire_domain')dnl
dnl #
MASQUERADE_DOMAIN(`localhost')
MASQUERADE_DOMAIN(`localhost.localdomain')
MASQUERADE_DOMAIN(`tiger.maddomain')
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
However when i try to mail using my ISPs SMTP it still doesn't work. I think that my domain is not masquaeraded (tiger.maddomain) since i have sent an email to myself (root@localhost) and I got this:

Code:
Message 1:
From root@tiger.maddomain  Mon Jan 19 13:03:27 2004
Date: Mon, 19 Jan 2004 13:03:27 +0100
From: root <root@tiger.maddomain>
To: root@tiger.maddomain
Subject: test
Am i missing something?

Last edited by ganninu; 01-19-2004 at 06:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using sendmail to relay mail to ISP mail server Swift&Smart Linux - Software 26 11-09-2008 03:00 PM
Shel script mail send ("/" in mail address) problem anaid Linux - Networking 3 08-23-2005 07:41 AM
Qmail problem: ISP mail and virtual mail, "sorry no mailbox, here by that user" barryw Linux - Networking 7 05-28-2005 12:43 PM
Help, after enable the "relay control" we can't receive the mail! explorer1979 Linux - General 1 11-28-2001 02:17 PM
Help, after enable the "relay control" we can't receive the mail! explorer1979 Linux - Distributions 1 11-22-2001 11:54 AM


All times are GMT -5. The time now is 12:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration