Re: VM appliance I can download

Hi Yann,

Thanks for your interest! I’m building an image with the latest releases
(you can choose between the standard and foodcoop-adam fork on first
boot), will provide a download link for an ISO when that’s done. Please
not that the virtual machine image is going through testing, but it
should be ok.

Cheers,

  • Willem

p.s. feel free to use the mailing-list at
http://foodsoft.51229.x6.nabble.com/foodsoft-discuss-f5.html :slight_smile:

Hi Willem

Thank you,
My plan is to test it first before deploying a production environment.
Can you point the main differences between this version and foodcoop-adam fork?

Thank you, Yann

Hi Yann,

Sounds good.

Standard foodsoft is what most people use. In the foodcoop-adam fork a
number of things have changed:

  • User-interface cleanup, hide elements that aren’t really relevant
    (for us right now).
    o removed: foodcoop, invoices, stock (menu items only)
    o member ordering screen was changed (doesn’t show all details though)
  • Plugins
    o signup: allow prospective members to signup for an account
    o mollie: online payment (including handling membership fee)
    o current_orders: to work on all open-but-not-yet-closed orders
    (e.g. printing a single list from different suppliers)
    o mailall: get email addresses from all members
    o userinfo: allow to login into other systems (phpBB) using
    foodsoft account
    o demo: can auto-create users on login, for a demonstration website
    o uservoice
  • Allow to directly send order email to supplier when closing an order.
  • Support direct import of Excel/OpenOffice.org files
  • Allow different price_markup percentages for different ordergroups
  • and much more

The VM image currently contains standard foodsoft, and foodcoop-adam’s
master branch.
At some point, I want to merge foodcoop-adam’s branches to standard
foodsoft, but that still requires some work.

Ok, I’ve built a virtual machine image:
https://order.foodcoop.nl/foodsoft/turnkeylinux-foodsoft.iso
Please note that (a) it is still in testing phase, please report and
issues you might find; and (b) this is only a temporary location until
the next version of TurnKey Linux, which will include Foodsoft henceforth.

After you’ve downloaded the image, create a virtual machine with the ISO
attached, run from CD and install the Foodsoft app to hard drive. Answer
the questions on next bootup, and you have a working Foodsoft
installation. Then you probably want to log into the appliance, and edit
/var/www/foodsoft/config/app_config.yml (after which you’d want to
restart the webserver).
The only relevant data is the database, so if you want to migrate just
store the database dump (or use TKLBAM).

Hope that gets you going!

Best,

  • Willem

p.s. Most of foodcoop-adam’s plugins will also work on standard
foodsoft. Read more… https://github.com/foodcoops/foodsoft/wiki/Plugins

p.p.s. In addition to the two versions mentioned, there is
foodcoop-adam’s feature-group_order_ajax-adam branch where most of my
work is happening right now. This is sometimes a bit experimental code,
though. Additional features here:

p.p.p.s. thanks for continuing the discussion on the mailing-list, so
that everyone can participate.

Thanks so much. It is really good to have it working in production.
So far the only problems are with the invitation email.

there are character signifiers (’&lt’, ‘&quot’) in the email body, and this seems to happen as a result of irregularities in, and the url does not work because it includes the port number 3000.

I think that comes from config/initializers/load_app_config.rb because it contains references to “FoodsoftConfig[:host]” (which is also found in /app/mailers/mailer.rb) as well as the following:

url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port]

other possibly relevant references I could find were

@link” in /app/views/mailer/invite.text.haml

which seems to be defined in

@link = accept_invitation_url(token: @invite.token)” in /app/mailers/mailer.rb

Hi Angelo,

I’m glad it’s useful to you!

As for the wrong url (port), there is configuration in
config/app_config.yml that sets this. What happens if you remove or
comment port line altogether? You may also need to set the host at the
same place.

Regarding the character siginifiers, would you like to send the raw
mail? (anonymised is ok)

  • Willem

I would think taking out the action mailer port number in config.yml would break the outgoing mail capability, but I’ll try it!

Before I do, I’ll send you an invitation to the email address I have for you.

After eliminating the port number in app_config.yml the invites are no longer received….Oh, wait. It just came in. but it took 5 minutes. Ok good.

I looked into removing the lt and rt signifiers in the mailer file I found the emails templates in (can’t remember where, now), but the quoting was too complicated, and the email is working after all, so I’m happy.

Now that the emails are going out, I would like for them not to trigger spam filters. One way to reliably do this is to configure action mailer to send email through gmail as per instructions here:
http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration-for-gmail
The instructions say to modify config/environments/$RAILS_ENV.rb which unfortunately does not exist. (Can I just create it?)

Gmail seems to not like that the email address specified in app_config.yml does not match where the email is really coming from. How does this work? What can I enter as the sender email in app_config.yml that will not make receiving filters think its a spoof email? Do I just make up an email address@myserveripaddress?

Hi Angelo,

Thanks, I received the mail you forwarded (but not the invite). There is
indeed a bug in Foodsoft, which I just fixed.
The easiest way to fix that on your existing VM right now, is to apply
the patch manually - if you are comfortable with that.
https://github.com/foodcoops/foodsoft/commit/0b08d461fa8d2e9e78aeb5fc5ed037415e901e29
which just adds “raw” in front of the lines starting with “t”. This
avoids the escaping.

If you’d rather have a new VM image, let me know.

  • Willem

Hi Angelo,

Great you found instructions for using an external mail transport agent.
With recent spam measures by providers, it is no luxury to set the
“From” header to something that can be verified (see, for example,
http://www.dmarc.org/ ). This can be done in the foodcoop config in
config/app_config.yml with the email_from option. When using GMail, set
this to your GMail address. When using your own domain, you may want to
include your server’s ip-address in the SPF record for the email domain.

Using noreply@my.ser.ver.ip may work, but I’m not sure of the (eventual)
consequences when you’re not running a (fully maintained) mailserver
(e.g. the effects of repeated bounces, dialup/consumer lists that some
mail providers use). I’d say using GMail is the easiest. As long as
you’re not exceeding mail volume limits (e.g. mass invitations, messages
to all members and order result mails).

Cheers,

  • Willem

Thanks again. It appears I will not be required to use external mail transport agent since SPF authorizes my email at the DNS level. For anyone reading this, here’s the gist:

And thanks for the fix on the escaping text in the emails. I’ll just do the manual fix.

Good to hear it’s working out. I’m curious to hear how you’ll be doing.

Cheers,

  • Willem

Okay. So the SPF specification made it so gmail users receive their invites, but yahoo completely rejects them. They aren’t even in spam.

Did you set the From header to your address with the SPF record?
Note that it may take up to a couple of days for DNS changes to
propagate (even with small TTL).

Did you set the From header to your address with the SPF record? Note that it may take up to a couple of days for DNS changes to propagate (even with small TTL).

I did set the from header and SPF header as you instructed. When I did, Gmail instantly stopped marking as spam, but yahoo (and your mail) still rejects. I’ll give it a couple days.

set the From header to your address with the SPF record

Oh wait. No. I did not do that, exactly. I set the SPF record to the ipv6 server address and the From header to a the .org email address I write to you with… It makes sense that it works with google because the .org email address I write you with is done through gmail servers.

Before I added any spf record, gmail users were receiving the mail from the system as spam. Right after I created the spf record, gmail users all started getting their mail. At that point I decided to check with yahoo users (and @foodcoop.nl uses), and they are not. When I check the full message of the messages that the gmail users are receiving, I see that the spf record is working (Received-SPF: pass …see below).

I tried setting the From header to “postmaster@serveripaddress”, so that there was complete agreement between the SPF record and the From header. That made it so that gmail users could not receive their messages, and it did not help with the others either, so I put it back to the same address I write you with (hereafter sender@myactualcoop.org)

I then tried setting the DNS for our coop website to point to the local VM in case that’s the problem, but no results.

The next thing I tried was adding google to the spf record (https://support.google.com/a/answer/4568483?hl=en&ref_topic=2759192), since sender@myactualcoop.org is handles through gmail servers.

Here’s the full message from one of the successful emails:

Delivered-To: receive@gmail.com
Received: by 10.202.50.69 with SMTP id y66csp925763oiy;
Thu, 4 Sep 2014 12:32:16 -0700 (PDT)
X-Received: by 10.182.137.195 with SMTP id qk3mr7815649obb.5.1409859136446;
Thu, 04 Sep 2014 12:32:16 -0700 (PDT)
Return-Path: sender@myactualcoop.org
Received: from localhost ([my:ip6:addr:ess:000:0000:0000])
by mx.google.com with ESMTP id ki2si3889565oeb.90.2014.09.04.12.32.16
for receive@gmail.com;
Thu, 04 Sep 2014 12:32:16 -0700 (PDT)
Received-SPF: pass (google.com: domain of sender@myactualcoop.org designates my:ip6:addr:ess:000:0000:0000 as permitted sender) client-ip=my:ip6:addr:ess:000:0000:0000;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of sender@myactualcoop.org designates my:ip6:addr:ess:000:0000:0000 as permitted sender) smtp.mail=sender@myactualcoop.org
Received: by localhost (Postfix, from userid 33)
id CFEDE6DFA; Thu, 4 Sep 2014 07:58:40 +0000 (UTC)
Date: Thu, 04 Sep 2014 07:58:40 +0000
From: FoodSoft sender@myactualcoop.org
Sender: sender@myactualcoop.org
To: receive@gmail.com
Message-ID: 54081bb0cb13a_c2d35051248286d@foodsoft.mail
Subject: Invitation to the Foodcoop
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
errors-to: sender@myactualcoop.org

Perhaps yahoo doesn’t like the message-ID?

I am out of guesses

Short question: why didn’t you add the ipv4 address?

I did not use the ip4 address because google would compare it to the ipv6 address and it would fail SPF. So I just copied the address google was comparing it to into the SPF record and it passed.

Since I’m trying everything under the sun, it might be fun to put the ipv4 address in the SPF record as well, although such methods are deemed “common mistakes” at openspf.org. There is some discrepancy on the matter of whether to use “-all” or “~all” in the record.

I have been working on this solidly since last we checked in. In the end I used relay with a mailserver maintained by dreamhost, but I kept on getting “no mechanism available” errors from postfix.

Nothing worked except installing a missing sasl component.

http://www.turnkeylinux.org/forum/general/20120916/configure-php-mail-lamp-appliance-gmail#comment-21239

Now all users are getting mail.