LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-16-2011, 05:30 PM   #1
dag10
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
Unhappy Frustration and confusion over setting up a Postfix mail server on my Ubuntu server.


To start off, It's worth mentioning that I'm still very confused about how the whole mail server thing works, and what software handles what job. From my understanding POP3 and IMAP are protocols to pull email from a mail server, and SMTP is used to push email to a server. There are many programs that I've seen involved with creating a mail server, but I'm trying to use just Postfix. Postfix can send and receive email right?

My server runs in my basement and runs Ubuntu Server 10.10. It uses Cherokee as its web server, and it runs several other servers as well (SSH, FTP, Git, etc). My goal is to set up a mail server so that websites I run such as a Redmine or a web forum can send emails to people (e.g. an activation email for a user registering on a forum).

Anyway, I set up postfix, and now my server can receive email. I've been able to send an email from my Gmail address to drew@minipenguin.com (my server), and it works. However, if I try to send email from drew@minipenguin.com to my Gmail, it never goes through. I don't care about receiving email, as my only goal is to be able to send it.

I can post any configuration files you want to see. Any help is appreciated!
 
Old 04-16-2011, 05:57 PM   #2
tva
Member
 
Registered: Jul 2010
Location: Finland
Distribution: Open SUSE 13.1
Posts: 83

Rep: Reputation: 8
Something to start with,

what is your relayhost? It should be your ISP's smtp server.

Do you have errors in your /var/log/mail ?
 
Old 04-16-2011, 06:06 PM   #3
dag10
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tva View Post
Something to start with,

what is your relayhost? It should be your ISP's smtp server.

Do you have errors in your /var/log/mail ?
I have these files in my /var/log/ that begin with mail:
Code:
mail.err        mail.info.1     mail.info.4.gz  mail.log.2.gz   mail.warn       mail.warn.3.gz
mail.err.1      mail.info.2.gz  mail.log        mail.log.3.gz   mail.warn.1     mail.warn.4.gz
mail.info       mail.info.3.gz  mail.log.1      mail.log.4.gz   mail.warn.2.gz
Here's the contents of /var/log/mail.log:
http://pastebin.com/QdJ4mrv1 (contents was too long)

As for the relay host, I've tried several. I've tried nothing (send directly), smtp.gmail.com, and smtp.verizon.net (my ISP). As I said, I'm still very confused about how everything comes together and how to configure these mail-related things.
 
Old 04-17-2011, 04:24 AM   #4
tva
Member
 
Registered: Jul 2010
Location: Finland
Distribution: Open SUSE 13.1
Posts: 83

Rep: Reputation: 8
Ahh, ok.

This line tells that you need to authenticate to smtp before sending.

Code:
Apr 16 17:42:40 Server-01 postfix/smtp[13144]: D9E521DC0088: to=<pocketpqueens@aol.com>, relay=outgoing.verizon.net[206.46.232.12]:25, delay=393468, delays=393467/0.01/0.35/0.06, dsn=5.7.1, status=bounced (host outgoing.verizon.net[206.46.232.12] said: 550 5.7.1 Authentication Required (in reply to MAIL FROM command))
I have never done that myself but i think it should go like this:

main.cf
Code:
relayhost = isp.smtp.server
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/isppwdfile
then create /etc/postfix&isppwdfile with following contents

Code:
isp.smtp.server    username_to_your_isp:password_to_your_isp
After creating that file you need to hash it with

Code:
postmap /etc/postfix/isppwdfile
Then restart postfix.
 
1 members found this post helpful.
Old 04-17-2011, 05:00 AM   #5
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 461

Rep: Reputation: 78
In general - To be able to send mail to another servers you must be a valid sender.
This can be done in two ways:

1. Your server is configured correctly to be able to send mail. (Domain, relay, network) (This is probably not your case)

2. Sometimes you can find yourself in networks which just blocks the SMPT port 25:
(Although your firewall can stop this trafic too )
Quote:
Apr 16 17:45:07 Server-01 postfix/smtp[14227]: connect to gmail-smtp-in.l.google.com[74.125.93.27]:25: Connection timed out
Apr 16 17:47:45 Server-01 postfix/smtp[14629]: connect to alt2.gmail-smtp-in.l.google.com[74.125.79.27]:25: Connection timed out
Apr 16 18:07:34 Server-01 postfix/smtp[15569]: connect to alt1.gmail-smtp-in.l.google.com[209.85.143.27]:25: Connection timed out
It looks like your server tries to connect the public servers but the connection times out.
The connection request for port 25 to public mail servers just doesn't hit the final server. Sometimes ISP doesn't want you to be able to send direct email to public servers.

In this case you should relay every outgoing mail thorough you ISP but for this you has to be verified as a user who is authorized to do so.

I think this is what tva posted.

Last edited by hua; 04-17-2011 at 05:04 AM.
 
Old 04-17-2011, 10:16 AM   #6
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Just to add a little to TVA's post, here is a link to a mini how to. In particular, the comments section may be of value. It mentions that there is a difference between smtp and smtpd authentication, one of which is used to authenticate to your relay host.

Aside from requiring authentication on relay host for outbound mails, it looks like you have things up and running. Getting a mail server working is no small task.
 
  


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
Ubuntu mail server stopped recieving mail. will send. Ubuntu 9 ISPconfig3 Postfix 255 kejxero Linux - Server 0 02-07-2010 06:57 PM
Ubuntu server with postfix. My mail goes to Spam in Gmail and Yahoo Mail. Ideeas? bob808 Linux - Server 4 02-07-2009 04:11 PM
Setting up a mail server with Dovecot and/or Postfix with virtual domains Josh1billion Linux - Server 12 11-27-2008 02:57 AM
Setting up postfix mail server ???? ajeetraina Linux - Server 0 07-23-2007 02:53 AM
Help Setting Up Mail Server In Ubuntu Server 5.10 twaern Ubuntu 1 05-19-2006 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:05 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