LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-30-2015, 06:30 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
[Email] I can't send email from my server


Hi,

As I try to send an email with following command:
Code:
 echo "this is a test" | mail -s "Test" thomas.2004@mycom.com
I got nothing.

I check the postfix and it's ok. I check the port with
Code:
netstat -ntpl  |grep "127.0.0.1"
and I get:
Code:
tcp        0      0 127.0.0.1:2528              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:4449              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:7079              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:4455              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:199               0.0.0.0:*                   LISTEN      2579/snmpd
tcp        0      0 127.0.0.1:6990              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:3447              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:6999              0.0.0.0:*                   LISTEN      30157/java
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2741/master
This must be OK, right?

Last edited by thomas2004ch; 03-30-2015 at 06:38 AM.
 
Old 03-30-2015, 06:35 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Check /var/log/maillog and see if there's anything in the logs.
 
Old 03-30-2015, 06:44 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You have to set configuration files of postfix for each email address. Search web it has many examples.
 
Old 03-30-2015, 06:51 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by TenTenths View Post
Check /var/log/maillog and see if there's anything in the logs.
I've checked but there is no any log.

By another linux server where I can send email succeffully, I can see log in the /var/log/maillog.
 
Old 03-30-2015, 07:43 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
what's the output of:
Code:
postqueue -p
 
Old 03-30-2015, 07:48 AM   #6
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
The output look as follow:
Code:
...
C93CE700D8*  223216 Mon May  5 04:02:04  root@s001is35-test.ad001.mycom.grp

D96DF701B0*  114259 Fri Dec  5 04:02:02  root@s001is35-test.ad001.mycom.grp

DBB887009C*  114444 Tue Jan  6 04:02:03  root@s001is35-test.ad001.mycom.grp

EB6BF70132*  114052 Sun Aug 10 04:02:03  root@s001is35-test.ad001.mycom.grp

187C8701A5*  184203 Tue Apr 29 04:02:03  root@s001is35-test.ad001.mycom.grp

The date are quit strange.
 
Old 03-30-2015, 07:51 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Ok, so mails are sitting in the queue, you might find the test mails you tried to send at the end of the queue.

And you say there's NOTHING in /var/log/maillog? Do you mean that it's empty or that you couldn't see anything related to the mails you tried to send?
 
Old 03-31-2015, 01:59 AM   #8
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Sorry for the late reply.

I mean there is no any log written in to the mailog.


But as I use the following command:
Code:
echo "Test mail" | mail -vvv -s "Test mail" thomas.2004@mycom.com
I see follwoing in console:
Code:
Mail Delivery Status Report will be mailed to <root>.
and following in the maillog:
Code:
...
Mar 31 08:58:53 s001is35-test postfix/cleanup[28285]: fatal: open database /etc/postfix/recipient_canonical.db: Invalid argument
Mar 31 08:58:54 s001is35-test postfix/master[4081]: warning: process /usr/libexec/postfix/cleanup pid 28285 exit status 1
Mar 31 08:58:54 s001is35-test postfix/master[4081]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
...
Seems the db is corrupt?
 
Old 03-31-2015, 05:30 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by thomas2004ch View Post
Code:
...
Mar 31 08:58:53 s001is35-test postfix/cleanup[28285]: fatal: open database /etc/postfix/recipient_canonical.db: Invalid argument
Mar 31 08:58:54 s001is35-test postfix/master[4081]: warning: process /usr/libexec/postfix/cleanup pid 28285 exit status 1
Mar 31 08:58:54 s001is35-test postfix/master[4081]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
...
Seems the db is corrupt?
Fix that first and then keep trying and checking maillog
 
Old 04-08-2015, 03:20 AM   #10
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
I solved the porblem now. I did as follow:

(i) stop postfix:

# service postfix stop

(ii) remove the hash map file:

# rm /etc/postfix/recipient_canonical.db

(iii) generate the hash map file:

# postmap /etc/postfix/recipient_canonical

(iv) start postfix:

# service postfix start
 
Old 04-08-2015, 04:57 AM   #11
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Cool, glad you got sorted.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Server with : Postfix,dovecot. (Can send email, but can't receive email from internet mail) cparapat Linux - Server 1 08-16-2010 12:57 AM
Command based email client to send email through secure smtp havolinec Linux - Newbie 2 07-27-2010 07:40 AM
Send email to specific SMTP servers per email from my server? neilius Linux - Server 6 06-25-2009 06:31 AM
Apache virtual host send email without email server SibLiant Linux - Software 6 06-03-2009 09:46 PM
Allowing an IP to send email using my email server... culprit Linux - Networking 7 09-09-2003 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration