Forwarding emails to an app?

mail

#1

I’m trying to get UCS to forward emails to Redmine via HTTP protocol and I can’t seem to get it working. Redmine provides an app called rdm-mailhandler.rb which should handle this as long as I can get the mailserver to forward emails to this app. What I’ve done so far/configuration:

UCS Domain: mydomain.intranet
Redmine Server/location: redmineserver/redmine

I’ve put rdm-mailhandler.rb in /var/mail on the UCS DC server and made it executable with chmod +x.
I’ve created a user called “redmine” with default email set to redmine@mydomain.intranet.

In the Univention Configuration Registry I’ve added an entry as follows:
UCS Variable: mail/alias/redmine
Value: redmineserver/redmine --key --project defaultproject --tracker bug --priority normal –-allow-override tracker,priority"

From what I understand, this SHOULD push any emails received at redmine@mydomain.intranet and do not get pushed to the app. Any ideas on what I’m missing?

-David

Redmine documentation on the process:
http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails
https://blog.rudeotter.com/incoming-redmine-email-from-mail-server/


#2

The UCR mail/alias/ is for local aliases. No domains should be used. A user account is not needed.

Please try with

ucr set redmine="/var/mail/rdm-mailhandl…

Then run

apt-get install swaks swaks --server 127.0.0.1 --port 25 --to redmine
and post any errors in the output and the relevant part of the logfile /var/log/mail.log.

Greetings,
Daniel Tröder


#3

Ok, I’m not sure what you mean by local aliases. Basically I need to be able to open up Outlook and send an email to 'redmine@mydomain.intranet’ and have it pipe through this.

I’ve tried ucr set redmine="… which seems to have run fine. swaks wouldn’t install for some reason, just said it couldn’t find it. Is UCS connected to the default canonical repos or would I have to add the repos manually? Anyway, I opened up outlook and sent a test email to 'redmine@mydomain.intranet’. Here’s the relevant portion of the mail.log file:

Sep 9 08:31:00 ucs-9543 postfix/smtpd[4055]: connect from mydomain104.mydomain.intranet[10.10.1.104] Sep 9 08:31:01 ucs-9543 postfix/smtpd[4055]: 0C80186151: client=mydomain104.mydomain.intranet[10.10.1.104] Sep 9 08:31:01 ucs-9543 postfix/cleanup[4059]: 0C80186151: message-id=<007301d0eb14$88050cd0$980f2670$@mydmoain.intranet> Sep 9 08:31:01 ucs-9543 postfix/qmgr[3861]: 0C80186151: from=<dradford@mydmoain.intranet>, size=2698, nrcpt=1 (queue active) Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: accepted connection Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: SSL_accept() incomplete -> wait Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: SSL_accept() succeeded -> done Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: starttls: TLSv1.2 with cipher AES256-SHA (256/256 bits new) no authentication Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: login: mydomain104.mydomain.intranet [10.10.1.104] dradford@mydmoain.intranet plaintext+TLS User logged in SESSIONID=<cyrus-3983-1441812662-1> Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: client id: "name" "Microsoft Outlook" "version" "15.0.4745.1000" Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: open: user dradford@mydmoain.intranet opened INBOX/Sent Items Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: open: user dradford@mydmoain.intranet opened INBOX/Sent Items Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: open: user dradford@mydmoain.intranet opened INBOX/Sent Items Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: open: user dradford@mydmoain.intranet opened INBOX/Sent Items Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:02 ucs-9543 cyrus/imaps[3983]: fetching user_deny.db entry for 'dradford@mydmoain.intranet' Sep 9 08:31:03 ucs-9543 postfix/smtpd[4055]: disconnect from mydomain104.mydomain.intranet[10.10.1.104] Sep 9 08:31:10 ucs-9543 postfix/smtpd[4115]: connect from localhost[127.0.0.1] Sep 9 08:31:10 ucs-9543 postfix/smtpd[4115]: 4F76A86155: client=localhost[127.0.0.1], orig_queue_id=0C80186151, orig_client=mydomain104.mydomain.intranet[10.10.1.104] Sep 9 08:31:10 ucs-9543 postfix/cleanup[4059]: 4F76A86155: message-id=<007301d0eb14$88050cd0$980f2670$@mydmoain.intranet> Sep 9 08:31:10 ucs-9543 postfix/qmgr[3861]: 4F76A86155: from=<dradford@mydmoain.intranet>, size=3441, nrcpt=1 (queue active) Sep 9 08:31:10 ucs-9543 postfix/smtpd[4115]: disconnect from localhost[127.0.0.1] Sep 9 08:31:10 ucs-9543 amavis[30542]: (30542-02) Passed, <dradford@mydmoain.intranet> -> <redmine@mydmoain.intranet>, quarantine OiW5APf-CeeA, Message-ID: <007301d0eb14$88050cd0$980f2670$@mydmoain.intranet>, Hits: -1.007 Sep 9 08:31:10 ucs-9543 cyrus/master[4322]: about to exec /usr/lib/cyrus/bin/lmtpd Sep 9 08:31:10 ucs-9543 postfix/smtp[4060]: 0C80186151: to=<redmine@mydmoain.intranet>, relay=127.0.0.1[127.0.0.1]:10024, delay=9.3, delays=0.01/0/0/9.3, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4F76A86155) Sep 9 08:31:10 ucs-9543 postfix/qmgr[3861]: 0C80186151: removed Sep 9 08:31:10 ucs-9543 cyrus/lmtp[4322]: executed Sep 9 08:31:10 ucs-9543 cyrus/lmtp[4322]: accepted connection Sep 9 08:31:10 ucs-9543 cyrus/lmtp[4322]: connection from localhost [127.0.0.1] preauth'd as postman Sep 9 08:31:10 ucs-9543 cyrus/lmtp[4322]: Delivered: <007301d0eb14$88050cd0$980f2670$@mydmoain.intranet> to mailbox: mydomain.intranet!user.redmine Sep 9 08:31:10 ucs-9543 cyrus/lmtp[4322]: USAGE redmine user: 0.008000 sys: 0.024000 Sep 9 08:31:10 ucs-9543 postfix/lmtp[4116]: 4F76A86155: to=<redmine@mydmoain.intranet>, relay=127.0.0.1[127.0.0.1]:2003, delay=0.08, delays=0.01/0/0.01/0.06, dsn=2.1.5, status=sent (250 2.1.5 Ok SESSIONID=<cyrus-4322-1441812670-1>) Sep 9 08:31:10 ucs-9543 postfix/qmgr[3861]: 4F76A86155: removed


#4

Ok, I’m getting closer. Was able to get it working by using a local address, ie: sending an email to redmine@cnllc.intranet, and would that require a UCS user for Redmine?


#5

The file you have to edit for virtual aliases (postfix.org/virtual.5.html) should be /etc/postfix/virtual

Its format is:

user@virtual-alias.domain      address2, address3

I haven’t used it with a pipe, but it should work just as the local alias table.

After editing the file, run

postmap /etc/postfix/virtual

to activate the changes (Postfix actually uses /etc/postfix/virtual.db).

Greetings
Daniel Tröder


#6

Frequently I need to forward important emails from work to my home address as well. Here is how to set this up with the OS X mail application.

Here is how to setup forwarding emails from certain contacts to another email address. This is particularly useful for forwarding emails from certain people to SMS.

  1. Open Mail

  2. Click Preferences

  3. Select the Rules tab

  4. Click the Add Rule button

  5. Name the rule whatever you wish

  6. Create the rule with something similar to the following:

From Contains vip@email.com
Forward Message to newemail@email.com

This will forward all messages that you receive from newemail@email.com. Using this you can forward important emails at work to home or SMS, for example.

See an example of this below…