LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2004, 10:39 PM   #1
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Rep: Reputation: 15
sendmail help


Hi! I'm trying to set up a sendmail server. I need it for a website I'm making in php. I've tried to telnet to It and issue it commands. All seems well since I get the "250 2.0.0 i54FP9kZ002447 Message accepted for delivery" message. The problem is, the email doesn't really gets sent. Is there a badmail directory for sendmail? where? Where are the queued messages stored? thanks!
 
Old 06-04-2004, 10:12 AM   #2
Kroppus
Member
 
Registered: Aug 2003
Location: Norway
Distribution: Debian UNSTABLE + latest 2.6.kernel
Posts: 391

Rep: Reputation: 30
Try the command "mailq" and se what that says..
i think the mail usually ends up in /var/spool/mail or /var/mail

Where are you trying to send the mails anyway?
Locally or outside your pc?

Take a look at /var/log/maillog (or something like that)

I don't like sendmail since it's a pain in the ass to configure since you have to recompile the sendmail.mc file into a working sendmail.cf file.
I stick with Exim, Easy to set up and maintain.
 
Old 06-04-2004, 02:12 PM   #3
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Normally you can only send mail out from the local machine where sendmail runs. You need to setup a relayhost or allow relay to outside networks.
 
Old 06-04-2004, 09:13 PM   #4
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Original Poster
Rep: Reputation: 15
here's some of the contents of /var/log/mail/errors:

Jun 5 09:53:01 localhost sendmail[2175]: My unqualified host name (localhost) unknown; sleeping for retry
Jun 5 09:54:01 localhost sendmail[2175]: unable to qualify my own domain name (localhost) -- using short name
Jun 5 09:54:02 localhost sm-msp-queue[2296]: My unqualified host name (localhost) unknown; sleeping for retry
Jun 5 09:55:02 localhost sm-msp-queue[2296]: unable to qualify my own domain name (localhost) -- using short name
Jun 5 09:55:45 localhost sendmail[2607]: My unqualified host name (localhost) unknown; sleeping for retry
Jun 5 09:56:45 localhost sendmail[2607]: unable to qualify my own domain name (localhost) -- using short name
Jun 5 10:01:13 localhost sendmail[2784]: My unqualified host name (localhost) unknown; sleeping for retry

My emails should not be limited locally. It should be able to send to, for instance, yahoo or hotmail, etc. The "from" of my messages are set to paulr1984@localhost since paulr1984 is my username in my pc. Should I use my IP Address instead?

How do I setup a relay host or allow relay to outside networks? I'm very new to sendmail.

by the way, I tried 'mailq'. It didn't display anything. It didn't even return me to the command prompt. So I terminated it after a couple of minutes.

Here's part of my /var/spool/mail/paulr1984 file:

From MAILER-DAEMON@localhost.localdomain Thu Jun 3 22:12:11 2004
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Received: from localhost (localhost [127.0.0.1])
by localhost (8.12.11/8.12.11) with ESMTP id i542CA7n002239
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
for <paulr1984@localhost>; Thu, 3 Jun 2004 22:12:10 -0400
Received: from localhost (localhost)
by localhost (8.12.11/8.12.11/Submit) id i542CAko002188;
Thu, 3 Jun 2004 22:12:10 -0400
Date: Thu, 3 Jun 2004 22:12:10 -0400
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost>
Message-Id: <200406040212.i542CAko002188@localhost>
To: paulr1984@localhost
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="i542CAko002188.1086315130/localhost"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--i542CAko002188.1086315130/localhost

The original message was received at Sun, 23 May 2004 02:01:57 -0400
from paulr1984@localhost

----- The following addresses had permanent fatal errors -----
paul_mrivera@yahoo.com
(expanded from: paul_mrivera@yahoo.com)

----- Transcript of session follows -----
451 yahoo.com: Name server timeout
Message could not be delivered for 5 days
Message will be deleted from queue

--i542CAko002188.1086315130/localhost
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost
Arrival-Date: Sun, 23 May 2004 02:01:57 -0400

Final-Recipient: RFC822; paul_mrivera@yahoo.com
Action: failed
Status: 4.4.7
Last-Attempt-Date: Thu, 3 Jun 2004 22:12:10 -0400

--i542CAko002188.1086315130/localhost
Content-Type: message/rfc822

Return-Path: <paulr1984>
Received: (from paulr1984@localhost)
by localhost (8.12.11/8.12.11/Submit) id i4N61vS2002913
for paul_mrivera@yahoo.com; Sun, 23 May 2004 02:01:57 -0400
Date: Sun, 23 May 2004 02:01:57 -0400
From: Paul Rivera <paulr1984>
Message-Id: <200405230601.i4N61vS2002913@localhost>
To: paul_mrivera@yahoo.com
Subject: Hi! from linux


As you can see, I got a "451 yahoo.com: Name server timeout". How do I fix this? Thanks for replying!
 
Old 06-05-2004, 12:01 AM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
First you need to resolve the error so sendmail can run.

What's in the file /etc/hosts?
Do you have a hostname?
Domainname?

Then once that's resolved you need to decide how your going to allow relay without having your mailserver open to the public.
 
Old 06-05-2004, 05:03 AM   #6
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Original Poster
Rep: Reputation: 15
hi! here's the contents of /etc/hosts:

127.0.0.1 localhost

I don't have a hostname or domainname. I'm only on a dial-up account.
Can you explain the error to me? How do I resolve these?

thanks!
 
Old 06-05-2004, 05:30 AM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
It will need to be like this


127.0.0.1 localhost.localdomain localhost


Sendmail needs to be able to resolve the qualified hostname.domainname so it can be allowed to relay mail.


It does this by /etc/hosts or DNS



Last edited by DavidPhillips; 06-05-2004 at 05:32 AM.
 
Old 06-05-2004, 09:38 AM   #8
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Original Poster
Rep: Reputation: 15
Hi! now i'm getting "553 5.5.4 <paul_mrivera@yahoo.com>... Real domain name required for sender address".

"127.0.0.1 localhost.localdomain localhost" is only space delimited right?

By the way, what argument should I pass with HELO? "localhost" or my IP Address?
Thanks!
 
Old 06-05-2004, 12:45 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
ehlo <hostname.domainname>

It's hard to run a mailserver on a dialup account.

You should setup the relay host to your isp's mailserver.

The sendmail.mc file would be the following entry..

define(`SMART_HOST',`smtp.your.provider')
 
Old 06-06-2004, 12:26 AM   #10
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Original Poster
Rep: Reputation: 15
ok. If all else fails, I'm using my isps smtp server.

so here's what i did:

telnet
o localhost 25
ehlo myipaddress
mail from: <paulr1984@myipaddress>
rcpt to: <paul_mrivera@yahoo.com>
--->I get a "451 4.1.8 Domain of sender address paulr1984@myipaddress does not resolve"

how do I fix this? I've tried valid domain names like paulr1984@yahoo.com and still get that message.
 
Old 06-06-2004, 01:08 AM   #11
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
That's because it must have a domainname and mx record. You need to register it in order to have this work.

Last edited by DavidPhillips; 06-06-2004 at 01:28 AM.
 
Old 06-06-2004, 01:15 AM   #12
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
here are some examples..



david@firedragon:~> dig mx linuxquestions.org

; <<>> DiG 9.2.2 <<>> mx linuxquestions.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51013
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 3, ADDITIONAL: 5

;; QUESTION SECTION:
;linuxquestions.org. IN MX

;; ANSWER SECTION:
linuxquestions.org. 900 IN MX 20 mx1.linuxquestions.org.
linuxquestions.org. 900 IN MX 10 mail.linuxquestions.org.
linuxquestions.org. 900 IN MX 15 mx.linuxquestions.org.




david@firedragon:~> dig mx hotmail.com

; <<>> DiG 9.2.2 <<>> mx hotmail.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39908
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 16

;; QUESTION SECTION:
;hotmail.com. IN MX

;; ANSWER SECTION:
hotmail.com. 1366 IN MX 5 mx4.hotmail.com.
hotmail.com. 1366 IN MX 5 mx1.hotmail.com.
hotmail.com. 1366 IN MX 5 mx2.hotmail.com.
hotmail.com. 1366 IN MX 5 mx3.hotmail.com.




when an address has user@hotmail.com the mailserver would be one of these..

mx4.hotmail.com.
mx1.hotmail.com.
mx2.hotmail.com.
mx3.hotmail.com.






These have more than one mx record because you need somewhere for the mail to go if your server is offline. You will also need a backup mailserver. You can get a domainname and also get mail forwarding or pop mail service from one of several places. just search google for "domain email services".

When you get a permanent connection you can use your domainname with your ip address and setup your mx record.

Last edited by DavidPhillips; 06-06-2004 at 01:26 AM.
 
Old 06-06-2004, 07:08 AM   #13
paulr1984
Member
 
Registered: Dec 2003
Posts: 75

Original Poster
Rep: Reputation: 15
I'm using a dial-up account.

Hmm... Quite complicated... I'm going to search more on this.

I have IIS installed in my windows xp pro partition. I didn't register it but I can send emails through it. Do I really need a dns or register anything? Can't I use my ip address just like in http servers?

Here's another attempt I made to send email:

ehlo localhost
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
mail from: <paul@localhost>
250 2.1.0 <paul@localhost>... Sender ok
rcpt to: <paul_r@atenista.net>
250 2.1.5 <paul_r@atenista.net>... Recipient ok (will queue)

But the email doesn't really get sent.

here's the contents of a file in /var/spool/mqueue/:

V6
T1086362956
K1086566347
N29
P2550026
I3/5/716013
MDeferred: Connection timed out with sitemail.everyone.net. ------->what's wrong here?
Fws
$_localhost [127.0.0.1]
$rSMTP
$slocalhost
${daemon_flags}
${if_addr}127.0.0.1
S<admin@localhost>
MDeferred: Connection timed out with sitemail.everyone.net.
rRFC822; paul_r@atenista.net
RPFD:<paul_r@atenista.net>
H?P?Return-Path: <g>
H??Received: from localhost (localhost [127.0.0.1])
by localhost (8.12.11/8.12.11) with SMTP id i54FP9kZ002447
for <paul_r@atenista.net>; Fri, 4 Jun 2004 11:29:16 -0400
H?D?Date: Fri, 4 Jun 2004 11:29:16 -0400
H?F?From: admin@localhost
H?M?Message-Id: <200406041529.i54FP9kZ002447@localhost>


also, i tried sending to my yahoo email account and I got this:

MDeferred: mx4.mail.yahoo.com.: No route to host
 
Old 06-06-2004, 09:13 AM   #14
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Not to send emails you don't as long as you have a mailserver to relay them for you. Most of the isp's I have used will relay mail as long as you have one of their ip addresses and are using their connection. You should be able to give any return address you like.

You really don't need your own mailserver to send email.

You will need a domainname to receive mail on your own mail server, or at least an mx record. You can have mail forwarded to any mail account and retrieve it there with fetchmail.



You seem to be sending localhost as your domain name. Try something like this.

ehlo atenista.net
mail from: paul_r@atenista.net



What you need to do is configure your email client app to connect to your isp's mailserver, or have your mail server relay it through them. And you also need to masquerade your domain name to one where you have an email account, so your mail can be replied to.





localhost will not work for a domain on the internet

Last edited by DavidPhillips; 06-06-2004 at 09:17 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail ignores my sendmail smarthost entry Paul_assheton Linux - General 1 03-17-2009 07:55 AM
FC4 and Sendmail - Cannot create sendmail.pem Balderayne Linux - Security 2 11-09-2005 02:55 PM
php+ sendmail no good - python + sendmail ok nephish Linux - Networking 1 10-07-2005 01:19 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM
sendmail (dont just ignore it 'cause its got sendmail in the subject :P) GnomeKing Linux - Networking 1 11-12-2001 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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