Two error models in one interface. In C++ any error throws an exception, and the object is unusable afterwards — it is discarded and created anew. In C functions return a success flag, and the reason is given by …GetLastError and …GetLastErrorType — the connection, the message and the recipient each have their own.
The consequence is the same for both: there is no partial recovery inside an object, and the unit of success is the submission batch. That is why the manual advises keeping a batch to no more than 5,000 recipients: a failure affects fewer addresses.
How to tell there was an error:
| Binding | Signal | What to do with the object |
|---|---|---|
| C++ | an exception | discard it |
| C | a FALSE return, then …GetLastError | free it with …Free |
# C: text and type of the connection's last error if (!PmtaConnSubmit(conn, msg)) printf("%s %d", PmtaConnGetLastError(conn), PmtaConnGetLastErrorType(conn));
1 relation
What the submission bindings needA related mechanism: they work together. § 7.1
grep -rn 'PmtaApiERROR' /opt/pmta/api/include/ | head
3 articles
◇How a message gets into the engineSix described submission methods: extended SMTP, four language bindings and a directory the node watches on disk.◇Who is allowed to submit mail and for whom to accept itOut of the box, the node accepts submission only from the machine itself; two different questions — “who can send through us” and “for whose addresses we accept mail” — are answered by different directives.◇Headers the sender uses to control deliverySix control headers let the submitting side choose a stream, tag a message with a job, set signing options and the key, the envelope identifier and the schedule; each is allowed separately and per source.