Feeling pretty dumb - need help with Postfix - 1/2 working
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 <
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
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.
It's
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.
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"?
I initally set up the Postfix as per the Basic config outlined here:
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
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
Also, the ", ," part of mydestination is probably not helping anything either
Now, if I could just sort out where its going….
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.
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.