LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-04-2009, 09:06 AM   #1
plpinet
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
[qmail] can't send mail using 'qmail-inject' or 'mail'


Hello, I have been trying to solve this problem for some time now; basically I installed qmail/vpopmail on my debian system. Followed the tutorial on qmailrocks.org for the installation; the compilations was successful (no errors).

The problem is I can receive mail from remote systems but I am unable to send mail to remote systems, I can however; send mail between local accounts on my mail server. Now; I have analyzed the problem from many aspects.

Here are the services I compiled:
netqmail-1.05
ucspi-tcp-0.88
vpopmail-5.4.13

My /var/qmail/supervise/qmail-smtpd/run looks like this (note: my mail server is mail.mydomain.com for the sake of this example)

#!/bin/sh
QMAILDUID=`/usr/xpg4/bin/id -u vpopmail`
NOFILESGID=`/usr/xpg4/bin/id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
exec /usr/local/bin/softlimit -m 30000000 \
/usr/local/bin/tcpserver -v -r -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/var/qmail/bin/qmail-smtpd mail.mydomain.com \
/export/home/vpopmail/bin/vchkpw /usr/bin/true 2>&1


My /var/qmail/supervise/qmail-pop3d/run is as follows

#!/bin/sh
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/ccs/bin:/opt/csw/bin
:/bin
export PATH
exec /usr/local/bin/softlimit -m 3000000 \
/usr/local/bin/tcpserver -H -R -v -c100 0 110 qmail-popup mail.mydomain.com \
/export/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1


My /var/qmail/supervise/qmail-send/run is as follows

#!/bin/sh
exec /var/qmail/rc




So now qmail is running on my system and can be verified using #qmailctl stat

/service/qmail-send: up (pid 3486) 8 seconds
/service/qmail-send/log: up (pid 3485) 8 seconds
/service/qmail-smtpd: up (pid 3495) 8 seconds
/service/qmail-smtpd/log: up (pid 3494) 8 seconds
/service/qmail-pop3d: up (pid 3501) 8 seconds
/service/qmail-pop3d/log: up (pid 3502) 8 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0

And to make sure I scanned the ports from 1-200 and ports 25 and 110 were open, and in addition to that I ran a ps –ef | grep error to see if there were any errors with any of the mail services.

root 374 370 0 Jul 14 ? 2:20 readproctitle service errors: .................................................

As you can see from the sequence of uninterrupted dots, no errors were detected.


So let me show you what the logs say when I execute a command using qmail-inject to send a mail from local system to a user on yahoo mail server. me@mydomain.com -> test@yahoo.com

# echo to: test@yahoo.com | /var/qmail/bin/qmail-inject

# tail –f /var/log/qmail/qmail-send/current

@4000000044bc125f375dc26c new msg 436 <-----message received here
@4000000044bc125f375de97c info msg 436: bytes 202 from <me@mail.mydomain.com> qp 3531 uid 0
@4000000044bc125f37d7efc4 starting delivery 2: msg 436 to remote test@yahoo.com
@4000000044bc125f37d80b1c status: local 0/10 remote 1/120
@4000000044bc12610e6fbf54 delivery 2: success: 67.28.113.70_accepted_message./Remote_host_said:_250_ok_dirdel/
@4000000044bc12610eb7cca4 status: local 0/10 remote 0/120
@4000000044bc12610eb7e02c end msg 436 <----message ends here


And here is the output from the network layer using tcpdump (Note: 10.1.1.200 is my mailserver mail.mydomain.com and 67.28.113.70 is the yahoo mail server)


22:41:29.546526 10.1.1.5.33003 > 10.1.1.200.22: P 3014615076:3014615124(4 ack 1227402722 win 63936 <nop,nop,timestamp 38837523 26452293> (DF) [tos 0x10]
22:41:30.818426 10.1.1.200.63077 > 67.28.113.70.25: S 4154862510:4154862510(0) win 49640 <mss 1460,nop,nop,sackOK> (DF)
22:41:30.911804 67.28.113.70.25 > 10.1.1.200.63077: S 2638438055:2638438055(0) ack 4154862511 win 65535 <mss 1460> (DF)
22:41:30.911953 10.1.1.200.63077 > 67.28.113.70.25: . ack 1 win 49640 (DF)
22:41:31.159421 67.28.113.70.25 > 10.1.1.200.63077: P 1:58(57) ack 1 win 65535 (DF)
22:41:31.159571 10.1.1.200.63077 > 67.28.113.70.25: . ack 58 win 49640 (DF)
22:41:31.159803 10.1.1.200.63077 > 67.28.113.70.25: P 1:20(19) ack 58 win 49640 (DF)
22:41:31.256308 67.28.113.70.25 > 10.1.1.200.63077: P 58:89(31) ack 20 win 65535 (DF)
22:41:31.256427 10.1.1.200.63077 > 67.28.113.70.25: . ack 89 win 49640 (DF)
22:41:31.256531 10.1.1.200.63077 > 67.28.113.70.25: P 20:51(31) ack 89 win 49640 (DF)
22:41:31.352724 67.28.113.70.25 > 10.1.1.200.63077: P 89:124(35) ack 51 win 65535 (DF)
22:41:31.352936 10.1.1.200.63077 > 67.28.113.70.25: P 51:82(31) ack 124 win 49640 (DF)
22:41:31.461844 67.28.113.70.25 > 10.1.1.200.63077: P 124:164(40) ack 82 win 65535 (DF)
22:41:31.462051 10.1.1.200.63077 > 67.28.113.70.25: P 82:88(6) ack 164 win 49640 (DF)
22:41:31.555831 67.28.113.70.25 > 10.1.1.200.63077: P 164:178(14) ack 88 win 65535 (DF)
22:41:31.556130 10.1.1.200.63077 > 67.28.113.70.25: P 88:298(210) ack 178 win 49640 (DF)
22:41:31.747769 67.28.113.70.25 > 10.1.1.200.63077: . ack 298 win 65535 (DF)
22:41:32.049347 67.28.113.70.25 > 10.1.1.200.63077: P 178:193(15) ack 298 win 65535 (DF)
22:41:32.049659 10.1.1.200.63077 > 67.28.113.70.25: P 298:304(6) ack 193 win 49640 (DF)
22:41:32.049835 10.1.1.200.63077 > 67.28.113.70.25: F 304:304(0) ack 193 win 49640 (DF)
22:41:32.142607 67.28.113.70.25 > 10.1.1.200.63077: P 193:224(31) ack 304 win 65535 (DF)
22:41:32.142768 10.1.1.200.63077 > 67.28.113.70.25: R 4154862815:4154862815(0) win 49640 (DF)
22:41:32.144278 67.28.113.70.25 > 10.1.1.200.63077: F 224:224(0) ack 304 win 65535 (DF)
22:41:32.144377 10.1.1.200.63077 > 67.28.113.70.25: R 4154862814:4154862814(0) win 0 (DF)


From the logs and tcpdump it appears that the delivery of the message 436 was a success, and that it was actually delivered to the remote host as we can see from the tcpdump output, however after checking the remote mail box I did not see the message. (I tried with different remote hosts)

I can receive mail from the same remote system I tried sending to with no problems. So it cannot be a DNS problem since the remote mail server didn’t have a problem resolving my mail server.

I even tried the other method of sending mail by telneting to port 25 and constructing the message, in either case; everything seems to be a success, no hints or indications of an error. My last guess would be that it is a problem with one or more of the control files.

At this stage I tried every thing and frankly ran out of ideas. If you see an error that I don’t or have any queries or suggestions please don’t hesitate to reply.

Thank you.
 
Old 07-04-2009, 09:29 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Check the spam folder of the yahoo account. You mail gets delivered by yahoo, so if you cannot see it, I guess it's finished in spam.

Last edited by bathory; 07-04-2009 at 10:03 AM.
 
Old 07-04-2009, 09:42 AM   #3
plpinet
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Check the spam folder of the yahoo account. You mail gets delivered by yahoo, so if you cannot see it, I guees it's finished in spam.
Thank you for your help, but I tried sending to different remote host and the email is not in any inbox or spam folder. It's just like the email was never sent. At least if I had an error in the logs I could try to debug it but nothing.

I can send to local users no problem but even if I try to send to an email account created using vpopmail on my own domain (still locally) it doesn't go through. For example, I created an email test123@mydomain.com and I can receive emails from others on this account but I can't send mail from the console to this email. The email is not in any queue and I can't receive it using pop or imap.

Please help, this is giving me one of those headache
 
Old 07-04-2009, 10:16 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I don't know about other mail providers, but the "_250_ok_dirdel/" answer from yahoo means that your mail was delivered normally.
Try to telnet directly to port 25 of the remote mailserver, from your server to send an email and see what you get.
Quote:
if I try to send to an email account created using vpopmail on my own domain (still locally) it doesn't go through. For example, I created an email test123@mydomain.com and I can receive emails from others on this account but I can't send mail from the console to this email
Check the rcpthosts and locals control files and make sure they contain your domain
 
Old 07-04-2009, 11:36 AM   #5
plpinet
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
qmail-inject now works for some reason! I have NO idea what i've done but it seems to be working...
echo to: some@email.com | /var/qmail/bin/qmail-inject

'mail some@email.com' still doesn't work though. any idea? is the mail program part of qmail? I really doubt but it should be working too. I need to make it work so formmail.pl works too. ty
 
Old 07-04-2009, 12:16 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
mail is a unix command, has nothing to do with qmail.
To make scripts work with qmail you need to make a symlink to the qmail's sendmail program:
Code:
ln -s /var/qmail/bin/sendmail /usr/lib/sendmail

Last edited by bathory; 07-04-2009 at 12:45 PM. Reason: wrong path
 
  


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
Not able to send mail with qmail satishmali1983 Linux - Newbie 2 03-26-2009 01:30 PM
Qmail to send mail to New Mail Server dumbsheep Linux - Server 0 06-17-2008 10:36 AM
Send mail or Qmail Bala552005 LinuxQuestions.org Member Intro 1 06-11-2007 09:25 AM
can't send mail using qmail MPowers Linux - Software 1 03-10-2006 04:13 AM
send mail or qmail, which is better? mamta_k Linux - Software 0 06-22-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:00 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