GithubHelp home page GithubHelp logo

modoboa / modoboa-postfix-autoreply Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 10.0 310 KB

Away message editor for Modoboa (postfix compatible)

License: MIT License

Python 99.22% HTML 0.78%
autoreply modoboa postfix vacation

modoboa-postfix-autoreply's Introduction

Modoboa (website)

workflow codecov Latest version on Pypi

Modoboa is a mail hosting and management platform including a modern and simplified Web User Interface. It provides useful components such as an administration panel and webmail.

Modoboa integrates with well known software such as Postfix or Dovecot. A SQL database (MySQL, PostgreSQL or SQLite) is used as a central point of communication between all components.

Modoboa is developed with modularity in mind, expanding it is really easy. Actually, all current features are extensions.

It is written in Python 3 and uses the Django, jQuery and Bootstrap frameworks.

Main features

Installation

The easiest way to install modoboa is to use the official installer. More information is available in the documentation.

Documentation

A detailed documentation will help you to install, use or extend Modoboa.

Demo Installation

If you want to try out Modoboa, check out our demo installation.

Getting help

Modoboa is a free software and is totally open source BUT you can hire the team if you need professional services. More information here: https://modoboa.org/en/professional-services/.

Contracting a support plan if a good way to ensure your installation stays available and up-to-date and it will help the project to be sustainable :)

Community

If you have any questions, you can get help through the following platforms:

  • Discord
  • Github: open an issue if you found a bug

External code

The following external libraries are provided with Modoboa:

modoboa-postfix-autoreply's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar disko avatar gawel avatar i404788 avatar kryskool avatar nomad2k avatar phaf avatar spitfireap avatar stephane-klein avatar tonioo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

modoboa-postfix-autoreply's Issues

the postfix_map command should be run has a standard management command

No need to generate postfix_maps from the modoboa-admin script.
If you use a standard command, you can get the app context and avoid passing the --db-url parameters.
You'll also be able to use the orm to generate maps (and avoid typo and other stupid bugs)

For instance, this will generate the correct query for the autoreply plugin:

>>> str(Transport.objects.filter(domain='%s').values('method').query)
'SELECT `postfix_autoreply_transport`.`method` FROM `postfix_autoreply_transport` WHERE `postfix_autoreply_transport`.`domain` = %s'

Version 1.1.4 is called 1.1.3 in modoboa-core

In modoboa_postfix_autoreply/modo_extension.py this project is still called 1.1.3, which triggers the update detection in modoboa. Not something to release a new version over, but just a reminder for 1.1.5 ;-)

Time window for the postfix autoreply

From @tonioo on December 4, 2013 15:30

Originally created by Patrick Hetu on 2012-04-17T19:15:46Z

I've coded an autoreply system base on django for our shared hosting infrastructure and since
Modoboa is much cooler and much more complet, I would like to add one feature to Modoboa
and then switch to it.

The feature would be to make it possible to specify a time window for autoreplies.

A use case could be: Sending an "away to lunch" message only during lunch time in the week.

It would requires to add python-dateutil as a dependency, updating the UI and migrating the database schema
and data.

If your agree, I will attach a patch to this ticket.

If you want to check to code that I'll be base on:

https://redmine.koumbit.net/projects/autorepalternc/repository

If you want more details on how I would do it just ask me.

Copied from original issue: modoboa/modoboa#247

autoreply and API

Hi @tonioo!

Can we access autoreply with the Modoboa API?

Not found something related to autoreply in the API documentation.

I would like to develop an autoreply plugin for RoundCube using the API and Token.

Sincerely,

Autoreply error

when setting out of the office the sender gets this error:

No out-of-the office message is being send, the original message goes throug.

This is the mail system at host xxx.xxx.xxx.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

               The mail system

<"[email protected]"@autoreply.xxx.xxx> (expanded from
[email protected]): Command died with status 1:
"/srv/modoboa/env/bin/python". Command output: Traceback (most recent call
last): File "/srv/modoboa/instance/manage.py", line 22, in
execute_from_command_line(sys.argv) File
"/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/init.py",
line 364, in execute_from_command_line utility.execute() File
"/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/init.py",
line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File
"/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py",
line 283, in run_from_argv self.execute(*args, **cmd_options) File
"/srv/modoboa/env/lib/python2.7/site-packages/django/core/management/base.py",
line 330, in execute output = self.handle(*args, **options) File
"/srv/modoboa/env/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
line 163, in handle sender_localpart = split_mailbox(sender.lower())[0]
File
"/srv/modoboa/env/lib/python2.7/site-packages/modoboa/lib/email_utils.py",
line 316, in split_mailbox local_part, domain = split_address(mailbox)
File
"/srv/modoboa/env/lib/python2.7/site-packages/modoboa/lib/email_utils.py",
line 269, in split_address "address should be of type %s" %
six.text_type.name AssertionError: address should be of type unicode

Weird emails can break autoreply

We got this:

Traceback (most recent call last):
  File "/var/www/modoboa/bearboa/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
    output = self.handle(*args, **options)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 169, in handle
    send_autoreply(sender, mbox, armessage, original_msg)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 78, in send_autoreply
    msg.send()
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/message.py", line 342, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 107, in send_messages
    sent = self._send(message)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 121, in _send
    message = email_message.message()
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/message.py", line 307, in message
    msg['Subject'] = self.subject
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/message.py", line 232, in __setitem__
    name, val = forbid_multi_line_headers(name, val, self.encoding)
  File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/mail/message.py", line 92, in forbid_multi_line_headers
    raise BadHeaderError("Header values can't contain newlines (got %r for header %r)" % (val, name))
django.core.mail.message.BadHeaderError: Header values can't contain newlines (got u"Auto: Votre inscription \xe0 xxx Re: =?UTF-8?Q?Session_Publique_=3A_Un_point_sur_la_notion_de_communa?=\n\t=?UTF-8?Q?ut=C3=A9=2C_10_ans_apr=C3=A8s_le_web_social?=" for header u'Subject')

I don't really understand how a \n is in the original subject but that's a fact. It happens.

I think we should try to decode the header and check if the subject is valid and if not, don't include it in the reply's subject.

Thoughts ?

[Version 1.5.0] Problem of lookup with SQL table

Bonjour,

After upgrade to version 1.5.0, it is no more possible to use the plugin as it prevents postfix to perform correctly its requests in the table sql-autoreplies-transport.cf
Here are some errors I got:
38301:Oct 2 17:51:24 mail postfix/trivial-rewrite[2983]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "*"
38302:Oct 2 17:51:24 mail postfix/trivial-rewrite[2983]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "*"
38303:Oct 2 17:51:24 mail postfix/trivial-rewrite[2983]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "*"
38304:Oct 2 17:51:24 mail postfix/trivial-rewrite[2983]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "*"
118379:Oct 4 21:27:51 mail postfix/trivial-rewrite[29715]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "[email protected]"
118381:Oct 4 21:27:51 mail postfix/trivial-rewrite[29715]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "[email protected]"
118383:Oct 4 21:27:51 mail postfix/trivial-rewrite[29715]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "[email protected]"
118385:Oct 4 21:27:51 mail postfix/trivial-rewrite[29715]: warning: mysql:/etc/postfix/modoboa/sql-autoreplies-transport.cf lookup error for "[email protected]"

The upgrade process
$ python manage.py migrate modoboa_postfix_autoreply
$ python manage.py collectstatic
$ python manage.py load_initial_data
did not generate any error (I did not capture the output).

Can you advise of the possible actions to perform ?

Do not load autoreply forms for admins with no mailbox

Traceback:
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  394.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  394.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context
  297.                 return func(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/views/identity.py" in editaccount
  180.     events.raiseEvent("FillAccountInstances", request.user, account, instances)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent
  90.         callback(*args, **kwargs)
File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/general_callbacks.py" in fill_account_tab
  55.         if account.mailbox:
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in __get__
  428.                     self.related.get_accessor_name()

Exception Type: RelatedObjectDoesNotExist at /admin/accounts/edit/1/
Exception Value: User has no mailbox.

Autoreply error (Header values can't contain newline)

Morning, since I updated to Modoboa 1.15 with Django 3.6 and Postfix-autoreply 1.6.0. I am getting this error sending emails to an account with autoreply on:

Remote Server returned 'XXX X.X.X < #5.3.0 x-unix; Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 214, in handle send_autoreply(sender, mbox, armessage, original_msg) File "/srv/modoboa/env/lib/python3.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 107, in send_autoreply msg.send() File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/message.py", line 291, in send return self.get_connection(fail_silently).send_messages([self]) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 110, in send_messages sent = self._send(message) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 124, in _send message = email_message.message() File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/message.py", line 275, in message msg[name] = value File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/message.py", line 169, in setitem name, val = forbid_multi_line_headers(name, val, self.encoding) File "/srv/modoboa/env/lib/python3.7/site-packages/django/core/mail/message.py", line 60, in forbid_multi_line_headers raise BadHeaderError("Header values can't contain newlines (got %r for header %r)" % (val, name)) django.core.mail.message.BadHeaderError: Header values can't contain newlines (got '\n AM0PR03MB553776DDF4AEA9363446D10FB94B0@AM0PR03MB5537.eurprd03.prod.outlook.com' for header 'In-Reply-To')>'

Auto Reply Error & return to sender

I see an error with one account that result in a non-delivery notification to the sender:

to=<[email protected]@autoreply.example.com>, orig_to=<[email protected]>, relay=autoreply, delay=0.78, delays=0.14/0/0/0.64, dsn=5.3.0, status=bounced (Command died with status 1: "python". Command output: Traceback (most recent call last): File "/opt/ModoboaWeb/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/usr/local/lib/python2.7/dist-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 169, in handle send_autoreply(sender, mbox, armessage, original_msg) File "/usr/local/lib/python2.7/dist-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 78, in send_autoreply msg.send() File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", line 342, in send return self.get_connection(fail_silently).send_messages([self]) File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 107, in send_messages sent = self._send(message) File "/usr/local/lib/python2.7/dist-packages/django/core/mail/backends/smtp.py", line 121, in _send message = email_message.message() File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", line 307, in message msg['Subject'] = self.subject File "/usr/local/lib/python2.7/dist-packages/django/core/mail/message.py", line 232,

What's wrong ?

"Method" missing in postfix_autoreply_transport

Hi,

when (re)deploying (install, migrate, load_initial_data) the modoboa-postfix-autoreply plugin the created postfix_autoreply_transport table is missing the appropriate entries (autoreply:) in the method column:

mysql> select * from postfix_autoreply_transport;
+----+----------------------------------+--------+
| id | domain                           | method |
+----+----------------------------------+--------+
|  1 | autoreply.domain1.tld            |        |
|  2 | autoreply.domain2.tld            |        |
|  3 | autoreply.domain3.tld            |        |
+----+----------------------------------+--------+
3 rows in set (0.00 sec)

When autoreply is activated emails will bounce with:

<"[email protected]"@autoreply.domain.tld> (expanded from
   <[email protected]>): Host or domain name not found. Name service error
   for name=autoreply.domain.tld type=AAAA: Host not found

I used:
modoboa-1.5.1
modoboa_admin-1.1.2
modoboa_postfix_autoreply-1.1.6
modoboa_sievefilters-1.0.5
modoboa_stats-1.0.6
modoboa_webmail-1.0.4

Add /api/v1/armessages/?mailbox=

From @tonioo:

About the ARmessage API, I can add a filter. Something like:
GET /api/v1/armessages/?mailbox=
What do you think about this ?

Yes, it will be easiest to access data as this.

But mailbox or accounts?

GET /api/v1/armessages/?accounts=

Not sure of the difference.

Possibility to have multiple autoreplies

From @tonioo on December 4, 2013 16:23

Originally created by Dalnix AB on 2013-06-12T10:20:03Z

There should be the ability to have multiple autoreplies.

Like

  1. Monday
  2. Week after

Also they should be repetetive so I can for instance set that EACH friday i want this or that message.

Copied from original issue: modoboa/modoboa#486

Error autoreply

Captura de pantalla de 2023-04-05 09-53-02

Apr 5 09:28:21 ce2022122314001 postfix/pipe[107615]: 1BDD12E663E1: to=<"xxxx@xxxxx"@autoreply.aladesk.com>, orig_to=[email protected], relay=autoreply, delay=1.9, delays=0.15/0.01/0/1.7, dsn=5.3.0, status=bounced (Command died with status 1: "/srv/modoboa/env/bin/python". Command output: Traceback (most recent call last): File "/srv/modoboa/instance/manage.py", line 22, in main() File "/srv/modoboa/instance/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py", line 208, in handle armessage = ARmessage.objects.get(mbox=mbox.id, enabled=True) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/query.py", line 439, in get raise self.model.MultipleObjectsReturned( modoboa_postfix_autoreply.models.MultipleObjectsReturned: get() returned more than one ARmessage -- it returned 2! )

Autoreply does not work with Postfix smtpd_sender_login_maps

According to the newest version of modoboa's documentation of Postfix maps [0], the configuration settings smtpd_sender_login_maps and smtpd_sender_restrictions should be used.
If I enable them, the autoreply script is not allowed to send the reply mails.

smtpd_sender_login_maps =
<driver>:/etc/postfix/sql-sender-login-mailboxes.cf
<driver>:/etc/postfix/sql-sender-login-aliases.cf
<driver>:/etc/postfix/sql-sender-login-domain-aliases.cf
<driver>:/etc/postfix/sql-sender-login-catchall-aliases.cf

smtpd_sender_restrictions =
reject_sender_login_mismatch

[0] https://github.com/tonioo/modoboa/blob/master/doc/integration/imap_and_smtp.rst

Any ideas on how those settings have be configured in order to work with autoreply?

Thanks in advance.

Autoreply doesnt work

Impacted versions

  • Modoboa: 1.14.0
  • Modoboa AutoReply: 15.1
  • installer used: Yes
  • Webserver: Nginx

Current behavior

Hi guys,

I installed the postfix-autoreply module with the documentation but it seems doesn't work right.

I get the following error if I sending an email to an email address where is autoreply enabled.

<"[email protected]"@autoreply.test.com> (expanded from
    <[email protected]>): Host or domain name not found. Name service
    error for name=autoreply.test.com type=A: Host not found

Why is Modoboa needing autoreply.test.com an A Record?

Okay, let's set an A Record. But then I got email looping errors like this.

<"[email protected]"@autoreply.test.com> (expanded from
    <[email protected]>): mail for autoreply.test.com loops
    back to myself

What do I wrong?

Thank you :)

autoreply /api/v1/armessages/[email protected] no longer works

Hi @tonioo!

I just discovered that the access to autoreply message seems to have a bug. It was working in the past. The RoundCube plugin I wrote no longer works.

If we ask for:

https://modoboa/api/v1/armessages/[email protected]

We got many answers instead of one answer.

As well with many answer, the RoundCube plugin is wrong. Same problem, when we try to write auto reply message to Modoboa with the RoundCube plugin.

Cheers,

Add Auto-Submitted, In-Reply-To, References, Precedence headers in autoreply messages

From @themr0c on April 10, 2014 7:44

According to https://tools.ietf.org/html/rfc3834#section-3.1 some fields are mandatory in autoreply messages:

The In-Reply-To and References fields SHOULD be provided in the header of a response message if there was a Message-ID field in the subject message.

The Auto-Submitted field, with a value of "auto-replied", SHOULD be included in the message header of any automatic response.

The Subject field SHOULD contain a brief indication that the message is an automatic response, followed by contents of the Subject field (or a portion thereof) from the subject message. The prefix "Auto:" MAY be used as such an indication. If used, this prefix SHOULD be followed by an ASCII SPACE character (0x20).

A response MAY include a Precedence field. The field-body of the Precedence field MAY consist of the text "junk", "list", "bulk", or other text deemed appropriate by the responder.

[NB: for Precedence: auto_reply is also an option]

Actual message is like :

Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: [...]
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: I'm off
From: Uuu Uuu <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
User-Agent: Modoboa
Date: Thu, 10 Apr 2014 09:06:09 +0200

I'm currently off. I'll answer as soon as I come back.

Best regards,

Copied from original issue: modoboa/modoboa#544

Performance issue

Regarding http://www.postfix.org/VIRTUAL_README.html#autoreplies it seems that you dont have to always call the autoreply script

The script is called iif the mail has a vmap to an autoreply domain.

But modoboa seems to always call that script even if there is no autoreply to send. And this seems to cause some performances issues on our server.

Do you think that this can be avoid ?
Maybe by adding a temporary "autoreply" alias when the user set an autoreply ?

Auto Reply Error & bounce email

From @mlzummo on March 13, 2017 20:11

Sent: March 13, 2017 4:06 PM
Subject: Undelivered Mail Returned to Sender
This is the mail system at host mx-1.example.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<"[email protected]"@autoreply.example.com> (expanded from
[email protected]): Command died with status 2:
"/srv/modoboa/env/bin/python". Command output: usage: manage.py autoreply
[-h] [--version] [-v {0,1,2,3}] [--settings
SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--debug] manage.py autoreply: error:
unrecognized arguments: [email protected] [email protected]

Copied from original issue: modoboa/modoboa#1074

Calendar in auto-reply don't work with admin

With last Modoboa version (but never tried before).

The javascript calendar system doesn't work. Only raw date are printed.

I tried with Firefox, Safari and Chrome on Macintosh.

capture d ecran 2018-10-22 a 17 54 37

Migrate Index Column size too large

Hi,

just updated to Postfix autoreply 1.1.1 and run the migrate.
But I get the following error.

python manage.py migrate modoboa_postfix_autoreply
Operations to perform:
  Apply all migrations: modoboa_postfix_autoreply
Running migrations:
  Applying modoboa_postfix_autoreply.0002_auto_20150728_1236...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/modoboa/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/opt/modoboa/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/modoboa/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/modoboa/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/opt/modoboa/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/migrations/executor.py", line 102, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/migrations/migration.py", line 108, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 139, in database_forwards
    schema_editor.alter_field(from_model, from_field, to_field)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/schema.py", line 470, in alter_field
    self._alter_field(model, old_field, new_field, old_type, new_type, old_db_params, new_db_params, strict)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/schema.py", line 647, in _alter_field
    self.execute(self._create_index_sql(model, [new_field], suffix="_uniq"))
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/opt/modoboa/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 129, in execute
    return self.cursor.execute(query, args)
  File "/opt/modoboa/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/opt/modoboa/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.utils.OperationalError: (1709, 'Index column size too large. The maximum column size is 767 bytes.')

I tried to find the migration file and check what it is trying to do but failed to do so.
Database is a InnoDB

Autoreply Schemas look like:

CREATE TABLE `postfix_autoreply_transport` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `domain` varchar(300) NOT NULL,
  `method` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

CREATE TABLE `postfix_autoreply_armessage` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) NOT NULL,
  `content` longtext NOT NULL,
  `enabled` tinyint(1) NOT NULL,
  `fromdate` datetime NOT NULL,
  `untildate` datetime DEFAULT NULL,
  `mbox_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `postfix_autoreply_armessage_5419c569` (`mbox_id`),
  CONSTRAINT `postfix_autoreply_a_mbox_id_739f665fbc7b21df_fk_admin_mailbox_id` FOREIGN KEY (`mbox_id`) REFERENCES `admin_mailbox` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

CREATE TABLE `postfix_autoreply_arhistoric` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `last_sent` datetime NOT NULL,
  `sender` varchar(254) NOT NULL,
  `armessage_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `postfix_autoreply_arhistoric_armessage_id_1d0bc60837459629_uniq` (`armessage_id`,`sender`),
  KEY `postfix_autoreply_arhistoric_edbe1cb9` (`armessage_id`),
  CONSTRAINT `armessage_id_2d1162f27ac3471b_fk_postfix_autoreply_armessage_id` FOREIGN KEY (`armessage_id`) REFERENCES `postfix_autoreply_armessage` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `postfix_autoreply_alias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `full_address` varchar(255) NOT NULL,
  `autoreply_address` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

Thanks for any help.

BR Martin

modoboa_admin_aliasrecipient always references the autoreply address

Since version 1.1.1, the table modoboa_admin_aliasrecipient always references the autoreply address as an alias. With postfix using mapfile sql-aliases.cf, it tries to use to autoreply transport everytime, even if the user didn't enable the plugin for his account.

The autoreply address should be present in this table only if it is enabled for the user.

Problem with modoboa-postfix-autoreply

In random cases, the mail server sends the message about the undelivered mail to the recipient with autoreply set.

Below the message content.

Name | Installed version | Last version | Description
Modoboa | 1.9.0 | 1.9.0 | The core part of Modoboa
Amavis frontend | 1.1.3 | 1.1.3 | Simple amavis management frontend
Contacts | 0.4.0 | 0.4.0 | Address book
PDF credentials | 1.2.1 | 1.2.1 | Generate PDF documents containing users' credentials
Postfix autoreply | 1.2.1 | 1.2.1 | Auto-reply (vacation) functionality using Postfix
Sieve filters | 1.1.1 | 1.1.1 | Plugin to easily create server-side filters
Statistics | 1.2.2 | 1.2.2 | Graphical statistics about emails traffic using RRDtool
Webmail | 1.2.1 | 1.2.1 | Simple IMAP webmail

Regards,
Christopher

This is the mail system at host mail.test.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

               The mail system
<"[email protected]"@autoreply.test.com> (expanded from
    <[email protected]>): Command died with status 1:
    "/srv/modoboa/env/bin/python". Command output: Traceback (most recent call
    last):   File "/srv/modoboa/instance/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
    line 367, in execute_from_command_line     utility.execute()   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
    line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py",
    line 294, in run_from_argv     self.execute(*args, **cmd_options)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py",
    line 345, in execute     output = self.handle(*args, **options)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
    line 169, in handle     send_autoreply(sender, mbox, armessage,
    original_msg)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
    line 78, in send_autoreply     msg.send()   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/message.py",
    line 342, in send     return
    self.get_connection(fail_silently).send_messages([self])   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py",
    line 107, in send_messages     sent = self._send(message)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py",
    line 121, in _send     message = email_message.message()   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/message.py",
    line 307, in message     msg['Subject'] = self.subject   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/message.py",
    line 232, in __setitem__     name, val = forbid_multi_line_headers(name,
    val, self.encoding)   File
    "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/mail/message.py",
    line 92, in forbid_multi_line_headers     raise BadHeaderError("Header
    values can't contain newlines (got %r for header %r)" % (val, name))
    django.core.mail.message.BadHeaderError: Header values can't contain
    newlines (got u'Auto: Urlop Re:
    =?UTF-8?Q?FIRMA_HANDLOWO-US=c5=81UGOWA_MIROS=c5=81AW_=c5=81OCHOWICZ?=\n
    =?UTF-8?Q?=2cAdres=2c64-820_Szamocin=2c_Marcinkowskiego_104A=2cNIP=2c766000?=\n
    =?UTF-8?Q?9749?=' for header u'Subject')

More control over the subject

Hello

Actually the subject is partially auto generated :
"Auto: " + subject + " Re: %dest"

This should be more configurable, with variables (original subject, dest email) to permit more flexibility over this.

For example default value should looks like Auto: MyCustom message Re: %dest

Thanks

Cannot empty the from date when disabling an autoresponse

Internal Server Error: /user/autoreply/
Traceback (most recent call last):
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/transaction.py", line 394, in inner
    return func(*args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/transaction.py", line 394, in inner
    return func(*args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/lib.py", line 30, in wrapped_f
    return f(request, *args, **kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_postfix_autoreply-1.0.2-py2.7.egg/modoboa_postfix_autoreply/views.py", line 35, in autoreply
    arm.save()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/base.py", line 589, in save
    force_update=force_update, update_fields=update_fields)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/base.py", line 617, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/base.py", line 679, in _save_table
    forced_update)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/base.py", line 723, in _do_update
    return filtered._update(values) > 0
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/query.py", line 600, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/sql/compiler.py", line 1005, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/models/sql/compiler.py", line 787, in execute_sql
    cursor.execute(sql, params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/Django-1.7.9-py2.7.egg/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
IntegrityError: null value in column "fromdate" violates not-null constraint

Date macro

Hello,

It would be nice to have the start and end dates of the automatic replies as a macro like the name macro.

modoboa.lib.parameters.NotDefined: Application 'postfix_autoreply' and/or parameter 'AUTOREPLIES_TIMEOUT' not defined

(vtenv)vagrant@modoboa:~/modoboa_instancepython manage.py autoreply [email protected] [email protected]
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vagrant/vtenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/vagrant/vtenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/vagrant/vtenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/vagrant/vtenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/vagrant/modoboa-postfix-autoreply/modoboa_postfix_autoreply/management/commands/autoreply.py", line 72, in handle
    send_autoreply(sender, mbox, armessage)
  File "/home/vagrant/modoboa-postfix-autoreply/modoboa_postfix_autoreply/management/commands/autoreply.py", line 31, in send_autoreply
    app="postfix_autoreply")
  File "/home/vagrant/modoboa/modoboa/lib/parameters.py", line 267, in get_admin
    __is_defined(app, "A", name)
  File "/home/vagrant/modoboa/modoboa/lib/parameters.py", line 215, in __is_defined
    raise NotDefined(app, name)
modoboa.lib.parameters.NotDefined: Application 'postfix_autoreply' and/or parameter 'AUTOREPLIES_TIMEOUT' not defined

Autoreply error

Good afternoon, I get an error, the auto-replace too, send me an undelivered with this

Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; Traceback (most recent call last): File
"/srv/modoboa/instance/manage.py", line 22, in
execute_from_command_line(sys.argv) File
"/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/init.py",
line 364, in execute_from_command_line utility.execute() File
"/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/init.py",
line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File
"/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py",
line 283, in run_from_argv self.execute(*args, **cmd_options) File
"/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py",
line 330, in execute output = self.handle(*args, **options) File
"/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
line 140, in handle handler =
SysLogHandler(address=options["syslog_socket_path"]) File
"/usr/lib/python2.7/logging/handlers.py", line 761, in init
self._connect_unixsocket(address) File
"/usr/lib/python2.7/logging/handlers.py", line 789, in _connect_unixsocket
self.socket.connect(address) File "/usr/lib/python2.7/socket.py", line
228, in meth return getattr(self._sock,name)(*args) socket.error:
[Errno 111] Connection refused

Modoboa 1.13.1 1.14.0 El núcleo de Modoboa
Frontend de Amavis 1.2.3 1.2.3 Panel de gestión sencilla para amavis
Contacts 0.7.3 0.7.3 Address book
DMARC tools 1.1.0 1.1.0 A set of tools to ease DMARC integration
IMAP migration using OfflineIMAP 1.3.3 1.3.3 Migrate existing mailboxes using IMAP and OfflineIMAP
PDF credentials 1.3.2 1.3.2 Generate PDF documents containing users' credentials
Postfix autoreply 1.5.1 1.5.1 Funcionalidad de autorespuesta (vacaciones) usando Postfix
Radicale management 1.3.6 1.3.6 Management frontend for Radicale, a simple calendar and contact server.
filtros Sieve 1.4.2 1.4.2 Extensión para crear filtros en el servidor de forma sencilla
Statistics 1.4.1 1.4.1 Estadísticas gráficas del tráfico de emails usando RRDtool
Webmail 1.5.0 1.5.0 Correo web sencillo para IMAP

Autoreply bounce - gmail and msn

since I updated to modoboa 1.15 with django 3.6 and postfix-autorply 1.6.0 I am geting this error sending emails to an account with autoreply on from gmail and msn. did some tests with other accounts and works ok.

This is the mail system at host xxx.xxx.xx.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

               The mail system

<"[email protected]"@autoreply.xxxx.xxxxx.xx> (expanded from
[email protected]): Command died with status 1:
"/srv/modoboa/env/bin/python3". Command output: Traceback (most recent call
last): File "/srv/modoboa/instance/manage.py", line 22, in
execute_from_command_line(sys.argv) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/management/init.py",
line 381, in execute_from_command_line utility.execute() File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/management/init.py",
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/management/base.py",
line 323, in run_from_argv self.execute(*args, **cmd_options) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/management/base.py",
line 364, in execute output = self.handle(*args, **options) File
"/srv/modoboa/env/lib/python3.6/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
line 214, in handle send_autoreply(sender, mbox, armessage,
original_msg) File
"/srv/modoboa/env/lib/python3.6/site-packages/modoboa_postfix_autoreply/management/commands/autoreply.py",
line 107, in send_autoreply msg.send() File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/message.py",
line 291, in send return
self.get_connection(fail_silently).send_messages([self]) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/backends/smtp.py",
line 110, in send_messages sent = self._send(message) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/backends/smtp.py",
line 124, in _send message = email_message.message() File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/message.py",
line 275, in message msg[name] = value File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/message.py",
line 169, in setitem name, val = forbid_multi_line_headers(name,
val, self.encoding) File
"/srv/modoboa/env/lib/python3.6/site-packages/django/core/mail/message.py",
line 60, in forbid_multi_line_headers raise BadHeaderError("Header
values can't contain newlines (got %r for header %r)" % (val, name))
django.core.mail.message.BadHeaderError: Header values can't contain
newlines (got '\n
VI1PR06MB4495C2A2E6D2F7D38320B005C5660@VI1PR06MB4495.eurprd06.prod.outlook.com'
for header 'In-Reply-To')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.