This guidelines is for Bugzilla and James on the same server. (I have not tested with different servers yet.)
1. Install Bugzilla.
2. Download Apache James Server 3.0-M2 and unzip to your server.
3. Config James Server
Open file mailetcontainer.xml in conf folder.
Add these lines before <mailet match="All" class="RemoteDelivery">
<mailet match="HostIs=gmail.com" class="RemoteDelivery">
<outgoingQueue>outgoing</outgoingQueue>
<delayTime>5 minutes</delayTime>
<debug>true</debug>
<maxRetries>25</maxRetries>
<maxDnsProblemRetries>0</maxDnsProblemRetries>
<deliveryThreads>10</deliveryThreads>
<sendpartial>true</sendpartial>
<bounceProcessor>bounces</bounceProcessor>
<gateway>smtp.gmail.com</gateway>
<gatewayPort>587</gatewayPort>
<gatewayusername>your gmail</gatewayusername>
<gatewayPassword>your password</gatewayPassword>
<!-- enable starttls -->
<mail.smtp.starttls.enable>true</mail.smtp.starttls.enable>
</mailet>
4. Start James Server
5. Config Bugzilla
Log in Bugzilla with administrator account.
Click Parameters -> Email
Update smtpserver to IP address of your James Server
Save changes.