1

Topic: use of triple double quotes in other than docstrings

Hello Zhang

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.7 MYSQL edition
- Linux/BSD distribution name and version: CentOS release 6.9 (Final)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No, still evaluating in a DEV VM
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

https://www.python.org/dev/peps/pep-0257/ specifies using the """ in the docstring.
However, I see many places where the 3 double quotes are used that are not docstring specific.
run the below to seereferences when the """ is used when assigning a value to a variable.
       find /opt/iredapd/ -type f -exec grep -HI '"""' {} \;|grep "="

I'm new to Python, and from what I can tell this is not proper. I'm also not quickly able to ascertain how such quoting is handled by Python for example:

    sql = """SELECT accesspolicy
               FROM alias
              WHERE address='%s'
              LIMIT 1""" % (mail)

Perhaps you can provide some insight as to why VAR assignments have the 3 double quotes.

Sidenote;
I'm trying to understand a variety of things with iredapd, and was led to notice this while reviewing why the records in vmail.forwardings do not seems to every match up with any possible return from the catchall_maps.cf, that is specified in main.cf for virtual_alias_maps variable.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: use of triple double quotes in other than docstrings

I think I have found the reason.
https://stackoverflow.com/questions/194 … hon-cursor