Beispiel #1
0
// SetEnvFrom sets the sender host
func (r *Request) SetEnvFrom(fromHost string) error {
	var stat C.int
	stat = C.SPF_request_set_env_from(r.r, C.CString(fromHost))
	if stat != C.int(C.SPF_E_SUCCESS) {
		return &spfError{C.SPF_errcode_t(stat)}
	}
	return nil
}
Beispiel #2
0
// SetEnvFrom sets the envelope from email address from the SMTP MAIL FROM: command
func (r *request) setEnvFrom(from string) error {
	var stat C.int
	cstring := C.CString(from)
	defer C.free(unsafe.Pointer(cstring))
	stat = C.SPF_request_set_env_from(r.r, cstring)
	if stat != C.int(C.SPF_E_SUCCESS) {
		return &spfError{C.SPF_errcode_t(stat)}
	}
	return nil
}