List of undeliverable emails ?

10 posts / 0 new
Last post
#1 Sat, 04/16/2011 - 03:14
Anonymous

List of undeliverable emails ?

Hello,

I am sending out newsletters via a script, It uses editor@expert-world.com as the sender.

There are a lot of "bounces" because the list is a bit old.

I am getting an email sent to from my mail daemon.

You are probably familiar with it:

Looks like this:

=====================================

From MAILER-DAEMON@heavyhoster.com

To: editor@expert-world.com

This is the mail system at host heavyhoster.com.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to

If you do so, please include this problem report. You can delete your own text from the attached returned message.

               The mail system

lokote@yupclan.com: Host or domain name not found. Name service error for name=yupclan.com type=A: Host not found

========================================

Is there a list of these email addresses contained in a file somewhere on my server ?

If they are in a log - which one would it be, how can I find them.

Obviously, I need to write a little script to clean my list up

Thanks for any help you can give.

Sat, 04/16/2011 - 03:28
ronald
ronald's picture

your script should be able to handle bounces. phplist is a good script to send out newsletters and once properly configured, it will take care of those.

you could create a mailaddress called bounces@ that receives the bounces.

Sat, 04/16/2011 - 03:55
Davvit

Thanks Ronald,

I wrote the script myself because it needs to interact with various tables I have so a I didn't use any pre-written script.

It works fine but I didn't know how to deal with bounces.

Do you know if the server keeps a list of those messages sent from MAILER-DAEMON@heavyhoster.com ? Or just the list of undeliverable email addresses ?

Thanks.

Sat, 04/16/2011 - 05:50
ronald
ronald's picture

afaik you can only see them in the receiving mailbox. I dont know of any list really.

Sat, 04/16/2011 - 15:13
Davvit

OK,

I have found the mailbox.

/home/guru54gt5/homes/editor/Maildir/cur

It contains files like:

1302940359.13894_0.heavyhoster

I think these are the emails that have not yet been picked up by my Mozilla Thunderbird client sw.

When it gets them I think they get deleted.

So if I send out all my emails and then before running my email client, I run a script to check each of those files for the phrase "The mail system" followed by an email address and then store that email address, I should get a list of all the bounced emails, correct ?

Sun, 04/17/2011 - 01:25
Davvit

Hi

Somebody suggested a grep command to look at the files:

grep -e '@.* Host or domain name not found' /home/guru54gt5/homes/editor/Maildir/cur | sed 's/:/\t/g' | cut -d' ' -f1 | sort -u

Got no output though :(

Unfortunately I don't understand this command with those pipes

Is it close to what I need to do ?

Here is an example of one of the files in the directory:

(a return message:)

==================================================

Return-Path: <> X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on heavyhoster.com X-Spam-Level: *** X-Spam-Status: No, score=3.4 required=5.0 tests=AWL,FH_DATE_PAST_20XX, HTML_MESSAGE,NO_RELAYS autolearn=no version=3.2.5 X-Original-To: editor@expert-world.com Delivered-To: editor.guru54gt5@heavyhoster.com Received: by heavyhoster.com (Postfix) id C91647AE399; Sat, 16 Apr 2011 00:52:33 -0700 (MST) Date: Sat, 16 Apr 2011 00:52:33 -0700 (MST) From: MAILER-DAEMON@heavyhoster.com (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: editor@expert-world.com Auto-Submitted: auto-replied MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="128637AE38F.1302940353/heavyhoster.com" Message-Id: 20110416075233.C91647AE399@heavyhoster.com

This is a MIME-encapsulated message.

--128637AE38F.1302940353/heavyhoster.com Content-Description: Notification Content-Type: text/plain; charset=us-ascii

This is the mail system at host heavyhoster.com.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to

If you do so, please include this problem report. You can delete your own text from the attached returned message.

The mail system

lucacel.vlad@highspeed.ro: host smtp.vhsmail.vodafone.com[85.205.93.89] said: 550 5.1.1 lucacel.vlad@highspeed.ro: Recipient address rejected: User unknown (in reply to RCPT TO command)

--128637AE38F.1302940353/heavyhoster.com Content-Description: Delivery report Content-Type: message/delivery-status

Reporting-MTA: dns; heavyhoster.com X-Postfix-Queue-ID: 128637AE38F X-Postfix-Sender: rfc822; editor@expert-world.com Arrival-Date: Sat, 16 Apr 2011 00:52:30 -0700 (MST)

Final-Recipient: rfc822; lucacel.vlad@highspeed.ro Original-Recipient: rfc822;lucacel.vlad@highspeed.ro Action: failed Status: 5.1.1 Remote-MTA: dns; smtp.vhsmail.vodafone.com Diagnostic-Code: smtp; 550 5.1.1 lucacel.vlad@highspeed.ro: Recipient address rejected: User unknown

--128637AE38F.1302940353/heavyhoster.com Content-Description: Undelivered Message Content-Type: message/rfc822

Received: from [127.0.0.1] (rm-1003-06.datarealm.com [65.23.129.163]) by heavyhoster.com (Postfix) with ESMTP id 128637AE38F for lucacel.vlad@highspeed.ro; Sat, 16 Apr 2011 00:52:30 -0700 (MST) Message-ID: 1302940349.4da94abddfe84@swift.generated Date: Sat, 16 Apr 2011 01:52:29 -0600

(Then the message content)

==================================================

Maybe that helps.

Thanks for helping.

Sun, 04/17/2011 - 09:11
andreychek

Well, look at the email that you have there... you're searching for the string "Host or domain name not found", but the error in your email says "Recipient address rejected: User unknown".

You have to review your emails, and check what errors they have in them :-)

Rather than searching for an error message at all, your other option would be to search for emails sent From "MAILER-DAEMON@heavyhoster.com".

As Ronald mentioned though -- I'd certainly suggest using a tool like phpList for these sorts of things in the future, it makes all this a bunch easier :-)

-Eric

Mon, 04/18/2011 - 00:40
Davvit

Hi,

Thanks for the help.

I think I might be better off looking at what triggers these return emails.

I guess there is some kind of error code received back SMTP Reply Codes ?

Do you know where these are stored ?

Mon, 04/18/2011 - 09:13
andreychek

Those would all be listed in the email logs -- /var/log/maillog or /var/log/mail.log.

If your server attempts to send an email out, but the address is incorrect, you'd get something like this:

postfix/smtp[5419]: 0B63418133: to=<user@domain.tld>, relay=mail_server.tld[x.y.z.q]:25, delay=33, delays=0.5/0/32/0.12, dsn=5.1.1, status=bounced (host mail_server.tld[x.y.z.q] said: 550 5.1.1 <user@domain.tld>: Recipient address rejected: User unknown in relay recipient table (in reply to RCPT TO command))

There's different reasons a message might bounce, and thus different bounce messages... but just look at the "status=" line in your logs, you'll start to get an idea of what to search for :-)

-Eric

Mon, 04/18/2011 - 12:51
Davvit

Yer Thanks,

I've been doing a bit of searching and saw that as well.

I think that's EXACTLY what I need to be looking at :)

Thanks.

Topic locked