[rt-users] Using different Incoming Mail Server

Kevin Squire gentgeen at linuxmail.org
Wed May 2 16:06:20 EDT 2007


On Wed, 2 May 2007 14:56:16 -0400
"Richard Solid" <richardsolid at gmail.com> wrote:

> Hello,
> 
> I need to configure my RT server to receive the emails but from
another mail
> server.

<SNIPED>

We just use fetchmail on the RT server.  Then I run things from
fetchmail through procmail so that I can filter out spam and such.  The
formail command allows me to keep the Queues seperate, but still only
have one RT user on the RT server. (all \ mean long wrapped line.  take
out if you copy/paste and move all to one line)


rtuser at trouble:~$ cat .fetchmailrc 
set logfile /home/rtuser/logs/fetchmail.log
#------------------------------------------------
poll smtp.example.com protocol pop3 and port 995

# Queue 1
   username rt at example.com password xxxxxx
   mda '/usr/bin/formail -f \
   -A "X-Original-Account: rt at example.com" | \
   /usr/bin/procmail -d rtuser'

   username rt-comment at example.com password xxxxxx
   mda '/usr/bin/formail -f \ 
   -A "X-Original-Account: rt-comment at example.com" | \
   /usr/bin/procmail -d rtuser'

# Queue 2
   username rt2 at example.com password yyyyyyy
   mda '/usr/bin/formail -f \
   -A "X-Original-Account: rt2 at example.com" |  \
   /usr/bin/procmail -d rtuser'

   username rt2-comments at example.com password yyyyyyyy
   mda '/usr/bin/formail -f \ 
   -A "X-Original-Account: rt2-comments at example.com" | \
   /usr/bin/procmail -d rtuser'


rtuser at trouble:~$ cat .procmailrc 
# Standard Procmail variable declared here
#----------------------------------------------------------------------
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
:0fw
* < 256000
| /usr/bin/spamc -d 192.168.74.3 -p 783

# If the message was actually skipped, we want to know
:0Ef
| formail -A "X-Spam-Skipped:  Yes =Message not tested by SpamAssassin="
#-------------------------------------------------------
# Get Spam out of the way
:0:
* ^X-Spam-Status: Yes
$DEFAULT
#-----------------------------------------------------------
# I have a few other procmail recipes here
#-----------------------------------------------------------

# Helpdesk emails
:0
* ^X-Original-Account:.*rt at example.com
| /usr/bin/rt-mailgate --url http://your.url.here \ 
    --queue helpdesk --action correspond

:0
* ^X-Original-Account:.*rt-comment at example.com
| /usr/bin/rt-mailgate --url http://your.url.here \
    --queue helpdesk --action comment
#-----------------------------------------------------------
# Recuitment emails
:0
* ^X-Original-Account:.*rt2 at example.com
| /usr/bin/rt-mailgate --url http://your.url.here \
    --queue Recruitment --action correspond

:0
* ^X-Original-Account:.*rt2-comment at example.com
| /usr/bin/rt-mailgate --url http://your.url.here \
    --queue Recruitment --action comment

#---------------------------------------------------
# This drops any Unsorted mail into the INBOX
:0:
$DEFAULT



-- 
http://gentgeen.homelinux.org

#############################################################
 Associate yourself with men of good quality if you esteem    
 your own reputation; for 'tis better to be alone then in bad 
 company.        - George Washington, Rules of Civility



More information about the rt-users mailing list