The C++ submission binding is the third of five in the chapter. Its 19 methods are the same set of capabilities as the C binding, only without the allocation, freeing and error query functions.
Three classes in three headers: submitter/Connection.hxx, submitter/Message.hxx and submitter/Recipient.hxx; on Linux they are in /opt/pmta/api/include.
An error is an exception, after which the object is unusable and is discarded. Connecting supports logging in with a login and password via the CRAM-MD5 mechanism, so the password is not sent over the network.
Main methods:
| Method | What it sets |
|---|---|
| Connection::Connection | server, port, optionally a login and password |
| Message::setVirtualMta | the sending address for the message |
| Message::setJobId | the job |
| Message::setEncoding | the encoding of added data |
| Message::setReturnType | what to include in a non-delivery report |
| Connection::submit | submit the message |
# a message through the C++ binding: connection, sender, sending address Connection conn("127.0.0.1", 25); Message msg("sender@example.com"); msg.setVirtualMta("vmta1");conn.submit(msg);
2 relations
ls /opt/pmta/api/include/submitter/
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.