On Fedora 21, I had a simple script for sending emails
mail -a /tmp/attachment.txt -s "..." someone#somewhere.com
On Fedora 23, this no longer works.
No configuration file found at /home/mike/.esmtprc or /etc/esmtprc
I created the file and assigned correct permissions to it.
hostname = localhost.localdomain:25
(That's what Fedora 21 would send emails from: mike#localhost.localdomain.)
Well, now I'm getting
SMTP server problem Connection refused
Question: how do I get the mail command to work on Fedora 23?
Okay, seems like Fedora 21 must have had an email server running by default, but Fedora 23 does not.
In my
~/.esmtprc
I had to add
hostname = [SMTP SERVER THAT WORKS]:25
mda "/usr/bin/procmail -d %T"
And that worked. Thanks everyone anyway!
Related
I have a Centos server with exim installed. I am trying to send en email from the command line like this:
exim -v account#gmail.com
From: email#mydomain.com
To: account#gmail.com
Subject: test email
this is a test
^D
I have also tried:
echo 'test message' | mail -s Test1 account#gmail.com
as well as sending from a PHP script.
The result is the email times out. The logs indicate exim is timing out:
H=alt2.gmail-smtp-in.l.google.com [173.194.219.26] Connection timed out
I believe iptables are correct. I have scanned the server from an external IP and ports 25, 265 and 587 are open. (Not sure 587 needs to be since this will be a send-only situation most likely.)
I have also telnet'd to port 25 successfully. (Most of the successful resolutions I have found involved port 25 being blocked. I don't think that is the case here. I have also called my provider and checked. They claim port 25 connections are not blocked.)
I would appreciate some ideas.
Thank you.
I am trying to use an auto reply program for one of the users.
It works fine when I have user email address defined in .forward file but it gives following error when I put it in script:
Jun 28 12:25:38 localhost sendmail[5210]: s5SJPFkN005208: to="|/home/alpha/autoreply.pl", ctladdr=alpha#localhost (501/501), delay=00:00:10, xdelay=00:00:00, mailer=prog, pri=60446, dsn=5.0.0, stat=Service unavailable
Jun 28 12:25:38 localhost sendmail[5210]: s5SJPFkN005208: s5SJPckN005210: DSN: Service unavailable
Do I have have make any changes in sendmail configs (i.e. symbolic link etc)?
Thanks.
1.Have you checked problems mentioned in sendmail FAQ?
Sendmail-FAQ-3.11: Why can't my users forward their mail to a program?
2. On most linuxes sendmail uses procmail as local mailer program.
You may try to execute your script from ~/.procmailrc of the user.
The issue was /etc/smrsh did not have symbolic link for perl which can be defined as
ln -s /usr/bin/perl /etc/smrsh/perl
I have installed Bugzilla-4.4 in my new Ubuntu Machine. When I submit a new bug, I got the email sent notification. But the sent email is not received by the recipients . I am using Sendmail mail configuration in Bugzilla. I have also tested "Test" mail configuration in which the mail is logged in bugzilla-4.4/data/mailer.testfile successfully. When I check my mail.log file I found the following:
(1001/1001), delay=3+15:58:59, xdelay=00:00:00, mailer=esmtp, pri=47643784, relay=mailrelay.netcon.in., dsn=4.0.0, stat=Deferred: Connection timed out with mailrelay.netcon.in.
I have no idea what to do.Is anything I missed out while Sendmail configuration? Any help!!
Try nc from command line:
nc mailrelay.netcon.in 25
which should result in something like:
220 mailrelay.netcon.in ESMTP Postfix
If not check for internet connection and/or router firewall rules.
While working locally on the dev server, GAE doesn't send any emails out. Unless running it with the following command:
dev_appserver.py --enable_sendmail myapp
This would rely on a local sendmail to be setup.
I am using Ubuntu now for some time and I never came across something so difficult to setup.
I came across this solution and 5 other tutorials. The mail.log shows that the email was accepted and sent out, but google times out.
Jun 28 12:13:38 tp sm-mta[15964]: r5SAnXFV014925: to=<kave#gmail.com>, ctladdr=<kave#localhost.localdomain> (1000/1000), delay=00:24:05, xdelay=00:00:00, mailer=esmtp, pri=210342, relay=alt4.gmail-smtp-in.l.google.com., dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com
I would be happy to give up and rely on the log files. But the command line ouput doesn't show the email body:
INFO 2013-06-28 11:17:40,146 mail_stub.py:140] MailService.Send
From: admin#mydomain.com
To: kave#gmail.com
Subject: Invitation to join xxx
Body:
Content-type: text/plain
Data length: 347
It is so frustrating. Any ideas please?
Update:
I have tried to run it with the VM arguments:
But I get this error message:
I ran into this same issue a couple weeks ago. I ended up adding the following VM arguments to eclipse when running the DevAppServer:
-Dmail.log_mail_level=WARNING -Dmail.log_mail_body=true
Whenever I run a simple send email function using Email::Send::Gmail I get this error:
[Mon Jan 28 11:37:57 2013] [error] [client 31.171.245.] Error sending email: Email::Send::Gmail: error connecting to server smtp.gmail.com at /usr/local/share/perl5/Email/Send.pm line 252, referer: http://**.cgi
However, exact same code is working when run from command line. And smtp.gmail.com is available when telneting from command line. It this because of the persistence or am I missing something?
Alrgiht, I got it. Seems selinux on CentOS was blocking outside connections from httpd, thus the script was not connecting.
You need to enter this
setsebool -P httpd_can_network_connect=1
In order to connect.
Try (in your cgi script) doing this:
use Net::SMTP::SSL;
Net::SMTP::SSL->new( 'smtp.gmail.com', Port => 465, Debug => 1 );
and see if the debugging information tells you anything helpful.
Is it possible that your cgi script is using a different perl, with different modules installed?