Feeling pretty dumb - need help with Postfix - 1/2 working

Ok,

I've got a LAMP setup (using the terrific Linode guide) on Ubuntu/MySQL/Apache. I'm running an SMF forum on it and it's working great.

I first tried SSMTP, using Google as an SMTP server to allow the forum to send mail. I managed to get that up and running, but then found out about the daily limit of 100 emails, and many of my 9000 members subscribe to email updates to forum threads etc.

So I went the Postfix route, doing the basic install again using the Linode guide. Followed it letter for letter (I think).

I disabled SSMTP (deleted the Google MX records, apt-get remove SSMTP etc. Even deleted my Google Apps account.

Got Postfix up and running and the forum can send mail. Sweet!

Now, my goal is to enable my email addresses at my domain (on my one Linode VPS). I don't need or want to store messages locally and use POP, I really just need it to forward the emails to my Google mail accounts.

No matter what I do I can't get it working.

I get an error message when sending mail:

Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 5.7.1 <tim@domain.com>: Relay access denied (state 14).

I've read and read and read but haven't seen a clear solution to this.

I presume it's a combination of my main.cf and MX records etc. but just can't sort it and am looking for help.

If someone offered a service to set Postfix up, I'd be a happy paying customer.

Happy to post up whatever details needed, and I'm a humble man and not afraid of asking dumb questions. With no experience I've gotten this far, and feel pretty dumb that I can't clear this final hurdle.

11 Replies

First off, it sounds like your easiest option would be to go back to Google apps for receiving mail, and only using postfix on your linode to send your forum mail. Setting up a send-only postfix is pretty simple, and if you are just going to forward to google anyway…

If you want us to help you troubleshoot your postfix, a real domain would let us check for the most obvious problems. Otherwise, log file excerpts from the failed delivery attempts and maybe a summary of main.cf would be a start.

Wasn't sure the etiquette here of posting up my own domains (lots of the posts I've read seem to post up fictitious domains).

It's www.dotheton.com for what its worth.

I'll definitely have a look at using Postfix to only send mail - I guess I'd put the MX records back in for Google to receive mail for my domain there.

I'll get my main.cf up here shortly too, although I think its a bit of a mess given all my attempts, using input from Postfix's setup guides as well as Linode's.

Putting your real domain is always a slight risk, but without it all we can do is guess at your problems.

It looks like you have your hostname set to dotheton.dotheton.com, and you are only set up to receive mail for that domain:

 $ telnet mail.dotheton.com 25
Trying 173.230.149.92...
Connected to mail.dotheton.com.
Escape character is '^]'.
220 dotheton.dotheton.com ESMTP Postfix (Ubuntu)
ehlo testing
250-dotheton.dotheton.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM:test@example.com
250 2.1.0 Ok
RCPT TO:tim@dotheton.com
554 5.7.1 <tim@dotheton.com>: Relay access denied
RCPT TO:tim@dotheton.dotheton.com
250 2.1.5 Ok</tim@dotheton.com> 

Fixing the hostname is probably best done at the OS level, but you can hack it into main.cf by setting "myhostname".

What are your main.cf settings for "mydestination", "virtualaliasdomains" and "virtualmailboxdomains"?

Thanks for the ongoing help - here's a bit more info:

I initally set up the Postfix as per the Basic config outlined here:

http://library.linode.com/email/postfix … 0.04-lucid">http://library.linode.com/email/postfix/gateway-ubuntu-10.04-lucid

Including the Virtual Hosting configuration settings

I've since likely made a mess of my main.cf.

My MX Record:

Mail Server mail.dotheton.com / Preference 10 / TTL Default

A/AAAA Records:

Hostname / IP Address 173.230.149.92 / TTL Default

Hostname mail / IP Address 173.230.149.92 / TTL Default

Hostname www / IP Address 173.230.149.92 / TTL Default

CNAME Records - none

TXT Records - None

SRV Records - None

main.cf:

See /usr/share/postfix/main.cf.dist for a commented, more complete version

Debian specific: Specifying a file name will cause the first

line of that file to be used as the name. The Debian default

is /etc/mailname.

myorigin = /etc/mailname

smtpdbanner = $myhostname ESMTP $mailname (Ubuntu)

biff = no

appending .domain is the MUA's job.

appenddotmydomain = no

Uncomment the next line to generate "delayed mail" warnings

delaywarningtime = 4h

readme_directory = no

TLS parameters

smtpdtlscert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

smtpdtlskey_file=/etc/ssl/private/ssl-cert-snakeoil.key

smtpdusetls=yes

smtpdtlssessioncachedatabase = btree:${datadirectory}/smtpdscache

smtptlssessioncachedatabase = btree:${datadirectory}/smtpscache

See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

information on enabling SSL in the smtp client.

mydomain = dotheton.com

myhostname = dotheton.dotheton.com

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = $mydomain

mydestination = dotheton.dotheton.com, localhost.dotheton.com, , localhost

relayhost =

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

mailboxsizelimit = 0

recipient_delimiter = +

inet_interfaces = all

relay_domains = $mydestination

@taysan:

myhostname = dotheton.dotheton.com
You probably want to change this to "mail.dotheton.com", even if you give up on receiving mail with your linode. This name will appear as your HELO name when you send, and it will not match your DNS which might cause delivery problems.

> mydestination = dotheton.dotheton.com, localhost.dotheton.com, , localhost
This line lists ALL the domains your server will receive mail for, unless you have configured virtual hosting. If you want to receive mail for @dotheton.com, then dotheton.com needs to be listed in either mydestination, virtualmailboxdomains, or virtualaliasdomains.

Also, the ", ," part of mydestination is probably not helping anything either ;)

Made those changes, and lo and behold, my mail isn't bouncing back at me any more!

Now, if I could just sort out where its going…. ;)

If you used mydestination, then probably in /var/mail or /var/spool/mail

So any hints on how to 'bounce' incoming mail to their respective external accounts? There are only a couple of addresses which won't be changing much if ever.

I also didn't want to be having to set up every mail account as a 'user' on the VPS anyhow, so relaying it all out works best for me.

Thanks again for all the help - feels like I'm getting closer.

HOLY CRAP.

OK, so after another hour of digging, I stumbled across an innocuous post that solved my problem.

DO NOT TEST your Postfix's ability to forward mail to an address, FROM that same address, at least if it's GMAIL.

For WHATEVER reason, if you send an email from your gmail account, to your Postfix domain email, which is set up to forward it back to that same gmail account, it goes into the ether.

BUT, it does work from another one of my email addresses, so it would seem my problems are solved :)

AND, I setup my forwarding in the virtual file to send to my Hotmail for fun, and tested it from the same Hotmail account. Worked no problem. Seems to be a Google specific thing.

Glad to hear you have things working. Forwarding is tricky business in the modern email universe - Google is probably recognizing that your server is attempting to send mail from a google account, and is probably saying, "you are not google, this message is a forgery". That is why I think if you just want to forward mail to a google account you might be best off switching back to google apps.

I think Gmail has some kind of de-duplication mechanism, so if it finds you sent it the very exact mail that already is in the inbox (OR sent box), it ignores it.

A one@gmail -> user@linode -> forward to another@gmail chain does work right, so it's not a "you're not gmail" thing.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct