LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Frustration and confusion over setting up a Postfix mail server on my Ubuntu server. (https://www.linuxquestions.org/questions/linux-server-73/frustration-and-confusion-over-setting-up-a-postfix-mail-server-on-my-ubuntu-server-875380/)

dag10 04-16-2011 05:30 PM

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!

tva 04-16-2011 05:57 PM

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 ?

dag10 04-16-2011 06:06 PM

Quote:

Originally Posted by tva (Post 4326666)
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.

tva 04-17-2011 04:24 AM

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.

hua 04-17-2011 05:00 AM

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.

Noway2 04-17-2011 10:16 AM

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.


All times are GMT -5. The time now is 05:49 PM.