Keith2 / lowendscript-ng

20 stars 10 forks source link

Doesn't prompt for SMTP settings (friendica at home) #15

Open koen84 opened 9 years ago

koen84 commented 9 years ago

I'm trying to run friendica at home. (Actually just a proof of concept, so I know if I can get it up and running or get stuck like last time, before I suggest it to a group.)

Sending mail (user registration) only works via specifying smtp server + login. (Also via php_ini(), as I've done that in some of my own scripts.)

https://github.com/friendica/friendica/wiki/How-to%3A-Hosting-a-Friendica-site-at-home This seems to be using your script and says : 10) You will be prompted to enter your (normal) email address, your domain (which should be your DynDns subdomain) and a legitimate SMTP account to relay mail from. The latter can be taken from the SMTP settings in any standard mail client you use - also use the port specified there.

The SMTP question did NOT happen. So while the install is working, I can't login, I can't admin, etc. Okay, I fixed it with by editting the mysql-db and a suitable password generated here http://wiki.tonybaldwin.info/doku.php?id=hax:misc:fpassgen

Still, user registration and any email based functionality won't work. (On an at-home server, that is.)

Keith2 commented 9 years ago

That's for a version of the script used in a downloadable virtualbox file at http://downloads.friendica.eu/Friendica.zip which is intended for home installation, although a bit old, using Debian Squeeze. There's not been any demand before for setting the SMTP to be included.

This should also work, add to /etc/hosts, if not already there 127.0.0.1 localhost.localdomain

In /etc/postfix/main.cf add , localhost.localdomain to mydestination restart postfix. You should be able to use an email address of root@localhost.localdomain Unless you have reconfigured postfix, look at the file /var/mail/root for your email. Correction - look in the user's Maildir (using latest version of the script)

koen84 commented 9 years ago

Prepared VirtualBox Friendica doesn't match my aim of testing if I could get it installed (to potentially be ran on a VPS later), so I'm working off a Debian 7.7.0 minimal x64 (in XenServer). Also, that download is not accessible for a while and as you said, outdated Debian Squeeze.

Previous attempts I changed the email to something existing.

Now I've started afresh, with the last version of the script fetched from github, and left the default EMAIL=$USER@[127.0.0.1] but no email seems to be arriving.

Since my goal would be to run it on VPS, not at home, this is not too relevant for me (except for a dev environment), but I thought it might be useful to know.

koen84 commented 9 years ago

I'm talking about the setup-debian.conf that gets opened in the very beginning... I just remember that right before finishing it also asks for an email address, which I still used an existing one rather than root@127.0.0.1

What's the difference ? And am I then to assume that first friendica registration gets admin access ?

Keith2 commented 9 years ago

The 127.0.0.1 email address is for system generated emails such as those from cron, it is not used by friendica. Look in the Maildir of the user for any emails. When you run the friendica option, you enter another email address, not a 127.0.0.1 address. When you register using this email address you are the admin. Use another email address and you are not the admin.

koen84 commented 9 years ago

Let me check if I understand.

bash setup-wheezy.sh all

opens in the beginning setup-debian.conf EMAIL=$USER@[127.0.0.1] left as is, for a VPS should be something like webmaster@example.com ?

bash setup-wheezy.sh friendica [local IP]

opens in the beginning setup-debian.conf EMAIL=$USER@[127.0.0.1] left as is, for a VPS should be something like webmaster@example.com ?

asks at the end "Enter admin email" I put me@example.com, but I should've put root@127.0.0.1 or root@localhost.localdomain ? this email, wether @example.com or @127.0.0.1, will hold the admin access ?

I think I read friendica uses one or more cron jobs ? So the "127.0.0.1 address" from the setup-debian.conf would have important friendica related mails ? Or only systems ?

And, /home/[user]/Maildir didn't contain emails. (I also tried mailx -u [user]

Sorry for the noob questions, this is around the edge of my (limited) knowledge. (Understanding the ins and outs of a mailserver is still on my TODO.)

Keith2 commented 9 years ago

bash setup-wheezy.sh all will ask for you enter a user, my default user is keith so the email address would be keith@[127.0.0.1], unless I changed it to something else. This is the address used in /etc/aliases for all system users (except for nobody using /dev/null). The 127.0.0.1 address will receive friendica emails only from cron, not from friendica. Look at /var/log/mail, are there any error messages about your emails there?

koen84 commented 9 years ago

Checking /var/log/mail was the last I did yesterday and since it showed connection timeout for the mx records on my domain, I knew I shouldn't check for emails in local folders but rather redo the bash setup-wheezy.sh friendica [local IP]

There's two things I can think of

Do you know / remember how the SMTP / email was setup in the http://downloads.friendica.eu/Friendica.zip ? Because that should work in this case too.

Keith2 commented 9 years ago

Will look at this tomorrow, I have a working example. In /etc/postfix/main.cf add

smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd smtp_always_send_ehlo = yes relayhost = example.com

for saslpasswd use example.com user:password