Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a PHP script (osTicket) that has the ability for parsing piped emails.

In theory it would be very simple to execute a script and post the email source code to it.

Is there a plugin available that does that? Or is there any other possible option?

share|improve this question
add comment

1 Answer

Thunderbird does not have a way to pipe in custom scripts to send out emails.

An option you should look into would be to setup a postfix service on the osTicket server to allow it to send out messages from localhost out.

In the documentation mentioned by osTicket ( http://osticket.com/wiki/Email_Piping ), they talk about how to set it up for cPanel. We will be doing the same thing but on postfix:

Step 1: Find what alias mapping you are using

sudo postconf | grep -e ^alias_maps

Example result from the command above: alias_maps = hash:/etc/aliases

Step 2: Edit file to add a new alias

(use any editor you want with root access)

sudo vim /path/to/alias/file

Example result from the command above: sudo vim /etc/aliases

Step 3: Add this line to the alias file

support@domain.com: "|/path/to/api/pipe.php"

You should change: the email address to the one you are going to us and the path to the correct path to the pipe.php file

Step 4: Save alias file and exit

For vim: :wq!

Depending on the editor, use the command/options to save the file and exit.

Step 5: Initialize alias database

sudo newaliases

This will make sure the changes you made will be used for postfix/sendmail. This will only work if you if you are editing the /etc/aliases file. Read the manual page for more information on how to initialize alias data for postfix man newaliases.

Step 6: Test if it works

echo "TEST Email" | mail -s "This is a test" support@domain.com

Once its been complete, you should be able to read the mail log to make sure it used the php script when sending it: /var/log/mail.log

You should see a line about it being sent but being delivered to a command: (delivered to command: /path/to/api/pipe.php)

Website References

Official information from osTicket about email piping

http://osticket.com/wiki/Email_Piping

Question about postfix piping

http://stackoverflow.com/questions/6723596/piping-with-postfix-aliases-and-mysql

piping.html - More detailed explanation about piping for a helpdesk service called Vision Helpdesk

http://www.thevisionworld.com/vision-helpdesk-faqs-exim-postfix-qmail-sendmail-email

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.