Rodrigo's picture

Hi,

I'm really new to turnkey and I'm starting to set up a small project in the lamp virtual appliance of turnkey 12.

My goal is to create a internal web server for a small company. I set up everything and all is working fine (is been incredibly easy so far working with this great product). My problem now is that I need to set up a gmail account with postfix and I have no clue how is that possible, Is there a tutorial available on this site? Is there any dependency needed for postfix to work with gmail?

I have configure an ubuntu server instead of postfix with msmtp and was really easy, can I install it on the server?

Regards.

Forum: 
Chris Musty's picture

Here is a tutorial on what you want, I think!

Postfix is an MTA so it should send (from localhost) emails out of the box...

Chris Musty

Director

Specialised Technologies

Jeremy Davis's picture

Or perhaps I'm just getting slow! :)

@Rodrigo - Curious why you would setup postfix with msmtp? AFAIK postfix (a full MTA as Chris states) provides all the functionality of msmtp (which only does outgoing mail - ie SMTP) so not clear why you would use both? I've never used msmtp but it seems like a good lightweight alternative if you only want to send mail out, but with postfix as well it would seem redundant.

Rodrigo's picture

@Jeremy,

I know that postfix is the whole deal in mailing, my problem is that I have to spend to much time configuring it. I only want to send mails, not receive. 

I know how to do it with msmtp (actually I did it already on the appliance), and I don't have time to properly configure it. 

Although I have read the tutorial and some day when I have time (on work vacations) I will give it a try.

 

Regards.


Chris Musty's picture

This is Turnkey remember!

You can send emails with a simple PHP script without any opther configuration.

Just remember that postfix is bound to localhost.

If you want to prevent being flagged as spam there a few hoops you need to jump through.

I use the Joomla and Wordpress appliances (Based on LAMP) and do nothing more than setup a newsletter plugin then send out emails from the appliance. One client has 6,000 subscribers and sends out on average once a week. Replies are not important but we put an address in the reply to field which is a gmail account and check it when we have to in case someone decides to give feedback. You can always ignore this step.

Chris Musty

Director

Specialised Technologies

Jeremy Davis's picture

And although it looks pretty good, it's probably a bit in depth for what you'll need to do (includes instructions on installing postfix from source, etc) so there's only a small amount of it that you'd actually need to do to get postfix to relay emails through gmail's smtp. A quick google turned up heaps of results on how to configure postfix to relay through gmail and it looks pretty easy, just a case of minor modifications to the existing postfix config.

But like Chris says above, it's configured to send emails OOTB so unless you have some reason to relay through gmail, then it should just work as it is...

Chris Musty's picture

Maybe we should ask what you are trying to achieve like sending from php mailer or system notifications etc

Chris Musty

Director

Specialised Technologies

Rodrigo's picture

Chris,

The usage I intend to do is to send system mails and php mails.

The reason that I didn't use postfix is that for some reason the mails never reach me. For that I intend to use the gmail account to see what is happening with that.

I will try to give it another shot with the default configuration to see what is happening.

Regards.


Chris Musty's picture

You will find that postfix is fine but your ISP (Internet Service Provider) is flagging the email as spam for one or more of the following reasons.

  1. Dynamic IP on appliance - even though the IP may be static in the respect it does not chsnge Amazon list it as dynamic and Trend Micro via their DUL list flag your server as a big bad spam producing machine.
  2. DUL (Dialup Users List - bad acronym really) is a list of all the SOHO and once off servers that have not specifically proven they are ok to send emails.
  3. Bad HELO name - this is the fully qualified domain name of the server. If its wrong (most would be if using TKL) then you will probably get flagged as SPAM
  4. SPF (Sender Policy Framework) Records - at a zone manager level you need to specify this TXT record so emails have the status as "Pass" reducing the risk of being spoofed and giving recipients a nice warm feeling that you are a good guy.

I have listed out how to fix this issue in THIS thread and thought I had finished a wiki entry but just checked it and found it was half done! ARGH!

In addition to the info provided you can check your IP status with Trend HERE

Good luck and any questions, reply to the thread!

Chris Musty

Director

Specialised Technologies

Jeremy Davis's picture

Having you here and sharing your knowledge on the forums is a real plus mate! I know a bit, but there are many holes in my knowledge and as it's all self taught I'm often not sure if it's best practice, so great to have you around.

Chris Musty's picture

We all like to share...

Chris Musty

Director

Specialised Technologies

Rodrigo's picture

Hi,

I try to follow the tutotrial in http://souptonuts.sourceforge.net/postfix_tutorial.html creating the certificated according this tutorial http://www.debian-administration.org/articles/284 and I'm having this problems in the log (/var/log/mail.info).

Oct 5 17:28:09 lamp postfix/smtp[4854]: setting up TLS connection to smtp.gmail.com[74.125.134.108]:587
Oct 5 17:28:09 lamp postfix/smtp[4853]: setting up TLS connection to smtp.gmail.com[74.125.134.109]:587
Oct 5 17:28:10 lamp postfix/smtp[4854]: Verified TLS connection established to smtp.gmail.com[74.125.134.108]:587: TLSv1 with cipher RC4-SHA (128/128 bits)
Oct 5 17:28:10 lamp postfix/smtp[4853]: Verified TLS connection established to smtp.gmail.com[74.125.134.109]:587: TLSv1 with cipher RC4-SHA (128/128 bits)
Oct 5 17:28:10 lamp postfix/smtp[4854]: warning: SASL authentication failure: No worthy mechs found
Oct 5 17:28:10 lamp postfix/smtp[4854]: CDD6C7D73: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.134.108]: no mechanism available
Oct 5 17:28:10 lamp postfix/smtp[4853]: warning: SASL authentication failure: No worthy mechs found
Oct 5 17:28:10 lamp postfix/smtp[4853]: F16FB702C: SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.134.109]: no mechanism available

So I google that and this is what I try to follow this http://www.interphero.com/?p=221 and now my log says this:

Oct 5 17:28:11 lamp postfix/smtp[4853]: setting up TLS connection to smtp.gmail.com[74.125.134.108]:587
Oct 5 17:28:12 lamp postfix/smtp[4854]: Verified TLS connection established to smtp.gmail.com[74.125.134.109]:587: TLSv1 with cipher RC4-SHA (128/128 bits)
Oct 5 17:28:12 lamp postfix/smtp[4853]: Verified TLS connection established to smtp.gmail.com[74.125.134.108]:587: TLSv1 with cipher RC4-SHA (128/128 bits)
Oct 5 17:28:12 lamp postfix/smtp[4854]: warning: SASL authentication failure: No worthy mechs found
Oct 5 17:28:12 lamp postfix/smtp[4853]: warning: SASL authentication failure: No worthy mechs found

Oct 5 17:28:12 lamp postfix/smtp[4853]: F16FB702C: to=<****@gmail.com>, relay=smtp.gmail.com[74.125.134.108]:587, delay=21246, delays=21243/0.06/3.5/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[74.125.134.108]: no mechanism available)

 

I don't know what else to do, any help will be apreciated.

Regards


Chris Musty's picture

If you divert all your mail through Gmail's SMTP you will have to play by their restrictions. I know one of them is no more than 100 emails an hour - useless for mailing lists.

You can configure your VPS to send emails as suggested above without much work and thats what I recomend.

As for certificates I generally dont bother as SPF and not being on a spam list work great but if you really want to certify emails there are tons of tutorials for getting it working from your VPS.

Chris Musty

Director

Specialised Technologies

Jeremy Davis's picture

No doubt someone else will find that info useful! :)

fabvlvs's picture

count me among them.

Add new comment