LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-04-2007, 04:10 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
fetchmail - How to delete mails with sendmail 451 reject


I'm looking for a way to automatically delete e-mails that are rejected by sendmail with a return code 451: Domain of sender address does not exist.

fetchmail no longer does this automatically: fetchmail FAQ

Cheers.
 
Old 02-04-2007, 05:00 PM   #2
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
A 451 error could be temporary, e.g. DNS down or busy, so deletion might not be the best option.

You could try "not bouncing" the message to the "postmaster" address and sending it to /dev/null with the MTA. You might even want to deliver to a honeypot account to let SpamAssassin learn from it.

I have my setup send all bounces to a postmaster account via sendmail which then sends them on, via aliases, to me+postmaster which delivers to a "postmaster" folder in my IMAP account for manual deletion.
 
Old 02-04-2007, 09:14 PM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Original Poster
Rep: Reputation: 38
The problem is not what to do with the mail. It's how to delete it from the mailbox on my ISP, as fetchmail leaves it there.

Cheers.
 
Old 02-05-2007, 12:14 AM   #4
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
Sorry for the confusion...

I just checked what happens on my system (fetchmail -> sendmail -> procmail) and the error reported to the logs by sendmail and fetchmail are:
"553 5.1.8 Domain of sender address user@invalid.com does not exist"
i.e. not a 451 error.
The fetchmail man page lists error code 553 as the only case where it will delete the message without delivery (or bounce).

Looks like the problem could be with the sendmail configuration. Check you have the latest software package and check that sendmail.cf is up to date, possibly built from sendmail.mc.

The error is actually generated in the "checkmail" ruleset. Search the file for the "Domain of sender address" string:

$ grep 'Domain of sender address' /etc/mail/sendmail.cf
R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"

The first bit is a test for temporary or permanent DNS lookup failures. So if your sendmail.cf matches mine, the problem could be with DNS lookups. Are you using any DNS blacklists?
Check your /etc/resolv.conf for non-functioning nameserver entries.

Hope this helps,

--DaveG.
 
Old 02-05-2007, 10:52 AM   #5
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Original Poster
Rep: Reputation: 38
Going back through my logs, I ca see instances of both 451 and 553. Now, I wonder what the difference is between the 2.

Cheers.
 
  


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
Fetchmail Problem in fetching mails niranjan_mr Linux - Software 0 11-14-2005 12:48 AM
[Fetchmail] Getting same mails on user mailboxes tchewb Linux - Networking 2 09-23-2005 04:08 AM
auto delete old mails in sendmail - Pls Help maharajg Linux - Networking 3 11-10-2004 11:21 AM
get mails only when requested with fetchmail/postfix rudolfpolzer Linux - Networking 0 03-27-2004 08:27 AM
fetchmail stuck during retrieval of mails ... VincentB Linux - Newbie 1 02-11-2004 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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