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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-22-2003, 06:12 AM
|
#1
|
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:
|
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.
|
|
|
01-18-2004, 02:52 AM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
Have you properly configured your mail server, whichever one your using like sendmail?
|
|
|
01-18-2004, 09:58 AM
|
#3
|
Member
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142
Rep:
|
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
|
|
|
01-18-2004, 10:27 AM
|
#4
|
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:
|
I'm using sendmail... The docs seem neverending !! how i can i just set sendmail to use my ISPs SMTP server?
|
|
|
01-18-2004, 10:42 AM
|
#5
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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.
|
|
|
01-18-2004, 10:55 AM
|
#6
|
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:
|
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.
|
|
|
01-19-2004, 12:36 AM
|
#7
|
Member
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142
Rep:
|
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.
|
|
|
01-19-2004, 12:40 AM
|
#8
|
Member
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142
Rep:
|
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.
|
|
|
01-19-2004, 03:38 AM
|
#9
|
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:
|
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.
|
|
|
01-19-2004, 04:39 AM
|
#10
|
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:
|
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.
|
|
|
01-19-2004, 05:29 AM
|
#11
|
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:
|
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.
|
|
|
All times are GMT -5. The time now is 07:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|