Fetchmail Headache

Hello everyone!

My company recently got a working install of RT and Postfix up and it was
running fine without fetchmail, just that everyone had to log into the RT
portal. We decided this last monday to install fetchmail on the CentOS box
to make it easier for the employees to create tickets and comment on them
too. However, after five days of research and problems, I am admitting
defeat to fetchmail. I could really use some help with the configuration,
any help, because I am helplessly lost. I just reinstalled fetchmail, so it
needs the fetchmailrc file (which is the root of my problem) and if someone
could help me configure that file, and the rest of it too, it would be
extremely hellpful!

Thanks,

George

Hello everyone!

My company recently got a working install of RT and Postfix up and it
was running fine without fetchmail, just that everyone had to log into
the RT portal. We decided this last monday to install fetchmail on the
CentOS box to make it easier for the employees to create tickets and
comment on them too. However, after five days of research and
problems, I am admitting defeat to fetchmail. I could really use some
help with the configuration, any help, because I am helplessly lost. I
just reinstalled fetchmail, so it needs the fetchmailrc file (which is
the root of my problem) and if someone could help me configure that
file, and the rest of it too, it would be extremely hellpful!

It’s actually quite simple. We use a very basic configuration here:

All mail destined for RT goes to an IMAP inbox somewhere (different
server than RT here).

We created a user “rtimap” on our linux box running RT.

.fetchmailrc
poll servername.domain.somewhere proto IMAP user “username” with pass
"password" fetchall idle

The magic is done in /etc/aliases (could be configured by maildrop,
procmail and others, too, I believe.)
All mails are delivered directly to the utility rt-mailgate, which is
part of the rt installation (afair).
Just set the queue they should go to and the right url.
We encountered problems with https here, so you may want to try http, at
least locally.

rtimap: “|/usr/bin/rt-mailgate --queue ‘Incoming’ --action correspond
–url http://server.running.rt/in/this/directory/

(don’t forget to run “newaliases”)

We try to start fetchmail as cronjob every 10 minutes:
*/10 * * * * /usr/bin/fetchmail -s 2>/dev/null >/dev/null

But fetchmail will be kept logged in to the mailbox (keyword “idle” in
.fetchmailrc), and react instantly to new mails, so this is just in case
the connection vanishes to reestablish it.

I highly recommend the >/dev/null 2>/dev/null part, otherwise mails
generated from cron will go to rtimap, which will create a ticket via
aliases for each mail.

Regards,
Marco

The problem was that the fetchmailrc file wasn’t in the install, so we made
it. Neither could we find the fetchmail.conf from the install. Could we have
done the yum command wrong for the installation?

and a couple of questions:

where do we run newaliases?
where is the fetchmailrc file located, and what are the correct settings to
point it to RT
and the command with --queue is where we got our syntax errors. does there
have to be single quotes around the queue name?

thanks so much, sorry for my lack of knoledge, but I’ve been kind of
flustered because all I’ve had to work on the entire RT configuration is a
command line only CentOS installation running on a different computer…

GeorgeOn Fri, Jul 23, 2010 at 3:05 PM, Marco Dieckhoff dieckhoff@bremskerl.dewrote:

Am 23.07.2010 22:53, schrieb George Simpson:

Hello everyone!

My company recently got a working install of RT and Postfix up and it was
running fine without fetchmail, just that everyone had to log into the RT
portal. We decided this last monday to install fetchmail on the CentOS box
to make it easier for the employees to create tickets and comment on them
too. However, after five days of research and problems, I am admitting
defeat to fetchmail. I could really use some help with the configuration,
any help, because I am helplessly lost. I just reinstalled fetchmail, so it
needs the fetchmailrc file (which is the root of my problem) and if someone
could help me configure that file, and the rest of it too, it would be
extremely hellpful!

It’s actually quite simple. We use a very basic configuration here:

All mail destined for RT goes to an IMAP inbox somewhere (different server
than RT here).

We created a user “rtimap” on our linux box running RT.

.fetchmailrc
poll servername.domain.somewhere proto IMAP user “username” with pass
"password" fetchall idle

The magic is done in /etc/aliases (could be configured by maildrop,
procmail and others, too, I believe.)
All mails are delivered directly to the utility rt-mailgate, which is part
of the rt installation (afair).
Just set the queue they should go to and the right url.
We encountered problems with https here, so you may want to try http, at
least locally.

rtimap: “|/usr/bin/rt-mailgate --queue ‘Incoming’ --action correspond --url
http://server.running.rt/in/this/directory/

(don’t forget to run “newaliases”)

We try to start fetchmail as cronjob every 10 minutes:
*/10 * * * * /usr/bin/fetchmail -s 2>/dev/null >/dev/null

But fetchmail will be kept logged in to the mailbox (keyword “idle” in
.fetchmailrc), and react instantly to new mails, so this is just in case the
connection vanishes to reestablish it.

I highly recommend the >/dev/null 2>/dev/null part, otherwise mails
generated from cron will go to rtimap, which will create a ticket via
aliases for each mail.

Regards,
Marco

The problem was that the fetchmailrc file wasn’t in the install, so we made
it. Neither could we find the fetchmail.conf from the install. Could we have
done the yum command wrong for the installation?

No, the fetchmailrc is unique to you. There’s no way to provide you
with a relevant one without you providing a lot of information.

and a couple of questions:
where do we run newaliases?

On the host running postfix.

where is the fetchmailrc file located, and what are the correct settings to
point it to RT

Wherever you want - if you don’t specify it on the command line it
needs to be in $HOME/.fetchmailrc of the user running fetchmail, which
shouldn’t be root. As for the correct settings, I just did a search
for “fetchmail” on the RT wiki and found a large number of documents
that are relevant, including:

http://rt.bestpractical.com/view/POP3Mailgate
http://rt.bestpractical.com/view/fetchmail
http://rt.bestpractical.com/view/GoogleApps

and the command with --queue is where we got our syntax errors. does there
have to be single quotes around the queue name?
thanks so much, sorry for my lack of knoledge, but I’ve been kind of
flustered because all I’ve had to work on the entire RT configuration is a
command line only CentOS installation running on a different computer…

Do make use of the wiki - it’s pretty much all we needed to get our RT
install up and running (the book came in handy a few times too).

             Please keep list traffic on the list.

Rob MacGregor
Whoever fights monsters should see to it that in the process he
doesn’t become a monster. Friedrich Nietzsche

Hi,

Our fetchmail setup is this…

  1. fetchmailstart.sh script in the RT install location. This is just a 1
    liner that has the fetchmail command, the fetchmailrc file we setup, the
    argument to tell fetchmail to start as a daemon.

  2. fetchmailrc file which is setup based off of the documentation in the
    linux man file for fetchmail

  3. Command to start fetchmail at system startup in the rc.local so when the
    server boots up, it’s running.

the fetchmailrc file is not delivered with fetchmail or rt… but as I said
the man pages tell you everything you need to know. USe those, and google
"fetchmailrc examples" and you should be able to build one. I have queues
pulling from both imap(Groupwise and google apps education), and pop3 from
an external (unknown) email server.

Let me know if you want anymore info… fetchmail I believe is the easiest
part of the RT install.

Monday I could send you some stuff to help ya out.

Thanks!
Mike.On Sat, Jul 24, 2010 at 4:10 AM, Rob MacGregor rob.macgregor@gmail.comwrote:

On Fri, Jul 23, 2010 at 23:19, George Simpson simpsongeorge68@gmail.com wrote:

The problem was that the fetchmailrc file wasn’t in the install, so we
made
it. Neither could we find the fetchmail.conf from the install. Could we
have
done the yum command wrong for the installation?

No, the fetchmailrc is unique to you. There’s no way to provide you
with a relevant one without you providing a lot of information.

and a couple of questions:
where do we run newaliases?

On the host running postfix.

where is the fetchmailrc file located, and what are the correct settings
to
point it to RT

Wherever you want - if you don’t specify it on the command line it
needs to be in $HOME/.fetchmailrc of the user running fetchmail, which
shouldn’t be root. As for the correct settings, I just did a search
for “fetchmail” on the RT wiki and found a large number of documents
that are relevant, including:

http://rt.bestpractical.com/view/POP3Mailgate
http://rt.bestpractical.com/view/fetchmail
http://rt.bestpractical.com/view/GoogleApps

and the command with --queue is where we got our syntax errors. does
there
have to be single quotes around the queue name?
thanks so much, sorry for my lack of knoledge, but I’ve been kind of
flustered because all I’ve had to work on the entire RT configuration is
a
command line only CentOS installation running on a different computer…

Do make use of the wiki - it’s pretty much all we needed to get our RT
install up and running (the book came in handy a few times too).


Please keep list traffic on the list.

Rob MacGregor
Whoever fights monsters should see to it that in the process he
doesn’t become a monster. Friedrich Nietzsche

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON P7B 5E1
Phone: (807) 766-7331
Email: mike.johnson@nosm.ca