LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2007, 02:26 PM   #1
christopher_c
Member
 
Registered: Sep 2007
Posts: 61

Rep: Reputation: 15
Mail server, can send out, but cant receive


Hi guys/girls,

Been trying to config my squirrelmail and mail server for about a week now and just seem to have run into 1 last problem.

Im able to send out emails from my squirrelmail account but I am unable to receive from outside sources(gmail)... Although I CAN receive email if i send mail internally.

This is the Delivery Status Notification I get back when I try to send to the email :

Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 13): 554 <me@mydomain.com>: Relay access denied


Any thoughts?


Oh yeah, some settings:

imap:dovecot
for sending messages im using 'Sendmail'
 
Old 10-03-2007, 03:09 PM   #2
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
Well, this errors message says: you're not allowed to use this mailserver as a relay.

Usally, this happens if you're (like me) a joe/jane average dyn ip internet user and you try to send outgoing mail over mydomain.com, but mydomain.com just sees "Oh, someone from some dyn ip ISP, DO I KNOW YOU?!".

Which is absolutely how it's supposed to be.

You have to use a relay you're allowed to use and usally have to authenticate yourself with a specific method (certificate, smtp auth...).

Some ISPs allow you automatically relaying in the moment you're a registered user to poll mail via IMAP or POP. (Gmail for example.)

Locally it's a totally different thing, there're just local applications involved and no ISP.

And what do you mean "unable to receive mail from outside sources like gmail"?! Mail sent to your gmail adress won't be devlivered to your host, it's delivered to gmail where you fetch it via POP3 and that's it. (Or click the web interface..)


I've got the following setup:

I receive mail to at least 5 accounts - gmail for example. ALL of those mails I fetch via POP3 or IMAP.

I send mail with msmtp (kind of a micro-mini-nano sendmail..) over a relay. This relay requires a certain authentication on my side, because I'm a mobile moving around notebook user and can't be identified via my IP adress. My mail client (mutt) hands over the mail to msmtp which hands over the mail to my relay after correctly being authenticated.

Where to get a relay?

* ask a friend

* check your ISP - usally relaying is included if you've got more than just "connectivity" and if you already got an inbox for mail

* gmail can only be used if your from-header indicate that you're actually mailing with your gmail identity.

(Sorry for the over simplification, but explaining smtp I think is not the easiest thing..)

Last edited by Su-Shee; 10-03-2007 at 03:12 PM.
 
Old 10-03-2007, 03:32 PM   #3
christopher_c
Member
 
Registered: Sep 2007
Posts: 61

Original Poster
Rep: Reputation: 15
Hi Su-Shee,

Thanks for the response.

Im not sure if I made myself clear about what the problem is, let me try again

Right now I am using SquirrelMail as my client to receive emails from my server. I ran the following command to see if I was able to send/receive from my terminal

"echo "hello" | mail admin"

I went to SM, logged in and saw the email "hello". This is what I meant by internally. I then went to Compose and sent an email to my GMAIL account to see if was able to send out externally and it worked.

Now, with the mail message in my gmail account, I wanted to see if was able to send back to the email to the same email address. Thats when i got the relay error and was not able to send to my squirrelmail email account.

Hope this makes more sense
 
Old 10-03-2007, 04:14 PM   #4
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
Is squirrelmail some kind of webmail thing?

Ah, yes it is. Where's it running exactly?

What is "your server"?

The applications and programs don't matter, it's the hosts where you come from and where you want to relay over.

Yes, you tested mail locally. No external server involved. Works.

*reread* *reread*

Aaah.. you ARE on you mailserver and there's a SM running and AFTER you sent a mail from your own server to your gmail and from there you can't reply to yourself?

Check the header of your mail at gmail and compare that to your mail setup - there's something fishy somewhere.

And do you really want to stick with sendmail and not just use anything a little bit more simple than that? (exim, qmail, postfix..)
 
Old 10-03-2007, 04:44 PM   #5
christopher_c
Member
 
Registered: Sep 2007
Posts: 61

Original Poster
Rep: Reputation: 15
Yup you got it.

Mail works locally, and i can send out to any type of hotmail/gmail/whatever email address, but just not reply back from an email i sent out.

I was looking into it more and am not sure if it has to do with some sort of authentication like you had mentioned earlier.Maybe something to do with MX record?(not familiar with it tho)

Quote:
And do you really want to stick with sendmail and not just use anything a little bit more simple than that? (exim, qmail, postfix..)
Ive read that alot of people are using Postfix and not sendmail as the config for sendmail can be extremely daunting, but I am not sure yet if the problem lies with Sendmail or not.

Let me know if im wrong, but is it the IMAP server that has to do with receiving the email? If so, the problem would like there, no?


edit: My server is my virtual host which I use SSH Shell Client to get into.
 
Old 10-03-2007, 05:10 PM   #6
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
Ok, your own server tells you that you are not allowed to relay.

That means: If you reply on Gmail to your own adress, something sent in that mail header is wrong.

(Or the error message veils something else.)

And yes, for a mail server you need an MX record, this is a name server entry that this host does actually act as mailserver. But the mail wouldn't even be rejected in the first place if there wasn't some entry somewhere, because the host wouldn't be found at all.

I'll try to explain what you actually need:

The mailserver has to have an MX record. The domain must also exist. Usally, you should get both from your ISP where the server is located.

Second, the mailserver has to listen to the mail port. Receiving mail and sending mail are two different things. Obviously, something does listen.

Third, when _sending_ outgoing mail, you'll have to set correct mail headers. With an easy setup, several smtp servers recognize the host and just add all necessary information by themselves. And I think here is you problem. Check the mail header of your own mail lying at Gmail's.

Right now, your server receives mail but seems to reject it.

What I would do: Log me in onto the server and make a telnet localhost 25 and construct a correct mail by hand and sent it to Gmail and reply to that. (If there isn't any obvious mistake in the mail header you've already got)

But I don't even touch sendmail, because I'm a total smtp idiot.

And imap has in a sense something to do with receiving mail, but usally your incoming mail would be took by your smtpd and transferred internally to your IMAP server where you can fetch it from anywhere else.

And it's totally possible that I'm talking utter nonsense because I'm not sure how your setup exactly look like.

Last edited by Su-Shee; 10-03-2007 at 05:16 PM.
 
Old 10-04-2007, 12:10 AM   #7
christopher_c
Member
 
Registered: Sep 2007
Posts: 61

Original Poster
Rep: Reputation: 15
thanks Su-Shee, I will be looking at it tomorrow morning.
Will follow up!
 
Old 10-04-2007, 06:09 PM   #8
christopher_c
Member
 
Registered: Sep 2007
Posts: 61

Original Poster
Rep: Reputation: 15
And so i finally figured out !!

I went and checked the headers of my email and realized it was saying the return address of localhost.localdomain.

I googled it and found this : http://www.digitalpeer.com/id/sendmail

worked perfectely.

Thanks for your help Su-Shee!
 
  


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
with the linux proxi, backend pop3 mail client can not receive mail and send mail rubin823 Linux - Networking 0 12-21-2006 11:06 PM
mail server: just send mails out, but not receive hamish Linux - Software 4 02-27-2005 12:06 PM
Server does'nt send mail until shutdown and LAN can't send or receive. Wolfy Linux - Networking 0 08-02-2004 08:31 PM
mail server fail to send out and receive, help!! littlelittle Linux - Networking 7 03-14-2002 11:26 AM
Why can't I receive or send mail unless jobesd Linux - General 0 12-05-2001 11:49 PM


All times are GMT -5. The time now is 03:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration