[PATCH v3 09/10] parsemail: Convert to a management command

Daniel Axtens dja at axtens.net
Thu Sep 1 09:39:33 AEST 2016


Hi Stephen,

>  PYTHONPATH="$PATCHWORK_BASE":"$PATCHWORK_BASE/lib/python:$PYTHONPATH" \
>          DJANGO_SETTINGS_MODULE=patchwork.settings.production \
> -        "$PATCHWORK_BASE/patchwork/bin/parsemail.py"
> +        "$PATCHWORK_BASE/patchwork/manage.py parsemail" $@
>
Looks good :)

> +# NOTE(stephenfin): We must return 0 here. For more information, refer
> +# to https://patchwork.ozlabs.org/patch/602248/
>  exit 0

Could we just put the reason inline? Perhaps:

"When parsemail is used as a delivery command from a mail server like
postfix (as it is intended to be), a non-zero exit code will cause a
bounce message to be returned to the user. We don't want to do that for
a parse error, so always return 0."

> +from email import message_from_file
> +import logging
> +from optparse import make_option
As I mentioned for v2, this should be moved to argparse for Django 1.10
compatibility. 

Regards,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 859 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20160901/1fa6754a/attachment.sig>


More information about the Patchwork mailing list