Procmail configuration

Moderator: crythias

Post Reply
sakul123
Znuny newbie
Posts: 13
Joined: 14 Mar 2017, 07:19
Znuny Version: OTRS 3/4/5
Real Name: Sakul

Procmail configuration

Post by sakul123 »

Hi
I am trying to configure procmail for OTRS.
Below are the details.(followed http://wiki.otterhub.org/index.php?titl ... POP3/fetch)

vi /etc/postfix/main.cf

Code: Select all

mailbox_command = /usr/bin/procmail
vi /opt/otrs/.procmailrc

Code: Select all

SYS_HOME=/opt/otrs/
vi /etc/aliases

Code: Select all

mailer-daemon:  postmaster
postmaster:     root
vi /root/.fetchmailrc

Code: Select all

defaults
proto imap
set logfile "/var/log/fetchmaillog"
set daemon 60
set postmaster otrs#

poll XX.XX.XX.XX
protocol IMAP
user "domain\\account"
pass "Password Here"
folder 'Inbox'
is otrs here
flush
using Red Hat Enterprise Linux Server release 7.3 (Maipo), OTRS, MYSQL.
Email doesn't create as a ticket instead land into OTRS spool directory (/opt/otrs/var/spool).

What i am missing here?
Thanks
Best Regards
Sakul
OTRS 3/4/5 Centos/RHEL/Ubuntu/Fedora Mysql
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Procmail configuration

Post by root »

sakul123 wrote:
What i am missing here?
Hi,

You missed nearly everything. The wiki article is about receiving and NOT fetching e-mails. Not a single word about .fetchmailrc

It describes how to configure a postfix to receive(!) e-mails which were moved by using procmail into OTRS without being fetch from anywhere. Usually the use case for this is a huge amount of e-mails and the whish to prevent regular scheduling for getting e-mails into OTRS.

Using .fetchmailrc is an optional replacement for the built in PostMaster Email Accounts. In your example I'm missing the mda option.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
sakul123
Znuny newbie
Posts: 13
Joined: 14 Mar 2017, 07:19
Znuny Version: OTRS 3/4/5
Real Name: Sakul

Re: Procmail configuration

Post by sakul123 »

Thanks for reply,
root wrote: Using .fetchmailrc is an optional replacement for the built in PostMaster Email Accounts. In your example I'm missing the mda option.
yes we are using the optional fetchmail instead of Postmaster email accounts.

What's the correct configuration?
Thanks
Best Regards
Sakul
OTRS 3/4/5 Centos/RHEL/Ubuntu/Fedora Mysql
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Procmail configuration

Post by root »

Hi,

There's (should) a bundled .fetchmairc.(dist) in every OTRS installation with an example.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
sakul123
Znuny newbie
Posts: 13
Joined: 14 Mar 2017, 07:19
Znuny Version: OTRS 3/4/5
Real Name: Sakul

Re: Procmail configuration

Post by sakul123 »

Hi,

I have tried that using it renaming .fetchmailrc.dist to .fetchmailrc. Even there i face the same issue, the mail fall into spool directory.
Thanks
Best Regards
Sakul
OTRS 3/4/5 Centos/RHEL/Ubuntu/Fedora Mysql
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Procmail configuration

Post by root »

Hi,

Check all related logs. Are you really running three versions of OTRS?
Did you tried to run fetchmail interactive in verbnose mode?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
sakul123
Znuny newbie
Posts: 13
Joined: 14 Mar 2017, 07:19
Znuny Version: OTRS 3/4/5
Real Name: Sakul

Re: Procmail configuration

Post by sakul123 »

root wrote: Check all related logs.
maillog show this
Jun 26 06:01:03 mb2app169 postfix/qmgr[1219]: E1D4244F763D: removed
Jun 26 06:02:02 mb2app169 postfix/cleanup[3172]: 72F5D44F763D: message-id=<20170626060202.72F5D44F763D@mb2app169.localdomain>
Jun 26 06:02:02 mb2app169 postfix/bounce[5210]: 7029440CC6F0: sender non-delivery notification: 72F5D44F763D
Jun 26 06:02:02 mb2app169 postfix/qmgr[1219]: 72F5D44F763D: from=<>, size=2714, nrcpt=1 (queue active)
Jun 26 06:02:02 mb2app169 postfix/qmgr[1219]: 7029440CC6F0: removed
Jun 26 06:02:02 mb2app169 postfix/local[3162]: 72F5D44F763D: to=<otrs@mb2app169.localdomain>, relay=local, delay=0.07, delays=0/0/0/0.07, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)
Jun 26 06:03:01 mb2app169 postfix/cleanup[3172]: 85FDF44F763D: message-id=<20170626060301.85FDF44F763D@mb2app169.localdomain>
Jun 26 06:03:01 mb2app169 postfix/bounce[5210]: 84D9D40CC6F0: sender non-delivery notification: 85FDF44F763D
Jun 26 06:03:01 mb2app169 postfix/qmgr[1219]: 85FDF44F763D: from=<>, size=2793, nrcpt=1 (queue active)
Jun 26 06:03:01 mb2app169 postfix/qmgr[1219]: 84D9D40CC6F0: removed
Jun 26 06:03:01 mb2app169 postfix/local[5209]: 85FDF44F763D: to=<otrs@mb2app169.localdomain>, relay=local, delay=0.07, delays=0/0/0/0.07, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)
Jun 26 06:03:01 mb2app169 postfix/qmgr[1219]: 85FDF44F763D: removed
Jun 26 06:03:02 mb2app169 postfix/pickup[4575]: BEC1D40CC6F0: uid=1000 from=<otrs>
Jun 26 06:03:02 mb2app169 postfix/cleanup[3105]: BEC1D40CC6F0: message-id=<20170626060302.BEC1D40CC6F0@mb2app169.localdomain>
Jun 26 06:03:02 mb2app169 postfix/qmgr[1219]: BEC1D40CC6F0: from=<otrs@mb2app169.localdomain>, size=71308, nrcpt=1 (queue active)
root wrote: Are you really running three versions of OTRS?
Using OTRS 3.3.X
Thanks
Best Regards
Sakul
OTRS 3/4/5 Centos/RHEL/Ubuntu/Fedora Mysql
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Procmail configuration

Post by root »

Hi,

Just to clarify:

Do you want to RECEIVE mails via Postfix/Procmail or FETCH with fetchmail?

If you got problems in the first case consider the procmail log, as you can see in the maillog everything is properly passed to procmail.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
sakul123
Znuny newbie
Posts: 13
Joined: 14 Mar 2017, 07:19
Znuny Version: OTRS 3/4/5
Real Name: Sakul

Re: Procmail configuration

Post by sakul123 »

Procamail log shows

procmail: [4523] Mon Jun 26 09:06:03 2017
procmail: Assigning "LASTFOLDER=/opt/otrs//bin/otrs.PostMaster.pl"
procmail: Unlocking ".lock"
procmail: Notified comsat: "otrs@:/opt/otrs//bin/otrs.PostMaster.pl"
From otrs@mb2app169.localdomain Mon Jun 26 09:06:02 2017
Subject: Cron <otrs@mb2app169> $HOME/bin/otrs.GenericAgent.pl >> /dev/null
Folder: /opt/otrs//bin/otrs.PostMaster.pl 71043



/opt/otrs/.procmailrc

Code: Select all

SYS_HOME=/opt/otrs/
#SYS_HOME=$HOME

SHELL=/bin/sh
PATH=/bin:/usr/bin:/usr/local/bin
MONTHFOLDER=`date +%Y-%m`
YEARFOLDER=`date +%Y`
LOGFILE=$SYS_HOME/var/log/procmail-$MONTHFOLDER.log
VERBOSE=on

And is see there are getting created as ticket in OTRS.

[Mon Jun 26 09:05:11 2017][Info][Kernel::System::Ticket::TicketCreate] New Ticket [2017062693000075691/Cron <otrs@mb2a] created (TicketID=1860667,Queue=Dummy_Escalation_Agent_Q,Priority=3 normal,State=open)
Thanks
Best Regards
Sakul
OTRS 3/4/5 Centos/RHEL/Ubuntu/Fedora Mysql
Post Reply