Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master.cf does not support custom arguments with custom services #87

Open
leonhedding opened this issue Dec 6, 2018 · 5 comments
Open

Comments

@leonhedding
Copy link

I made a change to postfix/files/master.cf. I don't know how to make a pull request here.

I replaced lines 139 - 149 of the current version with the below. It allows me to setup amivisd on port 10025 with all the arguments that I need.

{%-   if wrap %}
{{      parameter_str | wordwrap(width=wrap, break_long_words=False, wrapstring='\n%s  ' | format(comment)) }}
{%-   else %}
{{      parameter_str }}
{%-   endif -%}
{%-   elif 'user' in service or 'argv' in postfix_master_services.defaults[service_name] -%}
{%-      set parameter_str = "%s  user=%s argv=%s %s" | format(comment,
                                            service_param(service, service_name, 'user'),
                                            service_param(service, service_name, 'argv'),
                                            service_param(service, service_name, 'extras', '')) -%}
{%-   if wrap %}
{{      parameter_str | wordwrap(width=wrap, break_long_words=False, wrapstring='\n%s  ' | format(comment)) }}
{%-   else %}
{{      parameter_str }}
{%-   endif -%}
{%-   endif -%}
{%-   if service.args is not none -%}
{%-     for option in service.get('args', postfix_master_services.defaults[
                                            service_name].get('args', [])) -%}
{%-       if option.startswith('#') %}
{{ option }}
{%-       else %}
{{ comment }}  {{ option }}
{%-       endif %}
{%-     endfor %}
{%-   endif %}
@alxwr alxwr pinned this issue Dec 14, 2018
@roskens
Copy link

roskens commented Feb 13, 2019

Creating a PR is super easy.

  1. Fork the repository
  2. Edit the file in your forked repository, (The pencil icon next to the trash can)
  3. Add a commit message, and then select the "Create a new branch for this commit and start a pull request." option.
  4. Click "Propose file change button".

I take it you want to add the if service.args ... block to the extra_service macro?

@leonhedding
Copy link
Author

Yes, that would be about correct.

@ixs
Copy link
Contributor

ixs commented May 27, 2019

@leonhedding I'd like a bit of clarification of your initial problem. I believe I have a fix for your problem, but wanna make sure I understand your underlying issue.

You would like to add a custom service to the master.cf config.
You are trying to do that via the postfix:master_config:services pillar.
Your service should be something like one of the existing postfix services, such as smtpd, smtp etc.?
But instead you end up with a dovecot-deliver or mailman styled service at the bottom of the file where argv and user is defined but empty? And you actually do not want that, right?

@leonhedding
Copy link
Author

It has been a while since I reviewed this, but I am pretty certain that is the issue I was having is what you describe. It was putting in text that I can't have for the amavisd setup. It should be setup like smtpd, but have a different name and port.

@gojufhv
Copy link

gojufhv commented Apr 19, 2020

I've had the same problem - as workaround i used the extras variable:

mymailfilter:
        enable: true
        extras: |
          -o content_filter=
           -o local_recipient_maps=
           -o relay_recipient_maps=
           -o myhostname=localhost
           -o smtpd_helo_restrictions=
           -o smtpd_client_restrictions=
           -o smtpd_sender_restrictions=
           -o smtpd_recipient_restrictions=permit_mynetworks,reject
           -o mynetworks=127.0.0.0/8
        no_args: true

@fzipi fzipi unpinned this issue Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants