Postfix pipe does not load user's full variable

9 views
Skip to first unread message

Andrei Cristian Petcu

unread,
Mar 8, 2016, 1:26:09 PM3/8/16
to Alaveteli Dev
Hi all,

My new testing instance of Alaveteli https://test.nuvasuparati.info/ has
an issue: postfix will run mailin with only a limited PATH variable that
has only two locations: /bin and /usr/bin and I want it to be ran with
the entire PATH variable of my user which contains also
/home/deploy/.rbenv/shims besides the usual /usr/bin:/bin. How can I do
this?

mailin does not see rails since it does not see the rbenv gems so it all
fails. If I run mailin with the deploy user and not trough postfix it
works (at least it sees rails and other gems).
sudo su - deploy
cat /tmp/foi-mailin-mail-yyN6AMqL | script/mailin

I asked the question on SO since it is postfix related and I posted more
details there. http://stackoverflow.com/q/35874667/1387563

On my old Alaveteli instance I have exim4 and configs are different
there and I cannot reuse them.

PS: I configured the whole testing server including the DKIM DNS entries
with Ansible. The plan is to add Let's Encrypt to the Ansible tasks and
have automated HTTPS certificates :)
dig TXT rsa1._domainkey.test.nuvasuparati.info.

Thank you,
Andrei Petcu

signature.asc

Gareth Rees

unread,
Mar 9, 2016, 5:15:07 AM3/9/16
to Alaveteli Dev, and...@ceata.org
Hey Andrei,

We have a bit of documentation about using rbenv on the wiki [1].

The gist of it is that you can generate a 'run-with-rbenv-path' wrapper that sets the PATH correctly.

Have a look at that and let us know if that helps.

PS: I configured the whole testing server including the DKIM DNS entries 
with Ansible. The plan is to add Let's Encrypt to the Ansible tasks and 
have automated HTTPS certificates :) 
dig TXT rsa1._domainkey.test.nuvasuparati.info

and...@ceata.org

unread,
Mar 9, 2016, 5:52:14 AM3/9/16
to alavet...@googlegroups.com, Gareth Rees
Hi Gareth,

Thank you for your reply.
I think this will work.

Andrei
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Andrei Cristian Petcu

unread,
Mar 9, 2016, 1:48:12 PM3/9/16
to alavet...@googlegroups.com
Gareth,

Your solution worked, here is the commit:
https://gitlab.com/andreicristianpetcu/infrastructure/commit/a1772664d7d6d939f10539aa2f13dfcc2108b90d?view=parallel

Now I get error stating that runner.rb:54:in `eval': Connection refused
Here are the input and output files of the email.
https://my.owndrive.com/index.php/s/j5cTyH0kt7atRFW

I see the Incoming message in the Alaveteli admin interface but it has
no fields set inside.

How can I troubleshoot this?

Thank you,
Andrei Petcu

On 03/09/2016 12:52 PM, and...@ceata.org wrote:
> Hi Gareth,
>
> Thank you for your reply.
> I think this will work.
>
> Andrei
>
>
> On March 9, 2016 12:15:07 PM GMT+02:00, Gareth Rees
> <gar...@mysociety.org> wrote:
>
> Hey Andrei,
>
> We have a bit of documentation about using rbenv on the wiki [1].
>
> The gist of it is that you can generate a 'run-with-rbenv-path'
> wrapper that sets the PATH correctly.
>
> Have a look at that and let us know if that helps.
>
> PS: I configured the whole testing server including the DKIM DNS
> entries
> with Ansible. The plan is to add Let's Encrypt to the Ansible
> tasks and
> have automated HTTPS certificates :)
> dig TXT rsa1._domainkey.test.nuvasuparati.info
> <http://domainkey.test.nuvasuparati.info/>.
> <http://domainkey.test.nuvasuparati.info>.
>
> Thank you,
> Andrei Petcu
>
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Alaveteli Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to alaveteli-de...@googlegroups.com
> <mailto:alaveteli-de...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


signature.asc

Gareth Rees

unread,
Mar 10, 2016, 4:50:25 AM3/10/16
to Alaveteli Dev, and...@ceata.org
Hey Andrei,

It looks like the app is having trouble sending mail. The bit its getting to is:


Are you able to make a request through the app and have it send the mail?

We have a postfix troubleshooting section in our email configuration guide:


Have a look through that and see if that helps. If not, send us some output from those commands.

Cheers,

Gareth
Reply all
Reply to author
Forward
0 new messages