Koozali.org: home of the SME Server

qmail - delivery attempts and failure notices?

Patrick Basile

qmail - delivery attempts and failure notices?
« on: February 12, 2002, 01:24:08 AM »
Okay, here's the deal:  I have a user who wants to know why this undeliverable error mail wasn't sent back to him sooner  (see below for mail details).  He sent this mail on Feb 4, but apparently did not get the undeliverable error back until today.

Would somebody explain how this happened so that I can explain it to him - or is this a problem with the mail server setup, and if so what's the fix?  Thanks.

Regards,

Patrick
=====================================================
Delivered-To: bob@exchange.basilecompanies.com
Delivered-To: alias-localdelivery-bob@basilecompanies.com
Date: 11 Feb 2002 21:10:37 -0000
From: MAILER-DAEMON@basilecompanies.com
To: bob@basilecompanies.com
Subject: failure notice

Hi. This is the qmail-send program at basilecompanies.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

:
208.49.216.87 does not like recipient.
Remote host said: 550 5.1.1 user pmorin@pahomes.org not known
Giving up on 208.49.216.87.

--- Below this line is a copy of the message.

Return-Path:
Received: (qmail 2092 invoked by uid 8); 11 Feb 2002 21:10:33 -0000
Received: from pc-00031 (192.168.0.31, claiming to be "tbc008.basilecompanies.com")
        by exchange.basilecompanies.com with SMTP id smtpdzscvAU; Mon, 04 Feb 2002 08:45:55 EST
Message-Id: <5.1.0.14.2.20020204084628.0347dad8@192.168.0.23>
X-Sender: bob@192.168.0.23
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Mon, 04 Feb 2002 08:46:53 -0500
To: pmorin@pahomes.org
From: Bob Basile
Subject: Fwd: failure notice
Mime-Version: 1.0
Content-Type: multipart/alternative;
        boundary="=====================_477753132==_.ALT"

--=====================_477753132==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
========================================================

Rich Lafferty

Re: qmail - delivery attempts and failure notices?
« Reply #1 on: February 12, 2002, 01:34:28 AM »
I'm guessing, but the simplest answer would be that the remote system wasn't
accepting mail until today. If a destination host is unreachable, qmail keeps
trying for up to a week. In this case, it tried for just slightly under and finally
got through, only to find that the user didn't exist there.

Hope this helps,

--Rich

Dean Mumby

Re: qmail - delivery attempts and failure notices?
« Reply #2 on: February 12, 2002, 01:38:54 AM »
I'll Give it a stab

Qmail has this method of trying to send an email imediately , if it cant then it will delay the message and try again this process of delaying increases in time period increments till the email has been in the queue for about a week.

What may have happened is that your server was not able to establish a connection with the receiving mail server until today and when it did the message was bounced by their server and thus returned to yours.

It could be that their mailserver experienced some outages and thus your mail server was not able to establish a connection, as well as a number of other reasons.

I am no expert but that is how I understand qmails system.

Hope it helps.

Regards
Dean

ps if you want to see what emails are in the queue
/var/qmail/bin/qmail-qread

alternatively you can add an alias to your .bashrc like this
alias mailq='/var/qmail/bin/qmail-qread'

the next time you log in via ssh (or whatever) simply type mailq
and tada there is your mailq

Have fun

stephen noble

Re: qmail - delivery attempts and failure notices?
« Reply #3 on: February 12, 2002, 01:51:49 AM »
>alias mailq='/var/qmail/bin/qmail-qread'

good tip
the next question is how do you delete a message from the queue
preferable with a single command and without installing additional software

regards
stephen

Patrick Basile

Re: qmail - delivery attempts and failure notices?
« Reply #4 on: February 12, 2002, 05:05:46 PM »
Thanks for responding guys.  I thought that might be the way qmail worked, but now I'm going to get the question from users - "Well then how do I know if the mail was sent successfully....if the server waits a week to deliver my mail?"  Not sure how I can respond to this one - ideas?

Rich Lafferty

Re: qmail - delivery attempts and failure notices?
« Reply #5 on: February 12, 2002, 07:13:48 PM »
You know if your mail was sent successfully with qmail in the same way you
know that your mail was sent successfully with any other mail program: wait
for a bounce. Continuing to try for days isn't unique to qmail; your users have
experienced that same behavior with all of their Internet mail programs until
now, and haven't noticed it. (That's the answer, I suspect -- nothing's
changed at all except that now they know more about how it works.)

For this specific user, note that there were *two* failures; first, it took a week
to be able to contact the recipient's mail server at all, and second, the
account didn't exist when it finally got through.

If something is urgent, then email alone is a poor choice; there's no reason to
assume that it's instant. The remote site might choose to download their
mail once per day, or, for that matter, have had a broken computer for a
week. Email followed up by a phone call works well for urgent content.
Another good way to ensure that mail is deliverable is to use the
correct address in the first place!

It's not unique to email, either -- while an obviously-misaddressed letter
might be rejected when you hand it to someone at the post office, it usually
takes a delivery attempt or two before it's returned to sender.

Cheers,

--Rich

Filippo Carletti

Re: qmail - delivery attempts and failure notices?
« Reply #6 on: February 12, 2002, 07:59:21 PM »
sendmail may have accustomed many of us to the 4th hour delivery warning.
If a mail remains undelivered for the first four hours sendmail sends you a warning.
Both postfix and qmail do not have this behaviour.
However, if you do not get a bounce after 10 days, the mail is delivered, for sure.

Patrick Basile

Re: qmail - delivery attempts and failure notices?
« Reply #7 on: March 05, 2002, 10:22:08 PM »
Filippo (and others),

Thanks again for your responses, I have a few more questions.

First, as Stephen asked - is there a way to delete messages in the queue with a simple one line command?  If not, what is the correct "manual" method to delete them and any/all other files and 'instances' of the mail stuck in the queue?

Second, is there a way for qmail to mimic the 4th hour 'notice' that sendmail has?  Or is there a way to change the delivery time-out from 10 days to 3 or 4?  If so, would one of you know how to do this and could you share it with me?

Thanks for your help and thoughts.

Regards,
Patrick

Dean Mumby

Re: qmail - delivery attempts and failure notices?
« Reply #8 on: March 05, 2002, 10:43:49 PM »
The easiest way to delete email in the mailq is to use a small program called qmhandle if you search google you will find plenty of info

Simply edit the file and it is as simple as ./qmhandle -d 2534

you can place the file in your root directory and setup an alias as mentioned then its even simpler

The nice thing is you can delete multiple messages at once.

Good Luck
Dean

Dean Mumby

Re: qmail - delivery attempts and failure notices?
« Reply #9 on: March 05, 2002, 10:48:10 PM »
On a slightly different note...

I have RAV installed and recently got sent the hahahahahahahaha@sexyfun.net virus email. The problem is that rav now tries to send a message to hahaha@... which obviously is crazy , does anyone know how to specify certain remote email address that email should not be sent to.

Thanks
Dean

Filippo Carletti

Re: qmail - delivery attempts and failure notices?
« Reply #10 on: March 06, 2002, 07:12:08 PM »
Re: RAV, I think you should tweak RAV config.
See this example for Anset by Petre Rodan:

The new Win32/Anset.gen@mm virus is spoofing the 'From:' e-mail address.
It replaces the true address of the sender with webmaster@avnetwork.de and this
makes our software to send warning messages to the wrong person.

 Please consider updating your ravmd.conf in order to protect those that
have nothing to do with sending virused e-mails.

insert this after the end of the global group
(immediately after the '# DEFINE A NEW GROUP' line)

[antispoof]
#the Win32/Anset.gen@mm virus
sender = webmaster@avnetwork.de
# warn_sender = always
warn_receivers = always
warn_admin = always

#[your_groups]

by doing this, webmaster@avnetwork.de will not be notified for the virus that
was definitely not sent by him. Every mail that supposedly are coming from
him will still be scanned and the receivers and the admin will receive the
warning messages.

Filippo Carletti

Re: qmail - delivery attempts and failure notices?
« Reply #11 on: March 06, 2002, 07:32:59 PM »
Patrick Basile wrote:

> Second, is there a way for qmail to mimic the 4th hour
> 'notice' that sendmail has?  Or is there a way to change the
> delivery time-out from 10 days to 3 or 4?  If so, would one
> of you know how to do this and could you share it with me?

AFAIK, qmail do not send warnings.

Delivery time out can be changed, control/queuelifetime

I suggest reading LWQ: http://web.infoave.net/~dsill/lwq.html

Patrick Basile

qmHandle usage/file permission? (Re: qmail - delivery attemp
« Reply #12 on: March 06, 2002, 11:09:54 PM »
Dean,

I downloaded qmHandle and placed it in /root, and made the changes to the script for starting and stopping qmail (by adding the rc.d to the path of those lines which call for starting and stopping qmail).  Those are the only changes I made to the qmHandle file - are those the only modifications to the script?

I try to run it using the command './qmHandle -l' (for example) and get "bash: ./qmHandle: no such file or directory" message.  Thinking this was a ownership/permissions issue I changed the owner and group to 'root'.  Still doesn't work.  Do I need to change the permissions on the qmHandle file?  If so, how?  Or am I doing something else wrong.  I'm still a bit of a Linux newb (sorry) so let me know if I'm missing the obvious or I have done something silly.  Thanks.

Regards,
Patrick

Dean Mumby

Re: qmHandle usage/file permission? (Re: qmail - delivery at
« Reply #13 on: March 07, 2002, 12:28:36 AM »
Hi Patrick

Well I like to use my .bashrc file to make things easy

place the qmHandle file in your root directory

edit it as you have you should only need to change
$qmcmd = "/etc/rc.d/init.d/qmail start"

then edit your .bashrc file and add the line

alias qmhandle='/root/qmHandle'

then logout and login again

now you can view the que by typing qmhandle -l -c

and delete a message by typing qmhandle -dxxxxx