RTIR fetchmail setup

Hi,

I’m tring to setup new RTIR with fetchmail on Debian and RT 4.
I have problem getting mailis from Exchange (OWA) to
/usr/bin/rt-mailgate.
And I don’t see them in RTIR website as new IR-s.
I read wiki at http://requesttracker.wikia.com/wiki/Fetchmail.

The first error I see in log is: “message … was not the expected
length”
Second one is: “403 Forbidden”
And third: “MDA returned nonzero status 75”

Could you provide an example conf for site with SSL enabled (does the
MTA use nonSSL or SSL URL?)
I tried to change it in fetchmail conf without any better results. As
fetchmail sees new mails, maybe there is a problem with MTA or rights?

Below you see my log file (names/pwd changed) and configuration:

fetchmail: 6.3.18 querying owa.cert.ee (protocol IMAP) at Mon 12 Mar
2012 06:57:49 PM EET: poll started
fetchmail: Trying to connect to 192.168.1.1/993…connected.
fetchmail: Server certificate:
fetchmail: Issuer Organization: Thawte, Inc.
fetchmail: Issuer CommonName: Thawte SSL CA
fetchmail: Subject CommonName: owa.cert.ee
fetchmail: owa.cert.ee key fingerprint:
12:74:76:13:E8:65:12:65:3F:42:5D:3F:A9:C1:61:E3
fetchmail: IMAP< * OK #2 IMAP4 service, secure only
fetchmail: IMAP> A0001 CAPABILITY
fetchmail: IMAP< * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI
AUTH=PLAIN IDLE NAMESPACE LITERAL+
fetchmail: IMAP< A0001 OK CAPABILITY completed.
fetchmail: Protocol identified as IMAP4 rev 1
fetchmail: GSSAPI error gss_inquire_cred: Unspecified GSS failure.
Minor code may provide more information
fetchmail: GSSAPI error gss_inquire_cred: Credentials cache file
‘/tmp/krb5cc_0’ not found
fetchmail: No suitable GSSAPI credentials found. Skipping GSSAPI
authentication.
fetchmail: If you want to use GSSAPI, you need credentials first,
possibly from kinit.
fetchmail: IMAP> A0002 AUTHENTICATE NTLM
/…/
fetchmail: reading message rtit@owa.cert.ee:5 of 5 (831 header
octets)About to rewrite From: Aivo Aivo@cert.ee
…rewritten version is From: Aivo Aivo@cert.ee.
fetchmail: about to deliver with: /usr/bin/rt-mailgate --url
http://rtir.cert.ee --queue ‘Incident Reports’ --action correspond
fetchmail: IMAP< )
fetchmail: IMAP< A0011 OK FETCH completed.
fetchmail: IMAP> A0012 FETCH 5 BODY.PEEK[TEXT]
fetchmail: IMAP< * 5 FETCH (BODY[TEXT] {5642}
fetchmail: (5642 body octets) (log message incomplete)
fetchmail: IMAP< )
fetchmail: IMAP< A0012 OK FETCH completed.
fetchmail: message rtiruser@owa.cert.ee:5 was not the expected length
(6473 actual != 5008 expected)
An Error Occurred

403 Forbidden
fetchmail: MDA returned nonzero status 75
fetchmail: not flushed
fetchmail: IMAP> A0013 LOGOUT
fetchmail: IMAP< * BYE Microsoft Exchange Server 2007 IMAP4 server
signing off.
fetchmail: IMAP< A0013 OK LOGOUT completed.
fetchmail: 6.3.18 querying owa.cert.ee (protocol IMAP) at Mon 12 Mar
2012 06:57:49 PM EET: poll completed

/etc/fetchmailrc

set daemon 120
set postmaster root
set no syslog
set logfile /var/log/fetchmail.log
set no bouncemail
defaults:
timeout 120
antispam -1
batchlimit 100
poll owa.cert.ee proto imap service 993:
username rtiruser password ThisIsPassword ssl mda “/usr/bin/rt-mailgate
–url http://rtir.cert.ee --queue ‘Incident Reports’ --action
correspond”
username rtircomment password ThisIsPassword ssl mda
“/usr/bin/rt-mailgate --url http://rtir.cert.ee --queue ‘Incident
Reports’ --action comment”

I run fetchmail in verbose mode as: fetchmail -f /etc/fetchmailrc -vvv

Regards,
Aivo

Hi,

fetchmail: message rtiruser@owa.cert.ee:5 was not the expected length
(6473 actual != 5008 expected)
An Error Occurred

403 Forbidden

This is apache not allowing rt-mailgate to connect to RT.
You can confirm this by checking the Apache logs to see what happened.
Do you have redirects or http->https redirects involved?
You could confirm that you can reach the rt-mailgate URL directly from
your server using something like curl -v before trying again with
rt-mailgate.

-kevin

After fixing location “REST/1.0/NoAuth” section in Apache vhost to allow
all requests and not to use external auth, the mails started coming.
Thank you for the solution!

Aivo13. märts 2012 1:54 kirjutas Kevin Falcone falcone@bestpractical.com:

This is apache not allowing rt-mailgate to connect to RT.
You can confirm this by checking the Apache logs to see what

happened.
Do you have redirects or http->https redirects involved?
You could confirm that you can reach the rt-mailgate URL directly
from
your server using something like curl -v before trying again with
rt-mailgate.

-kevin