What mail sever can I use for linuxmint for send email from localhost? - linux-mint

I am using linuxmint Os. I want to send email from local host.
Please suggest me a good compatible mail server.
What mail server can I use ?
How to install and configure ?
Any help is appreciated !

What you need is a so-called MTA. If you only need to send outgoing mail, sendmail should be sufficient. Otherwise, have a look at Postfix, it's relatively easy to set up and configure.
Note: When you operate a mail server on a public machine, make sure it cannot be abused as open relay!

Related

Sendmail Relay Issue

I have installed sendmail on Centos 7 and setup relay server using SMART_HOST.
But sendmail is not using my relay server when sending email, it keeps using localhost.
Can anyone help me to solve this problem?
Sendmail-8.12+ by default relays messages submitted locally to local main sendmail daemon running at 127.0.0.1:25. It does it as a security precaution to avoid installation as set root uid.
Have you checked sendmail log files? They should show where main local sendmail daemon relays messages to non local email addresses.
Documentation: SECURITY file in sendmail distribution
I found the answer myself.
The mistake was with LOCAL_DOMAIN.
I had put my local domain (which was used for mail server and email address) here.
And all of my emails were being handled as local emails.
Local emails were meant for excluding from relay, lol.

Simple way to setup MTA on FreeBSD only for PHP mail()

I need to setup mail server for sending from PHP scripts only. I'm not needed to receive email or sending it by another way. Preferable is the Postfix (it is easy than Sendmail, for example). Ssmtp is doesn't suit me.
Is there some manual or ready-to-run config for this?
ssmtp has the big disadvantage to loose mails if the mailhub server is not reachable.
there should be at least some spooler for this scenario.
freebsd handbook is the best resource about your requirements:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mail-using.html
https://wiki.freebsd.org/SecureSSMTP
i prefer ssmtp

How do I send mail from my ruby on rails application?

How do i send mail on my ubuntu system. I need to send mail in my ruby on rails application but can't test, because mail isn't being sent. What do i need to do on my system. (now testing this app is making me realize why mail wasn't being sent through that Evolution thing i have installed)
The Evolution thing is an MUA (Mail User Agent) like Outlook, Thunderbird, or any number of programs intended for user to read and create email messages. Your program is also a limited MUA (likely creation only).
You need to send your e-mail to an MTA (Mail Transfer Agent). If you configure the return address correctly, you may be able to use the same MTA that you connect to with Evolution. In this case the SMTP server used to send email. If you are using one of the e-mail libraries you should be able to specify the SMTP server name as well as a user-id and password if required.
Many packages require an MTA so you may have Postfix, Exim4, or Sendmail already installed. Check for programs listening on port 25. If so you can use localhost as your SMTP server. If you need to send email other systems you may need to configure your MTA as a satellite to your ISPs server which will relay your message out to the Internet.

automation: email yourself a file

I have a computer at home which I can't access from work. I'd like to be able to view results from work that my home computer produces. The best idea I've come up with is an automated script running on my home computer that emails myself the results (from a text file or stderr/out) when complete.
I'm decent with bash (I have a linux machine) and java, so an answer using either or both of those would be ideal, but if there's something easier that's fine too.
I typically use gmail, but also have yahoo mail.
My question is this: what would be the basic steps in solving this problem? I can do the nitty gritty stuff, but can't really get the big picture of how something like this would work.
Please help.
jbu
Howto set up ssmtp to send through a Gmail account
Some of the steps here might seem strange at first, but the rationale is put
in footnotes that should hopefully explain why.
First create a spare account on gmail which you will only use for
sending email. For instance, if your normal account is user#gmail.com,
create an account user.noreply#gmail.com with a newly created password
which you only will use for this account [1].
Set up the new account to forward all email to the normal account [2]
and under account settings you should add all other email adresses you
use [3].
Then install ssmtp (On Debian: aptitude install ssmtp) and edit ssmtp's configuration file /etc/ssmtp/ssmtp.conf:
root=user#gmail.com
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
AuthUser=user.noreply
AuthPass=passwdusedonlyforthisaccount
FromLineOverride=YES
and configure the local mail delivery by editing /etc/ssmtp/revaliases
assuming that your local login is localuser:
root:user#gmail.com:smtp.gmail.com:587
localuser:user#gmail.com:smtp.gmail.com:587
Make sure the two configuration files are readable to all users who
should be able to send email [4].
Test the setup by e.g. mailx (On Debian: aptitude install bsd-mailx):
echo 'testing, one, two' | mailx -s 'test 1' user#gmail.com
Hope this helps.
[1] The new gmail user name and password will be visible to everyone who
can log onto your machine, so you do not want this account to be
critical in any way, meaning you can close it down immediately if
someone should get access to it.
[2] If some email you sent bounces back to you, you might want to know
about it, and there actually exists people who will happily reply to an
email from johnsmith.noreply.
[3] Gmail will rewrite the From header on the email if it does not recognise the address.
[4] Ssmtp runs as the local user who sends the email, so that user needs
read access to the configuration files.
On any Linux I have used the mail sending from command-line is simple:
mail -s "My subject here" recipient#wherever.com <message_body.txt
AFAIK this acts as a front-end to sendmail, and you have to have sendmail configured to forward the messages to your ISP mail server.
You can't access your home computer from work which rules out a "remote support" option.
Can you access other computers on the Internet? If so, you could simply set up one of the online storage options and then ftp the results from your home computer. That's a lot simpler then trying to write scripts or code to generate emails with attachments or whatever.
You could then view the external computer from work.
If you have netcat, this command will send you an e-mail:
Given a file in this format (from Wikipedia):
HELO relay.example.org
MAIL FROM:<bob#example.org>
RCPT TO:<alice#example.com>
RCPT TO:<theboss#example.com>
DATA
From: "Bob Example" <bob#example.org>
To: Alice Example <alice#example.com>
Cc: theboss#example.com
Date: Tue, 15 Jan 2008 16:02:43 -0500
Subject: Test message
Hello Alice.
This is a test message with 5 headers and 4 lines in the body.
Your friend,
Bob
.
QUIT
Then netcat it to an SMTP server you have access to:
nc mail.somewhere.com 25 < file.txt
This will then send the e-mail. You can see how you can create a Java program to do this for you (just execute the commands).
Traditionaly, with unix systems like Linux, you'd have an MTA, a mail transfer agent, on the computer that deals with sending e-mail.
This could be a full blown e-mail server like exim, or something simple like ssmtp that just sends messages on to a relaying SMTP server such as would be provided by your ISP.
This isn't neccessarily the case anymore, since mail clients like Thunderbird include their own MTA, much like mail clients on Windows do.
However, it is likely that your distro will install some MTA or other by default, if for no other reason than the fact that other things on your system, like cron, want to be able to send e-mail. Generally there will be a command line tool called sendmail (sendmail being the original MTA [citation needed], other MTAs maintain compatability with its interface and it has sort of become the standard) that can be used from a shell script to send an e-mail.
My solution assumes that you have a SMTP server available which allows you to send an email programmatically. Alternatively, you can use a local install of sendmail which generally is available with most linux distros.
Create a standalone java program which watches the directory your home computer saves the file to. Use the JavaMail API to attach and send the file to any email you wish.
If you're also familiar with the Spring Framework, it has a nice abstraction layer for working with JavaMail and makes this sort of thing trivial.
Of course, your home ISP probably has the common SMTP port blocked as well.

Mail server with smart-host

I want to create a mail server, but my ISP does not allow reverse-IP record, so I ordered a VPS with such function. But I want use VPS only as a relaying server and my own server as an actual mail server (so it should have things like web-mail, and some other). I did not find any guides, but looks like VPS will be called a "smart-host". So I installed Axigen on my server, but it requires login and password for connecting to a smart-host. I tried to use postfix for relaying but I did non figure out how to properly configure it. What are my options?
Thank you!
To securely enable postfix as a mail forwarding server, you'll have to enable and configure SASL authentication. The postfix SASL README has all the details. I suggest dovecot as the backend, as it's the simplest to setup. After that, just create a new system user (adduser mail-forwarding) and configure Axigen to use that user for forwarding.
If I understand correctly, your goal is to forward outgoing mail from your local server to the VPS while incoming mail should be stored on the local server. This is possible, but not necessarily simple. Mail needs to be handled differently depending on how it reaches your local server, otherwise you might end up with a mail loop, with your servers playing pingping using mail sent back and forth.