Debian isn't capable of sending emails anymore - email

My VM-Ware VM running Debian 6 doesn't send emails since I moved to another house with another modem/router. I did a complete reinstall of Debian, but still I can't send email. My network adapter is set to 'Bridged' (with 'Replicate physical network connection state' enabled).
I installed an application that needs to send an email to work properly. But I can't finish it because I don't receive an email at all.
date | mail test#example.com on the command-line also doesn't work, so it hasn't something to do with the application.
Do I need to configure my router in order to send external emails from my VM?

I managed to solve the mailing-problems!
I needed to do two things:
Setting up a SMTP-server for Postfix because my ISP doesn't allow usage of port 25 without using their SMTP-server. See this reference for a how-to.
Then I needed to configure a 'send-from adress', because by default emails are sent from a localhost email adress. The SMTP-server doesn't recognizes this as valid and prevents the email from being sent. See this reference for a how-to.
It cost me almost a few days to solve it, but now I can receive outgoing emails from my Debian system :).

Related

Local email to root should not leave the host

I am trying to set up the most simple email server on an Amazon Linux 2 host for simple outbound mail (e.g. sending system messages). Following instructions on the net, I have installed mailx and sendmail. I am not committed to either package, I just want a simple setup with a minimal footprint. I have no problem switching to postfix if that is a better solution.
For configuration I have made the following changes.
/etc/sysconfig/sendmail:
DAEMON=no
/etc/mail/submit.cf (hostname obfuscated):
D{MTAHost}smtp.******.com
This works fine, and I am able to receive mail that is sent from the system.
There is a wrinkle. The anacron process is sending mail to the root account. However, rather than the mail being kept internal to the system it is being sent to the SMTP server. The SMTP server sends the message back to my host, which doesn't accept mail, and a loop is created when an 'undeliverable' message is send back to root on the host that doesn't accept mail.
How can I configure my system so email to root stays local and is not sent to the SMTP server? Any other 'best practices' suggestions would be welcome as well. And again, if switching to postfix is better, I am willing to do so (but will need configuration guidance).

Unable to send email using own domain

We are unable to send email from our own domain. We receive either "Host not match server certificate" or "Certificate is self-signed and untrusted."
These symptoms occur from kmail on ubuntu, thunderbird on windows, and thunderbird, on linux (and each on a different machine.) They also happen when trying to send direct (dmail.) Cloud-based mail like gmail (obviously) works.
Environment: home network with fiber link and internal high-speed switch. We receive all email to a single postfix install on freeBSD, and each user's MUA sucks mail from there via POP. We send directly from MUA to a relay box. This was provided by a friend until recently.
First we made sure it was not internal machine-specific. Kmail was able to ignore the exception until the last upgrade to version 20.04 kernels and corresponding kmail update. It's universal for our network.
We checked with our friend who provides the relay. All his certificates are up to date and valid. He doesn't show an exceptions coming from his server, so I presume it's on our end somewhere ... somewhow.
I tried using MUA-to-gmail.smtp.com and again got refused, "Message not transported." Seems to support the "it's our problem" issue.
I know very little about any network, server, mx, postfix, sendmail or other kind of configuration. What should I dig into, and how, so we can send mail again?

Local development environment for osTicket

I am developing custom features for osTicket and I need to setup a mail system that sends emails, locally, and can simulate several email inboxes.
My local development setup is vagrant with ubuntu precise 64. I already have the LAMP stack running.
osTicket needs to send emails (only internally) and needs to have mailboxes (osticket reads and processes incoming mail on selected mailboxes).
I installed postfix, but could not get it to work.
Thank You.
Recently, I installed osTicket for my company. It can allow you to setup SMTP, which can use your Gmail account to send email. It is simple to setup.
The only thing to keep in mind is you need to use "Allow less secure apps to access your account". See: https://support.google.com/accounts/answer/6010255?hl=en for more information.
Configure ssl://smtp.gmail.com as your SMTP address and port 465 as your SMTP port. Even if you are not using Gmail, you still have to put "ssl://" before your SMTP host name.

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.

sendmail and MX records when mail server is not on web host

This is a problem I'm sure is easy to fix, but I've been banging my head on it all day.
I'm developing a new web site for a client. The web site resides at (this is an example) website.com. I have a PHP form script to email visitors' requests to requests#website.com.
When I coded this on a staging server on a different domain, all worked fine. When I moved it to website.com, the mail messages never arrived. The web server is on a virtual host with a major ISP.
Here's what I've learned since then: My client's mail server is Microsoft Exchange on a box physically in their office. Whenever someone on the outside world emails requests#website.com, the mail arrives. But if the web server sends to the same email address, it fails every time. This is not a PHP problem. I secure shell in to the web server and have tested this both with sendmail and the UNIX mail application. I've also tested it by emailing various email accounts from the shell. I can email myself, for example, just nobody at the website.com domain.
In short, when I'm logged in to website.com, mail to requests#website.com, user#website.com, another_user#website.com all fail. All other addresses work fine. What I've discovered is those dropped emails are routed to the web server's "catchall" account where they sit in its inbox.
I've done an MX lookup on website.com. The MX record points to mailsec.website.com. I can telnet to mailsec.website.com port 25 and see the SMTP server.
It appears to me that website.com isn't doing an MX lookup when it's sending mail to requests#website.com. My theory is that it recognizes the domain as local, sees that there's no "requests" user account to deliver it to, and drops the mail into the catchall account. What I want is to force sendmail to do the MX lookup and send the message on to the Exchange server. I'm at wit's end here. I can't figure out how to do this.
For that matter, I may be way off base here and have misdiagnosed this entirely. Internet mail and MX has always seemed a black art to me, and my ignorance is certainly showing in this question.
I think the problem is that sendmail (your process) is talking to the local sendmail daemon. The local sendmail daemon thinks that because it is website.com, it should know how to deliver the email. Unfortunately, the actual address in the to field does not exist on the web server and thus it dumps it in the "catchall" mail box. You should talk to your ISP and have them update their sendmail configuration so that mail addressed to ...#website.com gets forward to the mail exchanger instead of being handled locally.
Sendmail by default guesses list of local email domains.
It can be turned off using the following line in your sendmail.mc file:
define(`confDONT_PROBE_INTERFACES',`True')
As root list local email domains before and after the change using:
echo '$=w' | sendmail -Am -bt
You will see which domains should be added "manually" to (usually) /etc/mail/local-host-names file after disabling auto-guessing.
After changing sendmail.mc:
Generate/compile new sendmail.cf file
Restart sendmail daemon (or send HUP signal)
tvanfosson basically has it, but as a temporary workaround, you should be able to change your script so that it mails 'user#mailsec.website.com', and then the mail will get delivered to the actual mail server.
Edit the tsm.cf file (in /etc/mail/ or similar) to include
FEATURE(relay_entire_domain)
between the DOMAIN() and MAILER() lines. Since you're editing the file, you may want to also improve security with
define(`confPRIVACY_FLAGS',``noexpn,novrfy'')
After changing the tsm.cf file (or any sendmail config file), restart or SIGHUP the sendmail process.
This change is necessary because the WWW and MX servers for the domain do not exist in the same process space; this FEATURE triggers sendmail to process messages for the domain using it's external delivery mechanism.
The edited portion of the tsm.cf file should look similar to this:
DOMAIN(website.com)dnl
FEATURE(relay_entire_domain)dnl
define(`confPRIVACY_FLAGS',``noexpn,novrfy'')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
What worked for me was to add an MX record on the webserver hosting the website, that points to the host assigned on the original domain name server. In the case presented here would be an mx record pointing to: mailsec.website.com
I'm new here. Wanted to extend RB_CWI answer, but I am not allowed to comment.
His solution worked great.
You are not required to define the DOMAIN().
However, on my system I was required to install the sendmail-cf package.
The instructions below were done on CentOS 6.5
First, install sendmail-cf
sudo yum install sendmail-cf
Then, edit the senmail.mc
sudo vi /etc/mail/sendmail.mc
At the bottom of the file add FEATURE(relay_entire_domain)dnl, so it looks like:
...
FEATURE(relay_entire_domain)dnl
MAILER(smtp)dnl # right above this line
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
Save the file, and restart sendmail.
sudo service sendmail restart
Got stuck on the same problem. MX points to an external Exchange server but php/sendmail did not lookup this record. Instead mails posted by WordPress on this webserver dropped in the catchall-mailbox.
Solution was to delete ALL mailboxes on the webserver. Now sendmail was interested in the MX and all mails went to the Exchange.
However, the Exchange uses the webspace's mail server as SmartHost for outgoing mails. As solution for this, we were able to use the FTP credentials for accessing the mail server. I assume this solution does not work on every provider on this planet, but in our case (all-inkl.com) it worked out.