Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [00:44:57] <gansbrest_> hi. Is there a way to distinguish between bounce generated by my own mail server and bounce generated by recipient's mail server (soft bounce)
- [00:45:37] <Patrickdk> the error message?
- [00:47:10] *** smica has quit IRC
- [00:47:47] <gansbrest_> I use transport to direct bounces to my script and I pass it $recipient variable for later processing in the script
- [00:47:55] <gansbrest_> argv=/var/www/mirtrik/bounces.php -u ${recipient}
- [00:48:37] <gansbrest_> Ideally I would like to avoid reading of full bounce message
- [00:49:16] <gansbrest_> all I need to know if it's hard bounce (bounced right away) or soft bounce (received from recipient mail server after message was accepted)
- [00:49:51] *** cafuego has joined #postfix
- [00:51:05] <gansbrest_> is there a way to know that without parsing full bounce message
- [00:53:55] <seekwill> That's not generally what's called a soft bounce
- [00:54:46] <seekwill> Your Postfix logs will tell you if it couldn't deliver. How you handle out of band messages is a different story
- [00:55:54] <gansbrest_> so basically the most reliable way is to parse the message
- [00:56:29] <seekwill> No
- [00:56:46] <seekwill> Re-read my line above...
- [00:57:13] <seekwill> Out of band bounces are those that initially get accepted and then rejected.
- [00:58:46] <gansbrest_> I'm not sure what band bounce is, sorry
- [00:59:05] <seekwill> (received from recipient mail server after message was accepted) <-- out of band bounce
- [00:59:19] <seekwill> The "band" being the SMTP conversation your server has with the recipient's
- [00:59:19] <gansbrest_> ah ok, thanks
- [01:00:09] <gansbrest_> ok, so when my server tries to deliver and fails then it writes that to log and generate bounce message
- [01:00:33] <gansbrest_> so theoretically I can read log to figure that out
- [01:00:37] <seekwill> Yes
- [01:01:00] <gansbrest_> but my bounce handling script is triggered when I receive bounce message
- [01:01:21] <seekwill> Is your bounce handling script located on the host sending out the mail?
- [01:01:30] <gansbrest_> currently yes
- [01:02:40] <gansbrest_> my script will receive ${recipient} + whole message in stdin
- [01:02:54] <gansbrest_> theoretically I can look up a log entry
- [01:03:00] <gansbrest_> based on recipient
- [01:03:23] <gansbrest_> but what if there are multiple entries for that
- [01:05:34] *** orogor has quit IRC
- [01:07:39] <seekwill> You want to use VERP
- [01:07:49] <seekwill> (If I understand your question correctly)
- [01:07:56] <gansbrest_> yes, I do use it
- [01:08:06] <gansbrest_> i receive user-123 at mydomain dot com
- [01:08:07] <seekwill> Why would there be multiple VERP entries?
- [01:08:27] <seekwill> You may need to be more specific about what you're doing
- [01:09:18] <gansbrest_> basically I want to remove not existent users from the list right away and allow some number of band bounces
- [01:10:08] <seekwill> The OOB bounces are less of a worry for the time being. Most "good" receivers will tell you about non existant users in band
- [01:10:08] <gansbrest_> so I guess I can read the log for that specific user (user-123 in my case)
- [01:10:10] <seekwill> Focus on that
- [01:10:22] <seekwill> Read your Postfix log, and parse for it
- [01:10:32] *** magyar has quit IRC
- [01:11:32] *** loddafnir has quit IRC
- [01:18:31] <gansbrest_> what about this approach, if I have to worry only about not existent users I can close my port 25 and avoid all bounces sent after message was accepted.
- [01:19:09] <seekwill> Some stupid people don't do recipient validation, and would legitimately send an OOB bounce
- [01:19:10] <gansbrest_> that way the only bounce I will receive is the one generated by my postfix
- [01:22:31] <gansbrest_> How you handle out of band messages is a different story
- [01:22:59] <gansbrest_> can you please explain your approach on how to handle band messages?
- [01:24:14] <seekwill> In our sending environment, we have a dedicated inbound MTA that collects the bounces. Once we process the VERP as being a legimate message, we scrape the body to see if we can figure out why it bounced.
- [01:24:41] <rob0> Invasion of the Body Scrapers
- [01:25:01] <seekwill> Depends who's body... I'd go for KB1JWQ's!
- [01:25:32] <gansbrest_> do you read logs at all or you just scrape the body and if there is 550 you remove the user
- [01:25:45] <seekwill> Always read the logs
- [01:26:32] <seekwill> Throwing out a guess, maybe less than 5% of bounces are OOB
- [01:26:47] <gansbrest_> oob?
- [01:26:48] <seekwill> (sorry, of our OOB bounces)
- [01:26:51] <seekwill> Out of band
- [01:27:32] *** shasta has quit IRC
- [01:27:58] <gansbrest_> could you please take a look at my band bounce log http://pastebin.com/Rcgdh3GY
- [01:28:11] <seekwill> "In band"
- [01:28:32] <seekwill> Yeah, Line 4 is the one you want to parse
- [01:29:05] <rob0> oob syas tsohg
- [01:29:23] <seekwill> ho
- [01:32:26] <gansbrest_> so I mostly care about status=bounced and to=<>
- [01:32:55] <tharkun> seekwill: does the ipad support DtD?
- [01:33:08] <seekwill> No flash :(
- [01:33:19] <seekwill> I think...
- [01:33:28] <seekwill> gansbrest_: And the response
- [01:34:33] <seekwill> tharkun: Nope :(
- [01:34:44] <gansbrest_> but don't you get all of that in the bounce body generated by postfix later on?
- [01:34:47] <seekwill> Might be able to jailbrak
- [01:34:52] <tharkun> seekwill: back to square one
- [01:35:02] *** googlah has joined #postfix
- [01:36:06] <seekwill> gansbrest_: Sure, whatever you want to do
- [01:36:49] <seekwill> It seems easier to me to parse a log line vs a bounce message
- [01:36:54] <gansbrest_> I'm just thinking if you still need body scraper, you might as well parse for 550 messages
- [01:36:57] *** Zblakany has quit IRC
- [01:40:46] <seekwill> Sure
- [01:43:05] <pj> well, if you have to parse bounces from remote servers anyways, then it would probably be easier just to parse the body in all of them.
- [01:43:49] <seekwill> I prefer to not generate a bounce message
- [01:45:25] <pj> and he seems to be confused, thinking that OOB vs REJECT is the same as soft vs hard or something.
- [01:45:29] <pj> they are completely different
- [01:45:52] <seekwill> I think from his point of view, he's understand right
- [01:46:08] <seekwill> He was definitely confused on soft vs hard
- [01:46:34] <pj> I don't know, it looks to me like you corrected his terminology to OOB vs In band, but he still thinks it's the same as soft vs hard.
- [01:46:48] <seekwill> oh
- [01:46:58] <pj> he wants to be parsing for soft vs hard, from his POV he shouldn't care if it's OOB or not.
- [01:47:24] <seekwill> I didn't think he was really talking about soft bounces (I prefer calling it transient failures)
- [01:48:17] <pj> yeah, it looks that way to me. His question kinda looked like, "how do I differentiate between soft vs hard" and you led him down talking about OOB, heh
- [01:48:41] <seekwill> oops
- [01:48:43] <seekwill> :)
- [01:48:49] <seekwill> Someone hand me another beer!
- [01:48:53] <gansbrest_> wait wait :)
- [01:48:57] <pj> here is what he was asking that led down that path...
- [01:48:59] <pj> [15:48] <gansbrest_> all I need to know if it's hard bounce (bounced right away) or soft bounce (received from recipient mail server after message was accepted)
- [01:49:04] <pj> but later he says this ...
- [01:49:36] <pj> [16:08] <gansbrest_> basically I want to remove not existent users from the list right away and allow some number of band bounces
- [01:49:51] <pj> that latter statement seems to suggest that he really wants to know about soft vs hard.
- [01:49:55] <seekwill> true
- [01:50:07] <pj> and it makes more sense that way too.
- [01:50:12] <seekwill> I say we hang gansbrest_ outside
- [01:50:14] <gansbrest_> could you guys explain more about soft and hard
- [01:50:51] <lunaphyte_> well, i'm glad you asked.
- [01:51:02] <pj> gansbrest_: a soft bounce is a condition where the server will try again (also known as "deferred"). It is simply a way of informing you that the message was not delivered yet but don't do anything because it will retry again for up to five days
- [01:51:17] <pj> a hard bounce is where the server gives up right away and won't try again.
- [01:51:23] <seekwill> Quitter
- [01:51:25] <pj> it has nothing to do with OOB vs In band.
- [01:51:49] <gansbrest_> will try again to deliver?
- [01:52:05] <seekwill> 4xx code vs 5xx code
- [01:52:08] <pj> right
- [01:52:21] <pj> that's how you differentiate, witht he code#
- [01:52:48] <pj> when maintaining a mailing list, you usually want to discard soft bounces and only consider hard bounces in terms of removing someone from the list.
- [01:53:11] <gansbrest_> ok, ignore 4xx, remove 5xx
- [01:53:17] <pj> yes, exactly
- [01:53:25] <Aprogas> Mailman has a good heuristic for handling bounces, borrow inspiration from their implementation.
- [01:53:53] <gansbrest_> yes, maybe I will take a class from there
- [01:53:57] <seekwill> "Borrow" :)
- [01:54:03] <gansbrest_> borrow :)
- [01:54:04] <pj> yes, it can get more complex than that, too, for example different types of hard bounces might be treated differently as well, but that's the gist of it.
- [01:54:14] <Aprogas> Basically they keep a score, a single bounce is not enough for removal.
- [01:54:35] <gansbrest_> even for 550?
- [01:54:57] <seekwill> Even for some 4xx :)
- [01:54:58] <seekwill> Damn Yahoo
- [01:55:12] <pj> right, what I said was a generalization
- [01:55:15] <seekwill> 451 Hey, yeah, I don't want this email. We're never going to accept it.
- [01:55:25] <pj> just to give you an idea.
- [01:55:32] <gansbrest_> nice
- [01:56:12] <pj> there are libraries for various programming languages that you can use to parse bounces, btw.
- [01:56:37] <Aprogas> I think "mailbox full / quota exceeded"-errors are 5xx even though usually they are quickly fixed by the user.
- [01:56:44] <gansbrest_> so let me clarify a little: IN BAND can produce hard and soft bounce, is that correct?
- [01:57:02] *** famicom has quit IRC
- [01:58:02] <pj> gansbrest_: hard and soft have nothing to do with In band vs OOB.
- [01:58:09] <pj> either one can produce both.
- [01:58:14] <gansbrest_> ok
- [01:58:18] *** lusted_gay has quit IRC
- [01:58:26] <seekwill> OOB transient failures...
- [01:58:28] <seekwill> ?
- [01:59:02] <Aprogas> NOOB failures
- [02:00:14] <gansbrest_> so most good providers produce hard bounce in band, while it's also possible that some mail server will accept my message and will send me a bounce with 550 later on
- [02:01:46] <Aprogas> Good providers produce the relevant response code in-band, whether that is a 2xx 4xx or 5xx response. Good providers don't come back on their earlier claim afterwards.
- [02:02:03] <Aprogas> From the perspective of your mailinglist this is not very relevant though.
- [02:02:19] <gansbrest_> yes, I just want to understand it better
- [02:02:24] <Aprogas> Either the mailinglist gets a bounce from your Postfix, or it gets a bounce from a remote mailserver (delivered through your Postfix)
- [02:02:26] <gansbrest_> thank you guys for a lot of useful info
- [02:02:41] <gansbrest_> so mostly I care about error codes
- [02:02:48] <gansbrest_> in the body
- [02:03:21] <gansbrest_> scrape - get the code, remove from the list or ignore
- [02:04:43] <gansbrest_> is there a standard for those codes?
- [02:05:28] <Aprogas> There is a non-exclusive list in RFC 5321.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement