sending email using different server for different 'From:' field
Dear Both, thanks alot, i'll try to see those options (when i find a bit of time :) nice evening (in europe at least) .d. Mark Walters writes: > Hi > > On Wed, 03 Sep 2014, David Belohrad wrote: >> oukej. this seems to be exactly what I'm looking for. Is there a way how >> to 'cycle' in notmuch different From: fields? I'd need to setup like 3 >> addresses, each of them with different signatures and be able to easily >> switch between them > > You might finding setting notmuch-always-prompt-for-sender to 't is > what you want (you can set if in customise or directly) > > This prompts you for the sender address and takes options from your > notmuch config file (that is from user.primary_email and > user.other_email from .notmuch-config) so will quite possibly just work. > > >>> >>> (defun kea/message-select-mail-dest () >>> (cond ((string-match "" >>>(message-field-value "From")) >>> (kea/send-mail-with-x)) >>> (t >>> (kea/send-mail-with-y >>> >>> (kea/send-mail-with-y) >>> (add-hook 'message-send-hook 'kea/message-select-mail-dest) > > I will also mention an alternative approach to using hooks here. You > could customise message-send-mail-function to be your own function which > let binds the appropriate send-mail settings and have that call the > actual send-mail function (eg message-send-mail-with-sendmail) > > Best wishes > > Mark
Re: sending email using different server for different 'From:' field
Dear Both, thanks alot, i'll try to see those options (when i find a bit of time :) nice evening (in europe at least) .d. Mark Walters markwalters1...@gmail.com writes: Hi On Wed, 03 Sep 2014, David Belohrad da...@belohrad.ch wrote: oukej. this seems to be exactly what I'm looking for. Is there a way how to 'cycle' in notmuch different From: fields? I'd need to setup like 3 addresses, each of them with different signatures and be able to easily switch between them You might finding setting notmuch-always-prompt-for-sender to 't is what you want (you can set if in customise or directly) This prompts you for the sender address and takes options from your notmuch config file (that is from user.primary_email and user.other_email from .notmuch-config) so will quite possibly just work. (defun kea/message-select-mail-dest () (cond ((string-match k...@x.com (message-field-value From)) (kea/send-mail-with-x)) (t (kea/send-mail-with-y (kea/send-mail-with-y) (add-hook 'message-send-hook 'kea/message-select-mail-dest) I will also mention an alternative approach to using hooks here. You could customise message-send-mail-function to be your own function which let binds the appropriate send-mail settings and have that call the actual send-mail function (eg message-send-mail-with-sendmail) Best wishes Mark ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
sending email using different server for different 'From:' field
oukej. this seems to be exactly what I'm looking for. Is there a way how to 'cycle' in notmuch different From: fields? I'd need to setup like 3 addresses, each of them with different signatures and be able to easily switch between them thanks .d. Keith Amidon writes: > On Tue, 2014-09-02 at 14:26 +0200, David Belohrad wrote: >> could that scenario be somehow fitted automatically, so when I overwrite >> the default 'From:' address (by hand. is it possible to do some >> automatic cycling?) to work address, so that message sender in emacs >> would automatically use work exchange server to deliver the mail? > > I think this is more of a message-mode question than a notmuch question. > I use something very similar to code attached below, which is rather > brute-force, but does the job for me. > > --- Keith > > - > > (defun kea/send-mail-with-x () > (interactive) > (setq smtpmail-smtp-server "smtp.x.com" > smtpmail-smtp-service 587 > smtpmail-local-domain "x.com" > smtpmail-auth-user nil > smtpmail-stream-type 'starttls)) > > (defun kea/send-mail-with-y () > (interactive) > (setq smtpmail-smtp-server "email.y.com" > smtpmail-smtp-service 587 > smtpmail-local-domain "y.com" > smtpmail-auth-user nil > smtpmail-stream-type 'starttls)) > > (defun kea/message-select-mail-dest () > (cond ((string-match "" >(message-field-value "From")) > (kea/send-mail-with-x)) > (t > (kea/send-mail-with-y > > (kea/send-mail-with-y) > (add-hook 'message-send-hook 'kea/message-select-mail-dest)
Re: sending email using different server for different 'From:' field
oukej. this seems to be exactly what I'm looking for. Is there a way how to 'cycle' in notmuch different From: fields? I'd need to setup like 3 addresses, each of them with different signatures and be able to easily switch between them thanks .d. Keith Amidon cama...@picnicpark.org writes: On Tue, 2014-09-02 at 14:26 +0200, David Belohrad wrote: could that scenario be somehow fitted automatically, so when I overwrite the default 'From:' address (by hand. is it possible to do some automatic cycling?) to work address, so that message sender in emacs would automatically use work exchange server to deliver the mail? I think this is more of a message-mode question than a notmuch question. I use something very similar to code attached below, which is rather brute-force, but does the job for me. --- Keith - (defun kea/send-mail-with-x () (interactive) (setq smtpmail-smtp-server smtp.x.com smtpmail-smtp-service 587 smtpmail-local-domain x.com smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/send-mail-with-y () (interactive) (setq smtpmail-smtp-server email.y.com smtpmail-smtp-service 587 smtpmail-local-domain y.com smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/message-select-mail-dest () (cond ((string-match k...@x.com (message-field-value From)) (kea/send-mail-with-x)) (t (kea/send-mail-with-y (kea/send-mail-with-y) (add-hook 'message-send-hook 'kea/message-select-mail-dest) ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: sending email using different server for different 'From:' field
Hi On Wed, 03 Sep 2014, David Belohrad da...@belohrad.ch wrote: oukej. this seems to be exactly what I'm looking for. Is there a way how to 'cycle' in notmuch different From: fields? I'd need to setup like 3 addresses, each of them with different signatures and be able to easily switch between them You might finding setting notmuch-always-prompt-for-sender to 't is what you want (you can set if in customise or directly) This prompts you for the sender address and takes options from your notmuch config file (that is from user.primary_email and user.other_email from .notmuch-config) so will quite possibly just work. (defun kea/message-select-mail-dest () (cond ((string-match k...@x.com (message-field-value From)) (kea/send-mail-with-x)) (t (kea/send-mail-with-y (kea/send-mail-with-y) (add-hook 'message-send-hook 'kea/message-select-mail-dest) I will also mention an alternative approach to using hooks here. You could customise message-send-mail-function to be your own function which let binds the appropriate send-mail settings and have that call the actual send-mail function (eg message-send-mail-with-sendmail) Best wishes Mark ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
sending email using different server for different 'From:' field
Dear All, I have my emacs/notmuch installation setup such, that I send the emails usually directly using local exim4 installation. For particular 'From:' field however I need to use my work server. Nowadays I do that manually. Hence if I write an email using my work address, I manually call a function switching the exim4 to work server. when the mail is sent, i manually set it back to exim. could that scenario be somehow fitted automatically, so when I overwrite the default 'From:' address (by hand. is it possible to do some automatic cycling?) to work address, so that message sender in emacs would automatically use work exchange server to deliver the mail? many thanks david
sending email using different server for different 'From:' field
On Tue, 2014-09-02 at 14:26 +0200, David Belohrad wrote: > could that scenario be somehow fitted automatically, so when I overwrite > the default 'From:' address (by hand. is it possible to do some > automatic cycling?) to work address, so that message sender in emacs > would automatically use work exchange server to deliver the mail? I think this is more of a message-mode question than a notmuch question. I use something very similar to code attached below, which is rather brute-force, but does the job for me. --- Keith - (defun kea/send-mail-with-x () (interactive) (setq smtpmail-smtp-server "smtp.x.com" smtpmail-smtp-service 587 smtpmail-local-domain "x.com" smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/send-mail-with-y () (interactive) (setq smtpmail-smtp-server "email.y.com" smtpmail-smtp-service 587 smtpmail-local-domain "y.com" smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/message-select-mail-dest () (cond ((string-match "" (message-field-value "From")) (kea/send-mail-with-x)) (t (kea/send-mail-with-y (kea/send-mail-with-y) (add-hook 'message-send-hook 'kea/message-select-mail-dest)
sending email using different server for different 'From:' field
Dear All, I have my emacs/notmuch installation setup such, that I send the emails usually directly using local exim4 installation. For particular 'From:' field however I need to use my work server. Nowadays I do that manually. Hence if I write an email using my work address, I manually call a function switching the exim4 to work server. when the mail is sent, i manually set it back to exim. could that scenario be somehow fitted automatically, so when I overwrite the default 'From:' address (by hand. is it possible to do some automatic cycling?) to work address, so that message sender in emacs would automatically use work exchange server to deliver the mail? many thanks david ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: sending email using different server for different 'From:' field
On Tue, 2014-09-02 at 14:26 +0200, David Belohrad wrote: could that scenario be somehow fitted automatically, so when I overwrite the default 'From:' address (by hand. is it possible to do some automatic cycling?) to work address, so that message sender in emacs would automatically use work exchange server to deliver the mail? I think this is more of a message-mode question than a notmuch question. I use something very similar to code attached below, which is rather brute-force, but does the job for me. --- Keith - (defun kea/send-mail-with-x () (interactive) (setq smtpmail-smtp-server smtp.x.com smtpmail-smtp-service 587 smtpmail-local-domain x.com smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/send-mail-with-y () (interactive) (setq smtpmail-smtp-server email.y.com smtpmail-smtp-service 587 smtpmail-local-domain y.com smtpmail-auth-user nil smtpmail-stream-type 'starttls)) (defun kea/message-select-mail-dest () (cond ((string-match k...@x.com (message-field-value From)) (kea/send-mail-with-x)) (t (kea/send-mail-with-y (kea/send-mail-with-y) (add-hook 'message-send-hook 'kea/message-select-mail-dest) ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch