How to test emailnotifications of trac in local host ? Particularly Mail2Trac plugin and Email2Trac plugin ?

50 views
Skip to first unread message

Sri Ram Kannan

unread,
Feb 4, 2015, 11:06:03 AM2/4/15
to trac-...@googlegroups.com

I have installed Trac system in my localhost. Configured the SMTP server to send email generated when new ticket is created to my GMAIL id. It worked perfectly.

But I don't know hot to setup smtp server locally so that I can receive and see the emails generated by Trac syystem ?

Now Email2Trac and Mail2Trac works in way that the email received from track system will be replied back and the reply will be posted into the ticket page as comment.

How I can test this plugin functionality locally ?

And how to test mailtotrac plugin ? The email received must be sent back and the reply of the email must be added as a comment in the trac ticket page.

I request someone to update me about this. I'm doing this setup in ubuntu 14.0.4


Regards,
Sri.

Matthew Caron

unread,
Feb 4, 2015, 2:15:41 PM2/4/15
to trac-...@googlegroups.com
On 02/04/2015 11:06 AM, Sri Ram Kannan wrote:
> But I don't know hot to setup smtp server locally so that I can receive
> and see the emails generated by Trac syystem ?

You would need to set up a mailserver in your system to send and receive
email. Whether that server merely forwards on to another server or is a
full-fledged mailserver and runs something like an IMAP daemon to allow
you to access it is likely mostly determined by your needs. Explanation
of this task is not really Trac related, and thus is out of scope for
this list, but I'll try to be helpful (see below).

> I request someone to update me about this. I'm doing this setup in
> ubuntu 14.0.4

I use exim in my setup, and my notes are here:

https://github.com/mattcaron/misc_notes/blob/master/install.linode.ubuntu.12.04

This is for 12.04. 14.04 should be similar.

Item 12 has exim (SMTP) notes. Item 11 has dovecot (IMAP) notes. Item 13
integrates the two. I stress that these are my internal notes, and not a
howto, they should be regarded as expert level documentation. However,
it may provide a starting point to give you searchable terms for
better-written tutorials. There are also reference links in my notes.

Once you have the mailserver set up, email2trac should be simple - you
simply add a router just after the "begin routers" section, which is
like this:

==
# This router only handles local trac@ addresses (for whatever domain).
# It requires the email2trac.py script to exist and passes mails off to
# that script via the trac_transport.
trac_router:
driver = accept
require_files = /usr/local/bin/email2trac.py
local_parts = trac
transport = trac_transport
==
and then, right after the "begin transports" line, you need to add this
transport:
==
# This transport is used for the Trac to e-mail gateway. The order in
# this section doesn't matter; a transport has to be explicitly referred
# to by a router in the routers section in order to be used.
#
# This works by piping e-mails to the email2trac.py script, run as the
# www-data user.
trac_transport:
driver = pipe
command = /usr/local/bin/email2trac.py
current_directory = /tmp
home_directory = /tmp
user = www-data
group = www-data
==

This will take an email of trac@<anything> and send it to email2trac.py.

--
Matthew Caron, Software Build Engineer
Red Lion Controls | www.redlion.net
+1 (518) 877-5173 x138 office

Sri Ram Kannan

unread,
Feb 4, 2015, 4:16:51 PM2/4/15
to trac-...@googlegroups.com
Hi Mathew,

Thanks for replying back. I would look into your notes to install the mail server.

Before that, can you say how to test Email2Trac and Mail2Trac plugins locally ? I have installed the Trac in my local machine successfully. I don't have the idea of how to proceed to test the plugins.

To be precise where I'm struggling to continue is:
1. Able to create a ticket and the ticket is sent to Gmail successfully.
2. No clue on where the email generated is stored in the local machine.
3. The main functionality to check is to modify the ticket and send to Email2Trac and Mail2Trac plugin so that the modification must be added as a comment in the ticket page.
4. How to receive the mail locally in the machine to see rather than sending to the gmail.

I kindly request you to explain if possible step - by - step so that I can understand easily.  I'm working in ubuntu 14.0.4 and see a good article for email2trac on windows but not for ubuntu.

Thanks and Regards,
Sri Ram Kannan.

Matthew Caron

unread,
Feb 4, 2015, 4:40:47 PM2/4/15
to trac-...@googlegroups.com
On 02/04/2015 04:16 PM, Sri Ram Kannan wrote:
> Hi Mathew,
>
> Thanks for replying back. I would look into your notes to install the
> mail server.
>
> Before that, can you say how to test Email2Trac and Mail2Trac plugins
> locally ? I have installed the Trac in my local machine successfully. I
> don't have the idea of how to proceed to test the plugins.

I'll answer each point individually and try to help.

I'm also not familiar with Mail2Trac. I only use email2trac and achieve
the behavior which I think you're trying to get working.

Looking at http://trac-hacks.org/wiki/MailToTracPlugin, it seems that
MailToTrac and Email2Trac may provide the same functions, so you would
want to pick one, and not do both.

> To be precise where I'm struggling to continue is:
> 1. Able to create a ticket and the ticket is sent to Gmail successfully.

It sounds like this is working.

> 2. No clue on where the email generated is stored in the local machine.

It isn't. Email is only stored on the local machine until the remote
machine (Google's servers) accept it for delivery. Then it is deleted.

> 3. The main functionality to check is to modify the ticket and send to
> Email2Trac and Mail2Trac plugin so that the modification must be added
> as a comment in the ticket page.

I presume you mean that you want to reply to the email and have it get
added to the ticket. For that, you need a local mailserver that accepts
email destined for the original from address.

So, if you send email to sriram...@gmail.com, and it's from
tr...@yourdomain.com, you need to be able to hit reply and the email goes
to tr...@yourdomain.com, which means that you need to set up a mailserver
@ yourdomain.com which will accept email and route it to the email2trac
script.

> 4. How to receive the mail locally in the machine to see rather than
> sending to the gmail.

Once your mailserver is working, you'd want to change the email address
associated with that user in the admin panel, so instead of trying to
send it to sriram...@gmail.com, you want it to go to
sriram...@yourdomain.com. You may also want to change the trac config
to use the local mail server. Then you can check that email account
instead of the IMAP account and get email there.

> I kindly request you to explain if possible step - by - step so that I
> can understand easily. I'm working in ubuntu 14.0.4 and see a good
> article for email2trac on windows but not for ubuntu.

IIRC, Installation is standard Unix configure/make/make install:

https://oss.trac.surfsara.nl/email2trac/wiki/Email2tracInstallation

You could follow the Debian Package instructions, but I believe I just
followed "No package manager".

And this covers the config:

https://oss.trac.surfsara.nl/email2trac/wiki/Email2tracConfiguration

And the stuff I posted earlier covers adding it to your exim.

Unfortunately, I can't be more specific than this, because the specifics
are determined by your site's individual requirements.
Message has been deleted

Sri Ram Kannan

unread,
Feb 4, 2015, 5:12:15 PM2/4/15
to trac-...@googlegroups.com
> 3. The main functionality to check is to modify the ticket and send to
> Email2Trac and Mail2Trac plugin so that the modification must be added
> as a comment in the ticket page.

I presume you mean that you want to reply to the email and have it get
added to the ticket. For that, you need a local mailserver that accepts
email destined for the original from address.

So, if you send email to sriram...@gmail.com, and it's from
tr...@yourdomain.com, you need to be able to hit reply and the email goes
to tr...@yourdomain.com, which means that you need to set up a mailserver
@ yourdomain.com which will accept email and route it to the email2trac
script.

Can you explain this point much in detail on how to achieve it ? Do I need to install mail server as you mentioned in the earlier mail using your notes ? Exim ?

> 4. How to receive the mail locally in the machine to see rather than
> sending to the gmail.

Once your mailserver is working, you'd want to change the email address
associated with that user in the admin panel, so instead of trying to
send it to sriram...@gmail.com, you want it to go to
sriram...@yourdomain.com. You may also want to change the trac config
to use the local mail server. Then you can check that email account
instead of the IMAP account and get email there.

And please explain to how to do change the trac config to use the local mail server.

I appreciate your immediate response and you gave a clear idea about the issue now. Thanks a ton!



Thanks and Regards,
Sri.

Matthew Caron

unread,
Feb 5, 2015, 9:01:58 AM2/5/15
to trac-...@googlegroups.com
On 02/04/2015 05:10 PM, Sri Ram Kannan wrote:
> So, if you send email to sriram...@gmail.com <javascript:>, and it's
> from
> tr...@yourdomain.com <javascript:>, you need to be able to hit reply
> and the email goes
> to tr...@yourdomain.com <javascript:>, which means that you need to
> set up a mailserver
> @ yourdomain.com <http://yourdomain.com> which will accept email and
> route it to the email2trac
> script.
>
>
> Can you explain this point much in detail on how to achieve it ? Do I
> need to install mail server as you mentioned in the earlier mail using
> your notes ? Exim ?

Yes, you need to install a mailserver. Exim is the one I use. Mike
responded in another thread and suggested Postfix. Either are very valid
choices which do the same thing. I would recommend against using the
sendmail server, as it is very old and complicated.

> > 4. How to receive the mail locally in the machine to see rather than
> > sending to the gmail.
>
> Once your mailserver is working, you'd want to change the email address
> associated with that user in the admin panel, so instead of trying to
> send it to sriram...@gmail.com <javascript:>, you want it to go to
> sriram...@yourdomain.com <javascript:>. You may also want to change
> the trac config
> to use the local mail server. Then you can check that email account
> instead of the IMAP account and get email there.
>
>
> And please explain to how to do change the trac config to use the local
> mail server.

See http://trac.edgewall.org/wiki/TracNotification

Specifically, you want to be certain that smtp_server is not set to
google's servers.

> I appreciate your immediate response and you gave a clear idea about the
> issue now. Thanks a ton!

Sorry for the delay in this reply - I'm in US Eastern Time zone, and I
went home. :-)

Sri Ram Kannan

unread,
Feb 5, 2015, 9:11:55 AM2/5/15
to trac-...@googlegroups.com
Thank you Matt. Will try to fix it as you said.
Reply all
Reply to author
Forward
0 new messages