LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-20-2014, 06:49 AM   #1
TCB13
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Rep: Reputation: Disabled
Unhappy Postfix: Locally Generated Mail Bounces and Pipes


Hello, I'm no expert in email servers or configs, but I'm building a small help system where basically some mail accounts of my email server are piped into a PHP script that will take care of the emails.

The server is running, I can send email over SMTP without any issues, I can also receive them on the users virtual mailboxes and access them over IMAP. However, there's a problem, I'm using this rule to pipe the emails:

Code:
smtpd_recipient_restrictions = check_recipient_access mysql:/etc/postfix/mysql-virtual-recipient-access.cf, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
Bassically the SQL query referenced on /etc/postfix/mysql-virtual-recipient-access.cf returns the following every time its supposed to pipe a specific mailbox to PHP:

Code:
FILTER ticket:dummy
And then I've a hook defined at master.cf like this:

Code:
ticket unix - n n - - pipe
    flags=F user=www-data argv=/webroot/tiketman/AppCore/Mail/Incoming.php ${sender} ${size} ${recipient}
This setup works fine if I send and email from an address inside or outside my server, however local bounces like Mail Delivery Notifications originated on my server such as

Code:
<error@sfasdadf.com>: Host or domain name not found. Name service error for
        name=sfasdadf.com type=A: Host not found
Don't get filtered and aren't not piped to PHP ending up on the user mailbox.

Here is /var/log/mail.log on sending a test email and receiving the error back:

Quote:
Sep 19 23:09:11 mail postfix/smtp[8773]: 764E2409DF: to=<email@sfasdadf.com>, relay=none, delay=0.14, delays=0.11/0.01/0.02/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=sfasdadf.com type=A: Host not found)
Sep 19 23:09:11 mail postfix/cleanup[8771]: 970D2409E1: message-id=<20140919210911.970D2409E1@mail.ptdyncs.com>
Sep 19 23:09:11 mail postfix/bounce[8774]: 764E2409DF: sender non-delivery notification: 970D2409E1
Sep 19 23:09:11 mail postfix/qmgr[8638]: 970D2409E1: from=<>, size=3583, nrcpt=1 (queue active)
Sep 19 23:09:11 mail postfix/qmgr[8638]: 764E2409DF: removed
Sep 19 23:09:11 mail dovecot: lmtp(8777): Connect from local
Sep 19 23:09:11 mail dovecot: lmtp(8777, test-1@ptdyncs.com): FXZGJnebHFRJIgAAvu7YNA: msgid=<20140919210911.970D2409E1@mail.ptdyncs.com>: saved mail to INBOX
Sep 19 23:09:11 mail postfix/lmtp[8776]: 970D2409E1: to=<test-1@ptdyncs.com>, relay=mail.ptdyncs.com[private/dovecot-lmtp], delay=0.04, delays=0.01/0.01/0.01/0.02, dsn=2.0.0, status=sent (250 2.0.0 <test-1@ptdyncs.com> FXZGJnebHFRJIgAAvu7YNA Saved)
Sep 19 23:09:11 mail dovecot: lmtp(8777): Disconnect from local: Client quit (in reset)
Sep 19 23:09:11 mail postfix/qmgr[8638]: 970D2409E1: removed
How can I fix this, without changing much the architecture of this thing, because I need to be able to set the hook that will process the messages (or none) at SQL for each virtual user.

From some reading I've been doing the local bounce notifications aren't actually sent like a normal email and are processed by the bounce program, however, I'm not sure I understood it correctly because on the log above I see a full delivery. My attempts to catch that email above (with global pipes and stuff) only made me get to the conclusion that I effectively get the email I sent back to me, but here no error message :S

Can someone explain me this more detailed and help me fix it? I've been doing research and I can't find anything useful... it this that hard? There must be other applications doing this...

Thank you.
 
  


Reply

Tags
pipe, postfix



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
Postfix - Deliver mail locally and forward a copy ndc Linux - Software 1 04-25-2014 03:26 AM
outgoing mail bounces with error 550 5.7.1 scottmusician Linux - Server 20 04-07-2013 08:21 PM
Setting up Postfix to recieve and delivery mail locally on Suse dimitarsl Linux - Server 2 09-20-2012 10:36 AM
Postfix bounces everything, error 550 RileyTheWiley Linux - Networking 1 09-12-2009 03:23 PM
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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