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

zle rozparsovane meno prilohy #151

Open
mmmaly opened this issue Jan 8, 2016 · 1 comment
Open

zle rozparsovane meno prilohy #151

mmmaly opened this issue Jan 8, 2016 · 1 comment

Comments

@mmmaly
Copy link
Collaborator

mmmaly commented Jan 8, 2016

uzivatelovi prisla odpoved na ziadost, priloha v maili ma nazov typu Človek - odpoveď.pdf
Miesto toho sa rozparsovalo meno "attachment", bez pripony.

Ked si uzivatel subor attachment stiahne a premenuje napr. na attachment.pdf, tak obsah je ok, dobre pdf.

Anonymizovana hlavicka pre subor vyzera takto:

Content-Type: application/pdf;\n name*=UTF-8''Priezvisko%20-%20odpove%C4%8F.pdf\nContent-Disposition: attachment;\n filename*=UTF-8''Priezvisko%20-%20odpove%C4%8F.pdf;\n size=200300\n

screen shot 2016-01-08 at 15 05 59

viac info, ak treba, mailom.

@martinmacko47
Copy link
Owner

Kopiu eventu z mandrillu ulozenu nemame nikde, ale vyzera, ze mandrill nam poslal taky nazov attachmentu. Nazov attachmentu sa do DB zapisuje tu: https://github.com/martinmacko47/chcemvediet/blob/master/poleno/mail/transports/mandrill/signals.py#L72 Nic sa s tym nazvom nerobi, takze string attachment nemal ako vzniknut. Ak by aj nazov chybal, alebo by bol chybne encodovany, tak by sa bud zapisal prazdny string, nejaky balast, alebo by to cele spadlo.

Mandrill API je popisane tu https://mandrill.zendesk.com/hc/en-us/articles/205583207-What-is-the-format-of-inbound-email-webhooks- Ak sa Ti chce, pozri kod a to API, ci som nieco zle nepochopil.

Ked som rucne (standardnou python kniznicou) rozparsoval raw doruceneho mailu (z mandrill logov), tak nazov prilohy sa rozparsoval spravne. Chyba je asi na strane mandrillu. Nebolo by odveci to reportovat. Najlepsie co najskor, kym maju mail v logoch.

Alternativne by sme mohli uplne ignorovat, co nam posle mandrill a zobrat iba raw email a rozparsovat si ho sami. Naivne som predpokladal, ze mandrill bude mat vymakanejsi parser, nez sme schopni spravit my.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants