Adds the smtp port field
966688
private function AddSmtpPortField()
    {
        $name = 'SmtpPort';
        $field = Input::Text($name, $this->settings->GetSmtpPort());
        $this->AddField($field);
        $this->AddValidator($name, new Integer(1, 65535));
    }
186440
function EmailNode(n) {
        RED.nodes.createNode(this, n);
        this.topic = n.topic;
        this.name = n.name;
        this.outserver = n.server;
        this.outport = n.port;
        this.secure = n.secure;
        let flag = false;
        if (this.credentials && this.credentials.hasOwnProperty('userid')) {
            this.userid = this.credentials.userid;
        } else {
            if (globalkeys) {
                this.userid = globalkeys.user;
                flag = true;
            }
        }
        if (this.credentials && this.credentials.hasOwnProperty('password')) {
            this.password = this.credentials.password;
        } else {
            if (globalkeys) {
                this.password = globalkeys.pass;
                flag = true;
            }
        }
        if (flag) {
            RED.nodes.addCredentials(n.id, {userid: this.userid, password: this.password, global: true});
        }
        let node = this;

        let smtpOptions = {
            host: node.outserver,
            port: node.outport,
            secure: node.secure,
        };

        if (this.userid && this.password) {
            smtpOptions.auth = {
                user: node.userid,
                pass: node.password,
            };
        }
        let smtpTransport = nodemailer.createTransport(smtpOptions);

        this.on('input', function(msg) {
            let params = processValuesFromContext(node, msg, [
                {name: 'port', type: 'portType'},
                {name: 'server', type: 'serverType'},
                {name: 'userid', type: 'useridType'},
                {name: 'password', type: 'passwordType'},
            ]);
            console.log('params are ....');
            console.log(JSON.stringify(params));

            if (params.userid && params.password) {
                smtpOptions.auth = {
                    user: params.userid,
                    pass: params.password,
                };
            }

            if (params.port && params.server) {
                smtpOptions.host = params.server;
                smtpOptions.port = params.port;
            }


            if (msg.hasOwnProperty('payload')) {
                if (smtpTransport) {
                    node.status({fill: 'blue', shape: 'dot', text: 'email.status.sending'});
                    if (msg.to && node.name && (msg.to !== node.name)) {
                        node.warn(RED._('node-red:common.errors.nooverride'));
                    }
                    let sendopts = {from: ((msg.from) ? msg.from : node.userid)}; // sender address
                    sendopts.to = node.name || msg.to; // comma separated list of addressees
                    if (node.name === '') {
                        sendopts.cc = msg.cc;
                        sendopts.bcc = msg.bcc;
                    }
                    sendopts.subject = msg.topic || msg.title || 'Message from Node-RED'; // subject line
                    if (msg.hasOwnProperty('envelope')) {
                        sendopts.envelope = msg.envelope;
                    }
                    if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
                        if (!msg.filename) {
                            let fe = 'bin';
                            if ((msg.payload[0] === 0xFF) && (msg.payload[1] === 0xD8)) {
                                fe = 'jpg';
                            }
                            if ((msg.payload[0] === 0x47) && (msg.payload[1] === 0x49)) {
                                fe = 'gif';
                            } // 46
                            if ((msg.payload[0] === 0x42) && (msg.payload[1] === 0x4D)) {
                                fe = 'bmp';
                            }
                            if ((msg.payload[0] === 0x89) && (msg.payload[1] === 0x50)) {
                                fe = 'png';
                            } // 4E
                            msg.filename = 'attachment.' + fe;
                        }
                        let fname = msg.filename.replace(/^.*[\\\/]/, '') || 'file.bin';
                        sendopts.attachments = [{content: msg.payload, filename: fname}];
                        if (msg.hasOwnProperty('headers') && msg.headers.hasOwnProperty('content-type')) {
                            sendopts.attachments[0].contentType = msg.headers['content-type'];
                        }
                        // Create some body text..
                        sendopts.text = RED._('email.default-message', {filename: fname, description: (msg.description || '')});
                    } else {
                        let payload = RED.util.ensureString(msg.payload);
                        sendopts.text = payload; // plaintext body
                        if (/<[a-z][\s\S]*>/i.test(payload)) {
                            sendopts.html = payload;
                        } // html body
                        if (msg.attachments) {
                            sendopts.attachments = msg.attachments;
                        } // add attachments
                    }
                    smtpTransport.sendMail(sendopts, function(error, info) {
                        if (error) {
                            node.error(error, msg);
                            node.status({fill: 'red', shape: 'ring', text: 'email.status.sendfail'});
                        } else {
                            node.log(RED._('email.status.messagesent', {response: info.response}));
                            node.status({});
                        }
                    });
                } else {
                    node.warn(RED._('email.errors.nosmtptransport'));
                }
            } else {
                node.warn(RED._('email.errors.nopayload'));
            }
        });
    }
261069
def add_port_fwd(zone, src, dest, proto='tcp', dstaddr='', permanent=True):
    '''
    
    '''
    cmd = '--zone={0} --add-forward-port=port={1}:proto={2}:toport={3}:toaddr={4}'.format(
        zone,
        src,
        proto,
        dest,
        dstaddr
    )

    if permanent:
        cmd += ' --permanent'

    return __firewall_cmd(cmd)
1283539
public static smtp_server update(nitro_service client, smtp_server resource) throws Exception
	{
		resource.validate("modify");
		return ((smtp_server[]) resource.update_resource(client))[0];
	}
1075742
function addFromAddress(inboundMessage, outboundMessage) {
  if (inboundMessage && _.has(inboundMessage, 'from')) {
    outboundMessage.recipients = outboundMessage.recipients || [];

    outboundMessage.recipients.push(inboundMessage.from);
  }

  return outboundMessage;
}
488050
public void addMasterListeners()
    {
        super.addMasterListeners();
                
        ((PasswordPropertiesField)this.getField(MessageTransport.PROPERTIES)).addPasswordProperty(org.jbundle.base.message.trx.transport.email.MessageReceivingPopClientProcess.POP3_PASSWORD);
        ((PasswordPropertiesField)this.getField(MessageTransport.PROPERTIES)).addPasswordProperty(org.jbundle.base.message.trx.transport.email.EmailMessageTransport.SMTP_PASSWORD);
    }
707673
def add(self, ipaddr=None, proto=None, port=None, fields=None):
        
        return self.send.service_add(ipaddr, proto, port, fields)
1159135
def smtp_msgdata(self):
        """"""
        msg_data = self.arguments()
        self._command_parser.switch_to_command_mode()
        self._check_size_restrictions(msg_data)
        decision, response_sent = self.is_allowed('accept_msgdata', msg_data, self._message)
        if decision:
            self._message.msg_data = msg_data
            new_message = self._copy_basic_settings(self._message)
            self._deliverer.new_message_accepted(self._message)
            if not response_sent:
                self.reply(250, 'OK')
                # Now we must not loose the message anymore!
            self._message = new_message
        elif not decision:
            raise PolicyDenial(response_sent, 550, 'Message content is not acceptable')
1104475
private function Open_Smtp_Socket($_address = '')
    {
        if ( $this->Smtp_Host == '' )
        {
            $_domain = preg_replace("/^.+@([^@]+)$/", "$1", $_address);
            if ( ! @getmxrr($_domain, $MXHOSTS))  return FALSE;
            foreach ($MXHOSTS as $s_Host)
            {
                $this->Smtp_Socket = @fsockopen($s_Host, $this->Smtp_Port,
                    $err_no, $err_str, $this->Time_Out);
                if ( $this->Smtp_Socket && $this->Smtp_Ok() ) break;
            }
        }
        else
        {
            $this->Smtp_Socket = @fsockopen($this->Smtp_Host, $this->Smtp_Port,
                $err_no, $err_str, $this->Time_Out);
        }
        //debug #err_no and #err_str
    }
1323106
protected void setEmailBox() {

        m_sendEmail.setEnabled(
            !CmsStringUtil.isEmptyOrWhitespaceOnly(m_pw.getPassword1())
                | !CmsStringUtil.isEmptyOrWhitespaceOnly(m_pw.getPassword2()));
    }
13567
function Connector(settings) {
    this.mailgun = Mailgun({apiKey: settings.apikey, domain: settings.domain});
}
604451
def add_port(zone, port, permanent=True):
    '''
    
    '''
    cmd = '--zone={0} --add-port={1}'.format(zone, port)

    if permanent:
        cmd += ' --permanent'

    return __firewall_cmd(cmd)
603389
public static function transport(): Swift_Transport
    {
        switch (Site::getPreference('SMTP_ACTIVE')) {
            case 'sendmail':
                // Local sendmail (requires PHP proc_* functions)
                return new Swift_SendmailTransport();

            case 'external':
                // SMTP
                $smtp_host = Site::getPreference('SMTP_HOST');
                $smtp_port = (int) Site::getPreference('SMTP_PORT', '25');
                $smtp_auth = Site::getPreference('SMTP_AUTH');
                $smtp_user = Site::getPreference('SMTP_AUTH_USER');
                $smtp_pass = Site::getPreference('SMTP_AUTH_PASS');
                $smtp_encr = Site::getPreference('SMTP_SSL');

                $transport = new Swift_SmtpTransport($smtp_host, $smtp_port, $smtp_encr);

                $transport->setLocalDomain(Site::getPreference('SMTP_HELO'));

                if ($smtp_auth) {
                    $transport
                        ->setUsername($smtp_user)
                        ->setPassword($smtp_pass);
                }

                return $transport;

            default:
                // For testing
                return new Swift_NullTransport();
        }
    }
612015
function Mailer(opts) {
	opts = opts || {};
	var smtp = opts.smtp;
	if(!smtp) { throw new TypeError("bad arguments"); }
	this._transport = nodemailer.createTransport("SMTP", smtp);
	this._transport_sendMail = Q.nbind(this._transport.sendMail, this._transport);
	this._transport_close = Q.nbind(this._transport.close, this._transport);
}
104495
function config_mail_box(config) {

    imap = new Imap({
        user:config.user,
        password:config.password,
        host:config.host,
        port:config.port,
        secure:config.secure
    });
}
763525
def send(self, *args, **kwargs):
        """"""
        conn = SMTP(*args, **kwargs)
        send_result = conn.send(self)
        return conn, send_result
143533
def smtp_greet(self):
        """"""
        # Policy check was done when accepting the connection so we don't have
        # to do it here again.
        primary_hostname = self._command_parser.primary_hostname
        reply_text = '%s Hello %s' % (primary_hostname, self._message.peer.remote_ip)
        self.reply(220, reply_text)