Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #30, on June 2nd, 2012, 05:59 PM »
Personally I go for postfix, but yeah, same thing, if you're just after outbound email, that's the way to do it.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #31, on June 2nd, 2012, 06:07 PM »
I tried with sendmail but it's too complicated.. <_< <_<
I'm trying postfix now..
Re: Help with apache2
« Reply #32, on June 2nd, 2012, 06:37 PM »
-_-

This is what I did..
sudo apt-get install postfix

This is my /etc/postfix/main.cf:
Code: [Select]
# 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

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no


# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# in myhostname indicate il nome del vostro server. Meglio se gli date un FQDN tipo mioserver.home.local
myhostname = tsXXX561.server.topcloud.it

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

myorigin = /etc/mailname
mydestination =
relayhost = [smtp.gmail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = smtp
relay_transport = smtp
inet_protocols = all

# SASL Settings
smtp_use_tls=yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem

Then I created the file /etc/mailname with my hostname as content:
tsXXX561.server.topcloud.it


Then I created the file /etc/postfix/sasl_passwd:
Code: [Select]
[smtp.gmail.com]:587 gmail_username@gmail.com:gmail_password

Then sudo postmap /etc/postfix/sasl/passwd

sudo cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

service postfix restart

Still sends nothing...

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Help with apache2
« Reply #33, on June 2nd, 2012, 11:38 PM »
I had, for my own sanity, forgotten how fucked up server management can be...

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Help with apache2
« Reply #34, on June 2nd, 2012, 11:55 PM »
Quote from Nao on June 2nd, 2012, 11:38 PM
I had, for my own sanity, forgotten how fucked up server management can be...
I find those more insane who can navigate through all this without looking at documentation once.
The way it's meant to be

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Help with apache2
« Reply #35, on June 3rd, 2012, 12:03 AM »
Especially if they have Suhosin installed, ahah!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #36, on June 3rd, 2012, 12:46 AM »
I'm reasonably hardened and can reconfigure Apache for modest needs without referring to the docs, but other stuff like postfix, once I had it set up, I left it firmly alone!

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #37, on June 3rd, 2012, 11:29 AM »
I read a bit of documentation and I managed to setup a server (stock Ubuntu 11.10, which I upgraded to 12.04) with apache2, php5, MySQL, phpmyadmin, enable virtual servers, compile mods for apache.. in 2 days. It's pretty easy. But email servers are fu***ng complex. Sendmail is arabic, postfix is complicated (I set it up, I have no errors but I can't send mails.. I think it's a certificates issue.. gmail requires TLS..). I'm still trying with exim4 (Dragooon gave me a guide I'll try this afternoon).
Re: Help with apache2
« Reply #38, on June 3rd, 2012, 02:36 PM »Last edited on June 3rd, 2012, 02:58 PM
YEAHHH!! Managed to get exim4 to work (thanks Dragooon for the link)!! :D
I'm using my FQDN.. I gave up on Gmail as a relay for now.. :P

EDIT: Maybe I found the problem with Gmail and exim4.. if it's this is a stupid stupid stupid bug. In my Gmail password I have a $ symbol. In exim 'mainlog' I found these errors:

2012-06-03 14:28:15 xxxxxxxxx == username@gmail.com R=send_via_gmail T=gmail_smtp defer (0): expansion of "my_password_with_$_char" failed in gmail_login authenticator: unknown variable name "part_of_the_password_after_$"
Re: Help with apache2
« Reply #39, on June 3rd, 2012, 02:45 PM »
Is there a way to hide my hostname from the "Received: from" or "envelope-from", etc..?
Re: Help with apache2
« Reply #40, on June 3rd, 2012, 10:47 PM »
Are these packages used by exim4 or I can remove 'em?
m4{u} procmail{u} sendmail-base{u} sendmail-cf{u} sensible-mda{u}

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #41, on June 3rd, 2012, 10:49 PM »
apt-get should be able to deal with that for you, apt-get clean IIRC.

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Help with apache2
« Reply #42, on June 3rd, 2012, 10:50 PM »
Quote from MultiformeIngegno on June 3rd, 2012, 10:47 PM
As these packages used by exim4 or I can remove 'em?
m4{u} procmail{u} sendmail-base{u} sendmail-cf{u} sensible-mda{u}
If you installed via apt-get then it'll let you know if they're required when trying to remove them.

MultiformeIngegno

  • Posts: 1,337
Re: Help with apache2
« Reply #43, on June 3rd, 2012, 11:57 PM »
Thanks! :)
I noticed a "weird" behavior with CHMOD. I moved my SMF install to my VPS and to get everything to work properly I had to CHMOD 777 /cache, /attachments, /avatars, /mgal_data... Not even 775 was good! With /cache to 775 I got the error that cache folder hadn't the right permissions.. the same for the others.. it's not normal!

Maybe because owner is not root but a user I created to use for FTP?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Help with apache2
« Reply #44, on June 4th, 2012, 12:09 AM »
Well, that's because the owner:group of the files is totally different to the owner:group Apache is running as, so 777 is all that will work.