LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 13.37
Posts: 535

Rep: Reputation: 36
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 16
Posts: 160

Rep: Reputation: 41
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 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
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 16
Posts: 160

Rep: Reputation: 41
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 13.37
Posts: 535

Original Poster
Rep: Reputation: 36
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 01:09 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration