LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-12-2016, 08:40 AM   #1
sakmr
LQ Newbie
 
Registered: Oct 2012
Posts: 4

Rep: Reputation: Disabled
Insert application custom logs into Postfix logs


Hello,

We have built an application to send emails using our Postfix MTA and want to track the delivery of those emails from application itself.
Application and Postfix are deployed on two different servers. Application on Windows/PHP and Postfix on CentOS.
App is web based and creating its own log files having mail ID number for each email sent to Postfix and Postfix generates its own mail ID (session ID) for those emails while sending it out for destination MTAs.
It is creating confusion and we are unable to track exact email delivery status using our Application.
Please suggest if there is any way we can push Application's mail ID numbers also to postfix logs along with other header detail so that we can track it till final delivery.
 
Old 08-12-2016, 01:20 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,671

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by sakmr View Post
Hello,
We have built an application to send emails using our Postfix MTA and want to track the delivery of those emails from application itself.
Application and Postfix are deployed on two different servers. Application on Windows/PHP and Postfix on CentOS.
App is web based and creating its own log files having mail ID number for each email sent to Postfix and Postfix generates its own mail ID (session ID) for those emails while sending it out for destination MTAs.
It is creating confusion and we are unable to track exact email delivery status using our Application.
Please suggest if there is any way we can push Application's mail ID numbers also to postfix logs along with other header detail so that we can track it till final delivery.
Maybe, but since you're using Windows, good luck. It's been a LONG time since I've touched Windows, but getting a syslog agent on Windows used to entail $$$ and time. And, it wasn't stable. And you also don't say ANYTHING about your application, then environment you're in, or anything about the Linux system. Basic steps:
  • Modify your application to either send standard syslog events with the type "LOG_MAIL", or have it send those messages to a Windows syslog agent.
  • Configure your Linux system to listen for syslog events from the Windows system
  • Log those events into your existing mail log.
Either way, your application is going to have to be modified, and even then it may not work as you want. Your systems will have to be time-sync'ed, and the application may fire off an email, and it may be queued for xxx time until Postfix shovels it out....leading to a disjointed log file, that's going to be hard to track. With a custom application and a postfix linux server, if you're trying to track things accurately, I'd consider shoving it all into a database. Plenty of tutorials on how to get syslog events into a MySQL database, and since you wrote your own app for mail, you have the ability to make it do whatever you want. Shove in a unique ID number for your messages, which will go into the database. You can then look up that number, which may (?) be part of the postfix log message, or at least be tied to a user ID/address, which you can then look up.
 
  


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
Back up logs file and create a script showing the backed up logs and the running logs Billy_6052 Programming 5 12-13-2014 02:32 AM
Enable Audit logs to send logs to syslog-ng (remote server) Iyyappan Linux - Server 5 01-07-2014 04:15 PM
logs are not generating inside sftp logs, while acitive directory users are loggin in deepak_message Linux - Server 6 03-24-2013 11:37 AM
Question about the logs viewer application (/var/logs) balteo Linux - General 1 11-20-2009 11:13 PM
Finding LDAP Server Logs / Application Logs in Linux arbignay Linux - Newbie 2 03-24-2008 09:54 AM

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

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