Bug 44443 - Add arbitrary options to each "poll" line in fetchmailrc
Add arbitrary options to each "poll" line in fetchmailrc
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Mail
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: Mail maintainers
Mail maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-21 15:23 CEST by Nico Stöckigt
Modified: 2020-07-03 20:55 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017042121000472
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2017-04-21 15:23:32 CEST
Fetchmail should also support 'smtpHost' and 'smtpName'. This needs 3 steps to realize:
- add 2 extended attributes
- add them to the ldap schema
  /var/lib/univention-ldap/local-schema/univention-fetchmail.schema
- extend the UDM Hook
  /usr/lib/univention-directory-listener/system/fetchmailrc.py
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2017-04-25 10:32:01 CEST
Can you please explain which scenario shall be supported by adding these 2 options?
Comment 2 Nico Stöckigt univentionstaff 2017-04-25 11:40:41 CEST
(In reply to Sönke Schwardt-Krummrich from comment #1)
> Can you please explain which scenario shall be supported by adding these 2
> options?

This was a customers request.
afiak the environment has two mailservers and the customer already rewrites the mail address. So by fulfill this FR it is possible to fetch external mails to a specific mailserver and change the mail address from an external to the internal one.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2017-04-26 15:45:17 CEST
(In reply to Nico Stöckigt from comment #2)
> afiak the environment has two mailservers and the customer already rewrites
> the mail address. So by fulfill this FR it is possible to fetch external
> mails to a specific mailserver and change the mail address from an external
> to the internal one.

JFYI:
For rewriting external addresses to internal one and vice versa the UCS package
univention-mail-canonical-maps can be used. This package defines additional extended attributes that are evaluated on each UCS mail system.
The forwarding to specific mailboxes is done via the univentionMailHomeServer attribute.

I currently do not see the benefit of fetching mails on one system and directly sending it to another postfix instead of the local postfix.
Comment 4 Tobias Birkefeld univentionstaff 2017-05-19 13:46:32 CEST
(In reply to Sönke Schwardt-Krummrich from comment #1)
> Can you please explain which scenario shall be supported by adding these 2
> options?


The customer request if fetchmail could forward the mail to another smtp server instead of deliver the mail to the (UCS) mailserver with the users mailbox.

Therefor fetchmail has the option to specify 'smtpHost' and 'smtpName' to send the fetched mail direct to another mailserver (smtpHost, see http://www.fetchmail.info/fetchmail-man.html#34).

In deed the customer environment has a mail archive system, which also do a lot of mail filter before the mail 1) is archived and 2) is delivered to the user's mailbox. Thats why the postfix archive mode via always_bcc is not working in this scenario.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2017-05-26 10:31:28 CEST
This is a rather rare scenario. I would suggest to implement a generic solution that allows customers to add arbitrary fetchmail options.

Suggestion:
UCR-Variable that contains a string that is appended to each fetchmailrc line:
fetchmail/useroptions/append=\
       'smtphost "extern.example.com" smtpname "%(univentionFreeAttribute2)s"'

This way the requested values are appended to each user line in fetchmailrc.
If user specific values are required:

fetchmail/useroptions/append="%(univentionFreeAttribute3)s"

So the customer is able to specify user specific options via an extended attribute (univentionFreeAttribute3) in UMC.
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2017-05-26 10:34:37 CEST
A ucs-test script should check if 
a) the values from the UCR variable are appended if specified and
b) if LDAP attributes are correctly inserted if they do exist in LDAP, otherwise replaced with an empty string.
Comment 7 jester 2017-08-31 15:11:12 CEST
About the only reason i'm not using UCS yet is because i rely on multidrop for mail in several locations. A way to append (or optionally overrule) each fetchmailrc line on a per-user basis would seem to open up possibilities.

Is there any chance this use-case can be taken into account with the suggested generic solution?
Comment 8 Ingo Steuwer univentionstaff 2020-07-03 20:55:47 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.