Back

Need help with new Linux / Ubuntu VM

#1
I really need a solution to test emails in my web development virual machine. I have Ubuntu with php, mysql, etc.

In OSX I used to have a very simple app that create a fake mailing service. I didn't need to change anything in my code, the production code was the same as local. Php would send an email, and the app would catch it and let me see how it is formatted etc.

In Ubuntu I have searched for a while. All I can find are articles about installing a complete mail server. I'd like to find another solution if possible, that involves the least amount of fiddling with my VM.
Reply
#2
Would something like FakeSMTP do?

https://nilhcem.github.io/FakeSMTP/
Reply
#3
Fantastic, thanks! The java app works. Now I just need to install sendmail or ssmtp I think, there are instructions on AskUbuntu I will try tomorrow.
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
#4
You will only need 1 smtp (fakesmtp, sendmail, postfix, exim, qmail, whatever).
Avoid sendmail at all cost as it is famous for being the less "user friendly" of them all (m4 macro and the dreaded sendmail.cf black magic).

I think by default ubuntu comes with postfix.
From memory, exim comes with a really really nice "config" script that ask question and fill the config file accordingly.
Reply
#5
I'm confused now. Thought FakeSMTP was just the gui. Wait FakeSMTP says "Configure your application to use "localhost" as your SMTP server"... maybe I can do that in the php.ini
Reply
#6
Tried to install ssmtp and this happens:

Code:
WARNING: The following packages cannot be authenticated!
  libgnutls-openssl27 ssmtp
Install these packages without verification [y/N]? y
Err http://security.ubuntu.com/ubuntu/ raring-security/main libgnutls-openssl27 amd64 2.12.23-1ubuntu1.1
  404  Not Found [IP: 91.189.91.14 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls-openssl27_2.12.23-1ubuntu1.1_amd64.deb  404  Not Found [IP: 91.189.91.14 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I have a Ubuntu 13.04 VM that is a couple years old. Stopped installing security updates because I've wasted so much time already fixing this and that.

I did

> sudo apt-get update

Sad
Reply
#7
ファブリス Wrote:I'm confused now. Thought FakeSMTP was just the gui. Wait FakeSMTP says "Configure your application to use "localhost" as your SMTP server"... maybe I can do that in the php.ini
FakeSMTP should setup a fake smtp server at localhost:<whatever port you chose in the GUI> and also show the messages 'sent' via the server.
Reply
#8
I thought FakeSMTP is just the server that collects the mails, and you need something to route php mail() to the server? That's why I looked into ssmtp. It seems I still need to set something in php.ini (sendmail_path) for Linux.

On Windows it lets you put the SMTP server setting directly in php.ini and seems to handle the mail sending without another external program.
Reply
#9
I made the mistake of installing a non-LTS version :/ So lots of packages are no longer available.

Thinking of making a new VM with Ubuntu 14.04.3-LTS ... the hair raising begins.
Reply
#10
Finally! Managed to install ssmtp by pointing sources to old releases. Creating a new VM is going to take forever >_>

With FakeSMTP and ssmtp I was able to catch emails.

FakeSMTP displays them in raw. After setting file association I can double click the eml file to display it in Thunderbird!
Reply
#11
ファブリス Wrote:Finally! Managed to install ssmtp by pointing sources to old releases. Creating a new VM is going to take forever >_>
Excellent Smile

I don't know which VM software you are using, but can't you clone your finished VM?
Reply
#12
Unfortunately I picked the wrong Ubuntu version when I made it. It is also my fault, I was so tired of configuring Linux.. I stopped all updates for at least a year. However even if troubles came, I should have made a backup of the VM instead, and risk the updates. Which is why now I can't find a way to update 13.04.

I managed to find some packages by editing the sources file as described here:

https://help.ubuntu.com/community/EOLUpgrades

... but I have not been able to upgrade to even 13.10. The "dist-upgrade" part fails.

What's super frustrating is that I am one of few people experiencing an obscure redraw issue in gvim that seems to be linked to using Virtual Box, Windows 7 Host, 3D Acceleration, and whatever rendering is in Unity (Compiz?).

This bug is driving me insane, because it's the *only* thing that forced me to use an older Guest Additions version (4.2.12), along with an older Virtual Box version. And now I found that 4.2.12 can not be compiled in 14.04 due to X-Org Server something 1.5 being supported from 4.2.28 up, which presents the redraw issue in gvim.

Since gvim is absolutely essential in my workflow... I have resigned to install 14.04 (LTS) with MATE.

EDIT WOOOHOOOO. Nevermind, finally found a workaround for this bug involving Compiz Config Setting Manager.
Reply