├── test ├── data │ ├── geary-0.6-db.tar.xz │ ├── test-attachment-image.png │ ├── meson.build │ ├── org.gnome.GearyTest.gresource.xml │ ├── basic-text-plain.eml │ ├── basic-text-html.eml │ └── basic-multipart-alternative.eml ├── mock │ ├── mock-search-query.vala │ ├── mock-email-properties.vala │ ├── mock-folder-properties.vala │ ├── mock-client-service.vala │ └── mock-email-identifier.vala ├── engine │ ├── common │ │ └── common-contact-harvester-mock.vala │ ├── outbox │ │ └── outbox-email-identifier-test.vala │ ├── imap-db │ │ └── imap-db-email-identifier-test.vala │ ├── imap │ │ ├── parameter │ │ │ └── imap-list-parameter-test.vala │ │ └── command │ │ │ └── imap-create-command-test.vala │ ├── api │ │ └── geary-service-information-test.vala │ └── util-ascii-test.vala ├── test-case.vala └── client │ ├── application │ ├── application-configuration-test.vala │ └── application-client-test.vala │ └── components │ └── components-web-view-test.vala ├── desktop ├── org.gnome.Geary.service.in ├── geary-attach.contract.desktop.in ├── geary-autostart.desktop.in.in ├── geary-attach └── org.gnome.Geary.desktop.in.in ├── po ├── meson.build ├── LINGUAS └── POTFILES.skip ├── src ├── client │ ├── plugin │ │ ├── special-folders │ │ │ ├── special-folders.plugin.desktop.in │ │ │ └── meson.build │ │ ├── folder-highlight │ │ │ ├── folder-highlight.plugin.desktop.in │ │ │ └── meson.build │ │ ├── notification-badge │ │ │ ├── notification-badge.plugin.desktop.in │ │ │ └── meson.build │ │ ├── desktop-notifications │ │ │ ├── desktop-notifications.plugin.desktop.in │ │ │ └── meson.build │ │ ├── sent-sound │ │ │ ├── sent-sound.plugin.desktop.in │ │ │ └── meson.build │ │ ├── email-templates │ │ │ ├── email-templates.plugin.desktop.in │ │ │ └── meson.build │ │ ├── messaging-menu │ │ │ ├── messaging-menu.plugin.desktop.in │ │ │ └── meson.build │ │ ├── mail-merge │ │ │ ├── mail-merge.plugin.desktop.in │ │ │ ├── mail-merge-test.vala │ │ │ └── meson.build │ │ ├── plugin-account.vala │ │ ├── plugin-error.vala │ │ ├── meson.build │ │ ├── plugin-trusted-extension.vala │ │ ├── plugin-contact-store.vala │ │ ├── plugin-folder.vala │ │ └── plugin-email-store.vala │ ├── application │ │ └── main.vala │ ├── folder-list │ │ ├── folder-list-special-grouping.vala │ │ ├── folder-list-abstract-folder-entry.vala │ │ └── folder-list-inbox-folder-entry.vala │ ├── accounts │ │ └── accounts-signature-web-view.vala │ ├── composer │ │ ├── composer-application-interface.vala │ │ └── composer-container.vala │ ├── components │ │ ├── monitored-progress-bar.vala │ │ ├── monitored-spinner.vala │ │ ├── components-headerbar-application.vala │ │ ├── folder-popover-row.vala │ │ ├── stock.vala │ │ └── components-headerbar-conversation-list.vala │ └── util │ │ ├── util-contact.vala │ │ ├── util-files.vala │ │ └── util-gio.vala ├── mailer │ └── meson.build ├── engine │ ├── mime │ │ ├── mime-error.vala │ │ └── mime-data-format.vala │ ├── rfc822 │ │ └── rfc822-error.vala │ ├── app │ │ ├── conversation-monitor │ │ │ ├── app-terminate-operation.vala │ │ │ ├── app-append-operation.vala │ │ │ ├── app-external-append-operation.vala │ │ │ ├── app-local-search-operation.vala │ │ │ └── app-remove-operation.vala │ │ └── email-store │ │ │ ├── app-async-folder-operation.vala │ │ │ ├── app-copy-operation.vala │ │ │ ├── app-mark-operation.vala │ │ │ ├── app-list-operation.vala │ │ │ └── app-fetch-operation.vala │ ├── imap │ │ ├── imap.vala │ │ ├── command │ │ │ ├── imap-close-command.vala │ │ │ ├── imap-logout-command.vala │ │ │ ├── imap-starttls-command.vala │ │ │ ├── imap-noop-command.vala │ │ │ ├── imap-capability-command.vala │ │ │ ├── imap-namespace-command.vala │ │ │ ├── imap-login-command.vala │ │ │ ├── imap-select-command.vala │ │ │ ├── imap-examine-command.vala │ │ │ ├── imap-copy-command.vala │ │ │ ├── imap-delete-command.vala │ │ │ ├── imap-expunge-command.vala │ │ │ ├── imap-id-command.vala │ │ │ ├── imap-status-command.vala │ │ │ ├── imap-append-command.vala │ │ │ ├── imap-search-command.vala │ │ │ └── imap-list-return-parameter.vala │ │ ├── message │ │ │ ├── imap-namespace.vala │ │ │ └── imap-flag.vala │ │ ├── parameter │ │ │ ├── imap-atom-parameter.vala │ │ │ ├── imap-quoted-string-parameter.vala │ │ │ └── imap-unquoted-string-parameter.vala │ │ ├── api │ │ │ ├── imap-folder.vala │ │ │ └── imap-email-properties.vala │ │ └── response │ │ │ └── imap-server-response.vala │ ├── api │ │ ├── geary.vala │ │ ├── geary-logging.vala │ │ ├── geary-special-folder-type.vala │ │ ├── geary-credentials-mediator.vala │ │ ├── geary-folder-supports-mark.vala │ │ ├── geary-named-flag.vala │ │ ├── geary-folder-supports-empty.vala │ │ ├── geary-folder-supports-copy.vala │ │ ├── geary-folder-supports-move.vala │ │ ├── geary-folder-supports-archive.vala │ │ ├── geary-email-properties.vala │ │ ├── geary-folder-supports-remove.vala │ │ ├── geary-contact-store.vala │ │ ├── geary-engine-error.vala │ │ └── geary-folder-supports-create.vala │ ├── db │ │ ├── db-database-error.vala │ │ ├── db-synchronous-mode.vala │ │ ├── db-transaction-outcome.vala │ │ └── db-transaction-type.vala │ ├── nonblocking │ │ ├── nonblocking-error.vala │ │ └── nonblocking-reporting-semaphore.vala │ ├── imap-engine │ │ ├── other │ │ │ ├── imap-engine-other-folder.vala │ │ │ └── imap-engine-other-account.vala │ │ ├── outlook │ │ │ └── imap-engine-outlook-folder.vala │ │ ├── gmail │ │ │ ├── imap-engine-gmail-all-mail-folder.vala │ │ │ ├── imap-engine-gmail-spam-trash-folder.vala │ │ │ └── imap-engine-gmail-drafts-folder.vala │ │ ├── imap-engine-send-replay-operation.vala │ │ └── replay-ops │ │ │ └── imap-engine-user-close.vala │ ├── outbox │ │ ├── outbox-email-properties.vala │ │ └── outbox-folder-properties.vala │ ├── smtp │ │ ├── smtp-data-format.vala │ │ ├── smtp-error.vala │ │ ├── smtp-response.vala │ │ ├── smtp-login-authenticator.vala │ │ ├── smtp-plain-authenticator.vala │ │ └── smtp-capabilities.vala │ ├── memory │ │ ├── memory-unowned-string-buffer.vala │ │ ├── memory-unowned-byte-array-buffer.vala │ │ ├── memory-unowned-bytes-buffer.vala │ │ ├── memory-file-buffer.vala │ │ └── memory-string-buffer.vala │ └── state │ │ ├── state-mapping.vala │ │ └── state-machine-descriptor.vala └── console │ └── meson.build ├── ui ├── meson.build ├── signature-web-view.js ├── components-attachment-pane-menus.ui ├── conversation-list-view.ui ├── single-key-shortcuts.css ├── components-menu-application.ui ├── components-menu-conversation.ui ├── composer-web-view.css └── components-headerbar-application.ui ├── sql ├── version-029.sql ├── version-009.sql ├── version-014.sql ├── version-028.sql ├── version-010.sql ├── version-026.sql ├── version-008.sql ├── version-018.sql ├── version-019.sql ├── version-027.sql ├── version-012.sql ├── version-003.sql ├── version-017.sql ├── version-020.sql ├── version-011.sql ├── version-005.sql ├── version-015.sql ├── version-006.sql ├── version-002.sql ├── version-030.sql ├── version-013.sql ├── version-016.sql ├── version-007.sql ├── version-022.sql ├── version-023.sql ├── version-021.sql ├── version-025.sql ├── meson.build └── version-024.sql ├── subprojects ├── libhandy.wrap └── vala-unit │ ├── README.md │ ├── meson_options.txt │ └── test │ └── test-driver.vala ├── help ├── LINGUAS ├── meson.build └── C │ ├── limits.page │ ├── index.page │ ├── contributing.page │ ├── star.page │ ├── label.page │ └── shortcuts.page ├── AUTHORS ├── CONTRIBUTING.md ├── .editorconfig ├── .gitlab └── issue_templates │ ├── New feature.md │ └── New bug.md ├── bindings └── vapi │ ├── config.vapi │ ├── enchant-2.vapi │ ├── enchant.vapi │ └── libytnef.vapi ├── icons ├── edit-symbolic.svg ├── meson.build ├── tag-symbolic-rtl.svg └── tag-symbolic.svg ├── geary.doap └── meson.options /test/data/geary-0.6-db.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/geary/HEAD/test/data/geary-0.6-db.tar.xz -------------------------------------------------------------------------------- /desktop/org.gnome.Geary.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=@appid@ 3 | Exec=@bindir@/geary --gapplication-service 4 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | preset: 'glib', 3 | args: '--keyword=Description' 4 | ) 5 | -------------------------------------------------------------------------------- /test/data/test-attachment-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GNOME/geary/HEAD/test/data/test-attachment-image.png -------------------------------------------------------------------------------- /src/client/plugin/special-folders/special-folders.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=special-folders 3 | Name=Special Folders 4 | -------------------------------------------------------------------------------- /ui/meson.build: -------------------------------------------------------------------------------- 1 | geary_resources = gnome.compile_resources('org.gnome.Geary', 2 | files('org.gnome.Geary.gresource.xml'), 3 | ) 4 | -------------------------------------------------------------------------------- /sql/version-029.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Use libstemmer for stemming rather than SQLite. 3 | -- 4 | 5 | DROP TABLE IF EXISTS TokenizerTable; 6 | -------------------------------------------------------------------------------- /src/client/plugin/folder-highlight/folder-highlight.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=folder-highlight 3 | Name=Folder Highlight 4 | -------------------------------------------------------------------------------- /sql/version-009.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Add flags column to the ContactTable 3 | -- 4 | 5 | ALTER TABLE ContactTable ADD COLUMN flags TEXT; 6 | 7 | -------------------------------------------------------------------------------- /src/client/plugin/notification-badge/notification-badge.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=notification-badge 3 | Name=Notification Badge 4 | -------------------------------------------------------------------------------- /subprojects/libhandy.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | directory = libhandy 3 | url = https://gitlab.gnome.org/GNOME/libhandy.git 4 | revision = 1.2.1 5 | 6 | -------------------------------------------------------------------------------- /test/data/meson.build: -------------------------------------------------------------------------------- 1 | test_engine_resources = gnome.compile_resources('org.gnome.GearyTest', 2 | files('org.gnome.GearyTest.gresource.xml'), 3 | ) 4 | -------------------------------------------------------------------------------- /sql/version-014.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Dummy file to upgrade to version 14. See imap-db-database.vala for the 3 | -- actual code that gets executed here. 4 | -- 5 | -------------------------------------------------------------------------------- /sql/version-028.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Rebuild corrupted message ids, again 3 | -- 4 | 5 | UPDATE MessageTable 6 | SET message_id = trim(trim(message_id), '\n'); 7 | -------------------------------------------------------------------------------- /src/client/plugin/desktop-notifications/desktop-notifications.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=desktop-notifications 3 | Name=Desktop Notifications 4 | -------------------------------------------------------------------------------- /sql/version-010.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Add unread count column to the FolderTable 3 | -- 4 | 5 | ALTER TABLE FolderTable ADD COLUMN unread_count INTEGER DEFAULT 0; 6 | -------------------------------------------------------------------------------- /subprojects/vala-unit/README.md: -------------------------------------------------------------------------------- 1 | 2 | ValaUnit 3 | ======== 4 | 5 | A Glib-based, xUnit-style unit testing and mock object framework for 6 | Vala projects. 7 | -------------------------------------------------------------------------------- /sql/version-026.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Track when account storage was last cleaned. 3 | -- 4 | ALTER TABLE GarbageCollectionTable ADD COLUMN last_cleanup_time_t INTEGER DEFAULT NULL; 5 | -------------------------------------------------------------------------------- /sql/version-008.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Index the in_reply_to column, since we're searching on it now. 3 | -- 4 | 5 | CREATE INDEX MessageTableInReplyToIndex ON MessageTable(in_reply_to); 6 | -------------------------------------------------------------------------------- /src/client/plugin/sent-sound/sent-sound.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=sent-sound 3 | Name=Sent Sound 4 | Description=Plays the desktop sent-mail sound when an email is sent 5 | -------------------------------------------------------------------------------- /sql/version-018.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Dummy upgrade to nuke the internaldate_time_t column, because it had the 3 | -- wrong values. It'll be repopulated in code, in imap-db-database.vala. 4 | -- 5 | -------------------------------------------------------------------------------- /src/client/plugin/email-templates/email-templates.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=email-templates 3 | Name=Email Templates 4 | Description=Create reusable templates for sending email 5 | -------------------------------------------------------------------------------- /help/LINGUAS: -------------------------------------------------------------------------------- 1 | # please keep this list sorted alphabetically 2 | # 3 | ca 4 | cs 5 | de 6 | el 7 | es 8 | eu 9 | fr 10 | id 11 | it 12 | pl 13 | pt_BR 14 | ru 15 | sv 16 | tr 17 | uk 18 | -------------------------------------------------------------------------------- /src/client/plugin/messaging-menu/messaging-menu.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=unity-messaging-menu 3 | Name=Messaging Menu 4 | Description=Displays Unity Messaging Menu notifications for new email 5 | -------------------------------------------------------------------------------- /src/client/plugin/mail-merge/mail-merge.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Module=mail-merge 3 | Depends=email-templates 4 | Name=Mail Merge 5 | Description=Fill in and send email templates using a spreadsheet 6 | -------------------------------------------------------------------------------- /sql/version-019.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Dummy database upgrade to validate contact email addresses. See 3 | -- src/engine/imap-db/imap-db-database.vala in post_upgrade() for the code 4 | -- that runs the upgrade. 5 | -- 6 | -------------------------------------------------------------------------------- /sql/version-027.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Rebuild corrupted message ids. 3 | -- 4 | 5 | UPDATE MessageTable 6 | SET message_id = '<' || message_id || '>' 7 | WHERE (message_id NOT LIKE '<%') AND (message_id NOT LIKE ' <%'); 8 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jim Nelson 2 | Eric Gregory 3 | Nate Lillich 4 | Matthew Pirocchi 5 | Charles Lindsay 6 | Robert Schroll 7 | Michael Gratton 8 | -------------------------------------------------------------------------------- /sql/version-012.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Add the internaldate column as a time_t value so we can sort on it. 3 | -- 4 | 5 | ALTER TABLE MessageTable ADD COLUMN internaldate_time_t INTEGER; 6 | 7 | CREATE INDEX MessageTableInternalDateTimeTIndex ON MessageTable(internaldate_time_t); 8 | -------------------------------------------------------------------------------- /desktop/geary-attach.contract.desktop.in: -------------------------------------------------------------------------------- 1 | [Contractor Entry] 2 | Name=Send by email 3 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 4 | Icon=mail-send 5 | Description=Send files using Geary 6 | MimeType=!inode; 7 | Exec=geary-attach %F 8 | -------------------------------------------------------------------------------- /sql/version-003.sql: -------------------------------------------------------------------------------- 1 | 2 | -- 3 | -- SmtpOutboxTable 4 | -- 5 | 6 | CREATE TABLE SmtpOutboxTable ( 7 | id INTEGER PRIMARY KEY, 8 | ordering INTEGER, 9 | message TEXT 10 | ); 11 | 12 | CREATE INDEX SmtpOutboxOrderingIndex ON SmtpOutboxTable(ordering ASC); 13 | 14 | -------------------------------------------------------------------------------- /sql/version-017.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- We're now keeping sent mail around after sending, so we can also push it up 3 | -- to the Sent Mail folder. This column lets us keep track of the state of 4 | -- messages in the outbox. 5 | -- 6 | 7 | ALTER TABLE SmtpOutboxTable ADD COLUMN sent INTEGER DEFAULT 0; 8 | -------------------------------------------------------------------------------- /sql/version-020.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- We had previously incorrectly included an id column in the search table. 3 | -- The code is fixed to use docid instead, so we just empty the table and let 4 | -- the natural search table population process make things right. 5 | -- 6 | 7 | DELETE FROM MessageSearchTable 8 | -------------------------------------------------------------------------------- /sql/version-011.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Create MessageSearchTable 3 | -- 4 | 5 | CREATE VIRTUAL TABLE MessageSearchTable USING fts4( 6 | body, 7 | attachment, 8 | subject, 9 | from_field, 10 | receivers, 11 | cc, 12 | bcc, 13 | 14 | tokenize=simple, 15 | prefix="2,4,6,8,10", 16 | ); 17 | -------------------------------------------------------------------------------- /sql/version-005.sql: -------------------------------------------------------------------------------- 1 | 2 | -- 3 | -- Create ContactTable for autocompletion contacts. 4 | -- 5 | 6 | CREATE TABLE ContactTable ( 7 | id INTEGER PRIMARY KEY, 8 | normalized_email TEXT NOT NULL, 9 | real_name TEXT, 10 | email TEXT UNIQUE NOT NULL, 11 | highest_importance INTEGER NOT NULL 12 | ); 13 | 14 | -------------------------------------------------------------------------------- /sql/version-015.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Dummy database upgrade to fix the INTERNALDATE of messages that were accidentally stored in 3 | -- localized format. See src/engine/imap-db/imap-db-database.vala in post_upgrade() for the code 4 | -- that runs the upgrade, and http://redmine.yorba.org/issues/7354 for more information. 5 | -- 6 | 7 | -------------------------------------------------------------------------------- /subprojects/vala-unit/meson_options.txt: -------------------------------------------------------------------------------- 1 | option( 2 | 'install', 3 | type: 'boolean', 4 | value: true, 5 | description: 'Whether to install the library\'s files' 6 | ) 7 | option( 8 | 'valadoc', 9 | type: 'boolean', 10 | value: true, 11 | description: 'Whether to build the documentaton (requires valadoc).' 12 | ) 13 | -------------------------------------------------------------------------------- /ui/signature-web-view.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * Application logic for SignatureWebView. 10 | */ 11 | 12 | var geary = new PageState(); 13 | -------------------------------------------------------------------------------- /src/mailer/meson.build: -------------------------------------------------------------------------------- 1 | mailer_sources = files( 2 | 'main.vala', 3 | ) 4 | 5 | mailer_dependencies = [ 6 | config_dep, 7 | gee, 8 | gmime, 9 | webkit2gtk, 10 | engine_dep, 11 | ] 12 | 13 | mailer = executable('geary-mailer', 14 | mailer_sources, 15 | dependencies: mailer_dependencies, 16 | vala_args: geary_vala_args, 17 | c_args: geary_c_args, 18 | ) 19 | -------------------------------------------------------------------------------- /sql/version-006.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Dummy database upgrade to fix folder names being stored in encoded form. 3 | -- Before this version, all folder names are stored as they came off the wire. 4 | -- After this version, all folder names are stored in canonical UTF-8 form. 5 | -- See src/engine/imap-db/imap-db-database.vala in post_upgrade() for the code 6 | -- that runs the upgrade. 7 | -- 8 | -------------------------------------------------------------------------------- /src/engine/mime/mime-error.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Errors related to {@link Geary.Mime}. 9 | */ 10 | 11 | public errordomain Geary.MimeError { 12 | PARSE 13 | } 14 | -------------------------------------------------------------------------------- /src/console/meson.build: -------------------------------------------------------------------------------- 1 | console_sources = files( 2 | 'main.vala', 3 | ) 4 | 5 | console_dependencies = [ 6 | config_dep, 7 | gtk, 8 | gee, 9 | gmime, 10 | webkit2gtk, 11 | engine_dep, 12 | ] 13 | 14 | console = executable('geary-console', 15 | console_sources, 16 | dependencies: console_dependencies, 17 | vala_args: geary_vala_args, 18 | c_args: geary_c_args, 19 | ) 20 | -------------------------------------------------------------------------------- /sql/version-002.sql: -------------------------------------------------------------------------------- 1 | 2 | -- 3 | -- MessageAttachmentTable 4 | -- 5 | 6 | CREATE TABLE MessageAttachmentTable ( 7 | id INTEGER PRIMARY KEY, 8 | message_id INTEGER REFERENCES MessageTable ON DELETE CASCADE, 9 | filename TEXT, 10 | mime_type TEXT, 11 | filesize INTEGER 12 | ); 13 | 14 | CREATE INDEX MessageAttachmentTableMessageIDIndex ON MessageAttachmentTable(message_id); 15 | 16 | -------------------------------------------------------------------------------- /sql/version-030.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Convert full-text search from FTS3/4 to FTS5 3 | -- 4 | 5 | DROP TABLE IF EXISTS MessageSearchTable; 6 | 7 | CREATE VIRTUAL TABLE MessageSearchTable USING fts5( 8 | body, 9 | attachments, 10 | subject, 11 | "from", 12 | receivers, 13 | cc, 14 | bcc, 15 | flags, 16 | 17 | tokenize="geary_tokeniser", 18 | prefix="2,4,6,8,10" 19 | ) 20 | -------------------------------------------------------------------------------- /sql/version-013.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Add the disposition column as a string so the client can decide which attachments to show. 3 | -- Since all attachments up to this point have been non-inline, set it to that value (which 4 | -- is defined in src/engine/api/geary-attachment.vala 5 | -- 6 | 7 | ALTER TABLE MessageAttachmentTable ADD COLUMN disposition INTEGER; 8 | UPDATE MessageAttachmentTable SET disposition=0; 9 | 10 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | ar 2 | be 3 | bs 4 | ca 5 | cs 6 | da 7 | de 8 | el 9 | en_CA 10 | en_GB 11 | eo 12 | es 13 | et 14 | eu 15 | fa 16 | fi 17 | fr 18 | fur 19 | gl 20 | he 21 | hi 22 | hr 23 | hu 24 | id 25 | ie 26 | it 27 | ja 28 | ka 29 | kk 30 | km 31 | lt 32 | ms 33 | nb 34 | nl 35 | oc 36 | pl 37 | pt 38 | pt_BR 39 | ro 40 | ru 41 | sk 42 | sl 43 | sr 44 | sr@latin 45 | sv 46 | te 47 | tr 48 | uk 49 | vi 50 | zh_CN 51 | zh_TW 52 | -------------------------------------------------------------------------------- /sql/version-016.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- For a while there, we weren't properly indexing attachment filenames in the 3 | -- search table. To be proper (and since this is right before a major release) 4 | -- we want to make sure anyone who's been running the dailies has a good 5 | -- database, which unfortunately means ditching the search table and letting 6 | -- Geary recreate it properly. 7 | -- 8 | 9 | DELETE FROM MessageSearchTable 10 | -------------------------------------------------------------------------------- /src/engine/rfc822/rfc822-error.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * An error that is thrown when manipulating RFC 822 objects and data. 9 | */ 10 | public errordomain Geary.RFC822.Error { 11 | INVALID, 12 | NOT_FOUND, 13 | FAILED 14 | } 15 | -------------------------------------------------------------------------------- /test/data/org.gnome.GearyTest.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | basic-text-plain.eml 5 | basic-text-html.eml 6 | basic-multipart-alternative.eml 7 | basic-multipart-tnef.eml 8 | geary-0.6-db.tar.xz 9 | test-attachment-image.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | # List of source files that should *not* be translated. 2 | # Please keep this file sorted alphabetically. 3 | _build 4 | build 5 | src/client/plugin/desktop-notifications/desktop-notifications.plugin.desktop.in 6 | src/client/plugin/folder-highlight/folder-highlight.plugin.desktop.in 7 | src/client/plugin/notification-badge/notification-badge.plugin.desktop.in 8 | src/client/plugin/special-folders/special-folders.plugin.desktop.in 9 | subprojects 10 | -------------------------------------------------------------------------------- /sql/version-007.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Gmail has a serious bug: its STATUS command returns a message count that includes chat messages, 3 | -- but the SELECT/EXAMINE result codes do not. That means its difficult to confirm changes to a 4 | -- mailbox without SELECTing it each pass. This schema modification allows for Geary to store both 5 | -- the SELECT/EXAMINE count and STATUS count in the database for comparison. 6 | -- 7 | 8 | ALTER TABLE FolderTable ADD COLUMN last_seen_status_total; 9 | 10 | -------------------------------------------------------------------------------- /sql/version-022.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Database upgrade to repopulate attachments. Bug #713830 revealed that 3 | -- non-text and non-image files with no Content-Disposition were being dropped. 4 | -- Also add Content-ID to database so attachments in RCF822 messages can be paired 5 | -- to extracted attachments on filesystem. 6 | -- 7 | 8 | ALTER TABLE MessageAttachmentTable ADD COLUMN content_id TEXT DEFAULT NULL; 9 | ALTER TABLE MessageAttachmentTable ADD COLUMN description TEXT DEFAULT NULL; 10 | 11 | -------------------------------------------------------------------------------- /test/mock/mock-search-query.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017-2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Mock.SearchQuery : Geary.SearchQuery { 9 | 10 | internal SearchQuery(Gee.List expression, 11 | string raw) { 12 | base(expression, raw); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/engine/app/conversation-monitor/app-terminate-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.TerminateOperation : ConversationOperation { 8 | public TerminateOperation() { 9 | base(null); 10 | } 11 | 12 | public override async void execute_async() { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/engine/imap/imap.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | namespace Geary.Imap { 8 | 9 | private int init_count = 0; 10 | 11 | internal void init() { 12 | if (init_count++ != 0) 13 | return; 14 | 15 | MessageFlag.init(); 16 | MailboxAttribute.init(); 17 | Tag.init(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /help/meson.build: -------------------------------------------------------------------------------- 1 | geary_help_pages = [ 2 | 'accounts.page', 3 | 'archive.page', 4 | 'bugs.page', 5 | 'contributing.page', 6 | 'index.page', 7 | 'label.page', 8 | 'limits.page', 9 | 'overview.page', 10 | 'preferences.page', 11 | 'search.page', 12 | 'shortcuts.page', 13 | 'star.page', 14 | 'write.page', 15 | ] 16 | 17 | geary_help_media = [ 18 | 'figures/geary.svg' 19 | ] 20 | 21 | gnome.yelp(meson.project_name(), 22 | sources: geary_help_pages, 23 | media: geary_help_media 24 | ) 25 | -------------------------------------------------------------------------------- /src/engine/api/geary.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Michael Gratton 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * The primary namespace for the Geary email library. 9 | * 10 | * For the main entry point, see {@link Geary.Engine}. 11 | */ 12 | namespace Geary { 13 | 14 | // This source file exists purely as a place for the namespace's 15 | // documentation comment. 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/engine/db/db-database-error.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public errordomain Geary.DatabaseError { 8 | GENERAL, 9 | OPEN_REQUIRED, 10 | BUSY, 11 | CORRUPT, 12 | ACCESS, 13 | MEMORY, 14 | ABORT, 15 | INTERRUPT, 16 | LIMITS, 17 | TYPESPEC, 18 | FINISHED, 19 | SCHEMA_VERSION 20 | } 21 | 22 | -------------------------------------------------------------------------------- /desktop/geary-autostart.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Geary 3 | GenericName=Email 4 | Comment=Send and receive email 5 | # Translators: These are desktop search terms. Do not translate semicolons, end line with a semicolon. 6 | Keywords=Email;E-mail;Mail; 7 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 8 | Icon=@appid@ 9 | TryExec=geary 10 | Exec=geary --gapplication-service 11 | Type=Application 12 | Terminal=false 13 | Categories=GNOME;GTK;Network;Email; 14 | StartupNotify=true 15 | NoDisplay=true 16 | -------------------------------------------------------------------------------- /src/engine/nonblocking/nonblocking-error.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public errordomain Geary.NonblockingError { 8 | /** 9 | * Indicates a call was made when it shouldn't have been; that the primitive was in such a 10 | * state that it cannot properly respond or account for the requested change. 11 | */ 12 | INVALID 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/engine/api/geary-logging.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Provides some control over Engine logging. 9 | * 10 | * This is a crude implementation and could be improved. Most importantly, when the Engine is 11 | * initialized logging is disabled for all users of GLib's logging functions. 12 | */ 13 | 14 | namespace Geary.Logging { 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/engine/imap-engine/other/imap-engine-other-folder.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.ImapEngine.OtherFolder : GenericFolder { 8 | 9 | public OtherFolder(OtherAccount account, 10 | ImapDB.Folder local_folder, 11 | Folder.SpecialUse use) { 12 | base(account, local_folder, use); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/engine/imap-engine/outlook/imap-engine-outlook-folder.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.ImapEngine.OutlookFolder : GenericFolder { 8 | public OutlookFolder(OutlookAccount account, 9 | ImapDB.Folder local_folder, 10 | Folder.SpecialUse use) { 11 | base(account, local_folder, use); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sql/version-023.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Database upgrade to add FTS tokenize virtual table, which allows for querying the tokenizer 3 | -- directly for stemmed words, and dropping the stemmed FTS table for an unstemmed one. We now 4 | -- use the stemmer manually to generate search queries. 5 | -- 6 | 7 | DROP TABLE MessageSearchTable; 8 | 9 | CREATE VIRTUAL TABLE MessageSearchTable USING fts4( 10 | body, 11 | attachment, 12 | subject, 13 | from_field, 14 | receivers, 15 | cc, 16 | bcc, 17 | 18 | tokenize=simple, 19 | prefix="2,4,6,8,10" 20 | ); 21 | 22 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-close-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.4.2]] 9 | */ 10 | 11 | public class Geary.Imap.CloseCommand : Command { 12 | 13 | public const string NAME = "close"; 14 | 15 | public CloseCommand(GLib.Cancellable? should_send) { 16 | base(NAME, null, should_send); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /test/data/basic-text-plain.eml: -------------------------------------------------------------------------------- 1 | From: Alice 2 | Sender: Bob 3 | To: Charlie 4 | CC: Dave 5 | BCC: Eve 6 | Reply-To: "Alice: Personal Account" 7 | Subject: Re: Basic text/plain message 8 | Date: Fri, 21 Nov 1997 10:01:10 -0600 9 | Message-ID: <3456@example.net> 10 | In-Reply-To: <1234@local.machine.example> 11 | References: <1234@local.machine.example> 12 | X-Mailer: Geary Test Suite 1.0 13 | 14 | This is the first line. 15 | 16 | This is the second line. 17 | 18 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-logout-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.1.3]] 9 | */ 10 | 11 | public class Geary.Imap.LogoutCommand : Command { 12 | 13 | public const string NAME = "logout"; 14 | 15 | public LogoutCommand(GLib.Cancellable? should_send) { 16 | base(NAME, null, should_send); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /test/engine/common/common-contact-harvester-mock.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | internal class Geary.MockContactHarvester : 9 | Geary.BaseObject, 10 | ContactHarvester { 11 | 12 | public async void harvest_from_email(Gee.Collection messages, 13 | GLib.Cancellable? cancellable) 14 | throws GLib.Error { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-starttls-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.2.1]] 9 | */ 10 | 11 | public class Geary.Imap.StarttlsCommand : Command { 12 | 13 | public const string NAME = "STARTTLS"; 14 | 15 | public StarttlsCommand(GLib.Cancellable? should_send) { 16 | base(NAME, null, should_send); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/engine/outbox/outbox-email-properties.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | private class Geary.Outbox.EmailProperties : Geary.EmailProperties { 9 | 10 | 11 | public EmailProperties(GLib.DateTime date_received, long total_bytes) { 12 | base(date_received, total_bytes); 13 | } 14 | 15 | public override string to_string() { 16 | return "Outbox.Properties"; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-noop-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.1.2]] 9 | * 10 | * @see IdleCommand 11 | */ 12 | 13 | public class Geary.Imap.NoopCommand : Command { 14 | 15 | public const string NAME = "noop"; 16 | 17 | public NoopCommand(GLib.Cancellable? should_send) { 18 | base(NAME, null, should_send); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/engine/app/email-store/app-async-folder-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private abstract class Geary.App.AsyncFolderOperation : BaseObject { 8 | public abstract Type folder_type { get; } 9 | 10 | public abstract async Gee.Collection execute_async( 11 | Geary.Folder folder, Gee.Collection ids, 12 | Cancellable? cancellable) throws Error; 13 | } 14 | -------------------------------------------------------------------------------- /src/engine/api/geary-special-folder-type.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public enum Geary.SpecialFolderType { 8 | 9 | NONE, 10 | INBOX, 11 | SEARCH, 12 | DRAFTS, 13 | SENT, 14 | FLAGGED, 15 | IMPORTANT, 16 | ALL_MAIL, 17 | JUNK, 18 | TRASH, 19 | OUTBOX, 20 | ARCHIVE; 21 | 22 | public bool is_outgoing() { 23 | return this == SENT || this == OUTBOX; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/engine/smtp/smtp-data-format.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | namespace Geary.Smtp.DataFormat { 8 | 9 | public const string ARG_SEPARATOR = " "; 10 | 11 | public const string LINE_TERMINATOR = "\r\n"; 12 | public const DataStreamNewlineType LINE_TERMINATOR_TYPE = DataStreamNewlineType.CR_LF; 13 | 14 | public const string DATA_TERMINATOR = "\r\n.\r\n"; 15 | 16 | public const string CANCEL_AUTHENTICATION = "*"; 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-capability-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.1.1]] 9 | * 10 | * @see Capabilities 11 | */ 12 | 13 | public class Geary.Imap.CapabilityCommand : Command { 14 | 15 | public const string NAME = "capability"; 16 | 17 | public CapabilityCommand(GLib.Cancellable? should_send) { 18 | base(NAME, null, should_send); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /test/data/basic-text-html.eml: -------------------------------------------------------------------------------- 1 | From: Alice 2 | Sender: Bob 3 | To: Charlie 4 | CC: Dave 5 | BCC: Eve 6 | Reply-To: \"Alice: Personal Account\" 7 | Subject: Re: Basic text/html message 8 | Date: Fri, 21 Nov 1997 10:01:10 -0600 9 | Content-Type: text/html; charset=UTF-8 10 | Message-ID: <3456@example.net> 11 | In-Reply-To: <1234@local.machine.example> 12 | References: <1234@local.machine.example> 13 | X-Mailer: Geary Test Suite 1.0 14 | 15 |

This is the first line. 16 | 17 |

This is the second line. 18 | 19 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-account.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * An object representing an account for use by plugins. 10 | * 11 | * Instances of these may be obtained from their respective {@link 12 | * Folder} objects. 13 | */ 14 | public interface Plugin.Account : Geary.BaseObject { 15 | 16 | 17 | /** Returns the human-readable name of this account. */ 18 | public abstract string display_name { get; } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /test/mock/mock-email-properties.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Mock.EmailProperties : Geary.EmailProperties { 9 | 10 | 11 | public EmailProperties(GLib.DateTime received) { 12 | base(received, 0); 13 | } 14 | 15 | public override string to_string() { 16 | return "Mock.EmailProperties: %s/%lli".printf( 17 | this.date_received.to_string(), this.total_bytes 18 | ); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /test/mock/mock-folder-properties.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Mock.FolderPoperties : Geary.FolderProperties { 9 | 10 | 11 | public FolderPoperties() { 12 | base( 13 | 0, 14 | 0, 15 | Geary.Trillian.UNKNOWN, 16 | Geary.Trillian.UNKNOWN, 17 | Geary.Trillian.UNKNOWN, 18 | false, 19 | false, 20 | false 21 | ); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/client/application/main.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | int main(string[] args) { 8 | // Init logging right up front so as to capture as many log 9 | // messages as possible 10 | Geary.Logging.init(); 11 | GLib.Log.set_writer_func(Geary.Logging.default_log_writer); 12 | 13 | Application.Client app = new Application.Client(); 14 | 15 | int ec = app.run(args); 16 | 17 | #if REF_TRACKING 18 | Geary.BaseObject.dump_refs(stdout); 19 | #endif 20 | 21 | return ec; 22 | } 23 | -------------------------------------------------------------------------------- /src/engine/outbox/outbox-folder-properties.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | private class Geary.Outbox.FolderProperties : Geary.FolderProperties { 9 | 10 | public FolderProperties(int total, int unread) { 11 | base( 12 | total, unread, 13 | Trillian.FALSE, Trillian.FALSE, Trillian.TRUE, 14 | true, false, false 15 | ); 16 | } 17 | 18 | public void set_total(int total) { 19 | this.email_total = total; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contribute to Geary 2 | ------------------- 3 | 4 | Want to help improve Geary? There are a number of ways you can contribute! 5 | 6 | * [Bug Reporting](https://gitlab.gnome.org/GNOME/geary/-/wikis/Reporting-Bugs-and-Requesting-Features): report new bugs or request new features 7 | * [Translating](https://gitlab.gnome.org/GNOME/geary/-/wikis/Translating): translate Geary’s user interface and user manual into new languages 8 | * [Development](https://gitlab.gnome.org/GNOME/geary/-/wikis/Development): fix bugs and add new features 9 | 10 | See [the wiki](https://gitlab.gnome.org/GNOME/geary/-/wikis) for more 11 | information and options for contributing financially to Geary's 12 | development. 13 | -------------------------------------------------------------------------------- /sql/version-021.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Some queries that hit the MessageLocationTable, like those used by the email 3 | -- prefetcher, were slow because we didn't have a covering index. This makes 4 | -- an index that *is* covering, for the cases in question anyway. Since we 5 | -- (should) never care about ordering without folder_id, and since folder_id 6 | -- comes first here so this index effectively indexes queries on just that 7 | -- field too, we can also drop the old, ineffective indices. 8 | -- 9 | 10 | DROP INDEX MessageLocationTableFolderIdIndex; 11 | DROP INDEX MessageLocationTableOrderingIndex; 12 | CREATE INDEX MessageLocationTableFolderIDOrderingIndex 13 | ON MessageLocationTable(folder_id, ordering); 14 | -------------------------------------------------------------------------------- /src/client/plugin/folder-highlight/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'folder-highlight' 3 | 4 | plugin_src = files(plugin_name + '.vala') 5 | plugin_data = plugin_name + '.plugin' 6 | plugin_dest = plugins_dir / plugin_name 7 | 8 | shared_module( 9 | plugin_name, 10 | sources: plugin_src, 11 | dependencies: plugin_dependencies, 12 | vala_args: geary_vala_args, 13 | c_args: plugin_c_args, 14 | install: true, 15 | install_dir: plugin_dest, 16 | install_rpath: client_lib_dir, 17 | ) 18 | 19 | custom_target( 20 | plugin_data, 21 | input: files(plugin_data + plugin_data_src_suffix), 22 | output: plugin_data, 23 | command: msgfmt_plugin_cmd, 24 | install: true, 25 | install_dir: plugin_dest 26 | ) 27 | -------------------------------------------------------------------------------- /src/client/plugin/email-templates/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'email-templates' 3 | 4 | plugin_src = files(plugin_name + '.vala') 5 | plugin_data = plugin_name + plugin_data_suffix 6 | plugin_dest = plugins_dir / plugin_name 7 | 8 | shared_module( 9 | plugin_name, 10 | sources: plugin_src, 11 | dependencies: plugin_dependencies, 12 | vala_args: geary_vala_args, 13 | c_args: plugin_c_args, 14 | install: true, 15 | install_dir: plugin_dest, 16 | install_rpath: client_lib_dir, 17 | ) 18 | 19 | custom_target( 20 | plugin_data, 21 | input: files(plugin_data + plugin_data_src_suffix), 22 | output: plugin_data, 23 | command: msgfmt_plugin_cmd, 24 | install: true, 25 | install_dir: plugin_dest 26 | ) 27 | -------------------------------------------------------------------------------- /src/client/plugin/special-folders/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'special-folders' 3 | 4 | plugin_src = files(plugin_name + '.vala') 5 | plugin_data = plugin_name + plugin_data_suffix 6 | plugin_dest = plugins_dir / plugin_name 7 | 8 | shared_module( 9 | plugin_name, 10 | sources: plugin_src, 11 | dependencies: plugin_dependencies, 12 | vala_args: geary_vala_args, 13 | c_args: plugin_c_args, 14 | install: true, 15 | install_dir: plugin_dest, 16 | install_rpath: client_lib_dir, 17 | ) 18 | 19 | custom_target( 20 | plugin_data, 21 | input: files(plugin_data + plugin_data_src_suffix), 22 | output: plugin_data, 23 | command: msgfmt_plugin_cmd, 24 | install: true, 25 | install_dir: plugin_dest 26 | ) 27 | -------------------------------------------------------------------------------- /src/client/plugin/desktop-notifications/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'desktop-notifications' 3 | 4 | plugin_src = files(plugin_name + '.vala') 5 | plugin_data = plugin_name + plugin_data_suffix 6 | plugin_dest = plugins_dir / plugin_name 7 | 8 | shared_module( 9 | plugin_name, 10 | sources: plugin_src, 11 | dependencies: plugin_dependencies, 12 | vala_args: geary_vala_args, 13 | c_args: plugin_c_args, 14 | install: true, 15 | install_dir: plugin_dest, 16 | install_rpath: client_lib_dir, 17 | ) 18 | 19 | custom_target( 20 | plugin_data, 21 | input: files(plugin_data + plugin_data_src_suffix), 22 | output: plugin_data, 23 | command: msgfmt_plugin_cmd, 24 | install: true, 25 | install_dir: plugin_dest 26 | ) 27 | -------------------------------------------------------------------------------- /ui/components-attachment-pane-menus.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 |
6 | 7 | _Open 8 | cap.open 9 | 10 | 11 | _Save 12 | cap.save 13 | 14 |
15 |
16 | 17 | Save _All 18 | cap.save-all 19 | 20 |
21 |
22 | 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # this file helps keeping consistent code style in all the project. IDEs will 2 | # automatically use the code style as defined in this file 3 | # see https://editorconfig.org/ 4 | root=true 5 | # Unix-style newlines with a newline ending every file 6 | [*] 7 | end_of_line=lf 8 | insert_final_newline=true 9 | charset=utf-8 10 | trim_trailing_whitespace=true 11 | 12 | [*.vala] 13 | indent_style=space 14 | indent_size=4 15 | 16 | [*.xml] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.css] 21 | indent_style=space 22 | indent_size=2 23 | 24 | [*.json] 25 | indent_style=space 26 | indent_size=4 27 | 28 | [meson.build] 29 | indent_style=space 30 | indent_size=2 31 | 32 | [.gitlab-ci.yml] 33 | indent_style=space 34 | indent_size=2 35 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/New feature.md: -------------------------------------------------------------------------------- 1 | **Feature Summary** 2 | 3 | Describe what you would like to be able to do with Geary that you 4 | currently cannot do, such as "send email whilst underwater". 5 | 6 | Please replace all comments such as this with the requested 7 | information. 8 | 9 | 10 | **How would you like it to work** 11 | 12 | If you can think of a way Geary might be able to do this, let us know 13 | here. 14 | 15 | 16 | **Relevant links, screenshots, etc.** 17 | 18 | If you have further information about missing features, such as 19 | technical documentation, or a similar feature in another email 20 | application, please provide links and/or screenshots. 21 | 22 | 23 | 24 | /label ~"1. Feature" 25 | -------------------------------------------------------------------------------- /sql/version-025.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Rebuild corrupted MessageSearchTable indexes. Bug 772522. 3 | -- 4 | 5 | -- According to the FTS3 docs , this 6 | -- needs to be done "whenever the implementation of a custom tokeniser 7 | -- changes", but Geary is also seeing the indexes being corrupted when 8 | -- doing UPDATEs on MessageSearchTable. Bug 772522 has replaced use of 9 | -- that with a SELECT/DELETE/INSERT which does not result in a 10 | -- corrupted index, so do a rebuild here to ensure everyone's is not 11 | -- back in order. 12 | INSERT INTO MessageSearchTable(MessageSearchTable) VALUES('rebuild'); 13 | 14 | -- While we're here, optimise it as well. 15 | INSERT INTO MessageSearchTable(MessageSearchTable) VALUES('optimize'); 16 | -------------------------------------------------------------------------------- /src/client/plugin/notification-badge/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'notification-badge' 3 | 4 | plugin_src = files( 5 | plugin_name + '.vala', 6 | 'unity-launcher-entry.vala' 7 | ) 8 | plugin_data = plugin_name + plugin_data_suffix 9 | plugin_dest = plugins_dir / plugin_name 10 | 11 | shared_module( 12 | plugin_name, 13 | sources: plugin_src, 14 | dependencies: plugin_dependencies, 15 | vala_args: geary_vala_args, 16 | c_args: plugin_c_args, 17 | install: true, 18 | install_dir: plugin_dest, 19 | install_rpath: client_lib_dir, 20 | ) 21 | 22 | custom_target( 23 | plugin_data, 24 | input: files(plugin_data + plugin_data_src_suffix), 25 | output: plugin_data, 26 | command: msgfmt_plugin_cmd, 27 | install: true, 28 | install_dir: plugin_dest 29 | ) 30 | -------------------------------------------------------------------------------- /subprojects/vala-unit/test/test-driver.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | int main(string[] args) { 9 | Test.init(ref args); 10 | 11 | unowned TestSuite root = TestSuite.get_root(); 12 | root.add_suite(new TestAssertions().steal_suite()); 13 | root.add_suite(new CollectionAssertions().steal_suite()); 14 | 15 | MainLoop loop = new MainLoop (); 16 | 17 | int ret = -1; 18 | Idle.add(() => { 19 | ret = Test.run(); 20 | loop.quit(); 21 | return false; 22 | }); 23 | 24 | loop.run(); 25 | return ret; 26 | } 27 | -------------------------------------------------------------------------------- /help/C/limits.page: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | Limitations 10 | 11 |

Geary is still in early development. Geary supports IMAP and has 12 | been tested with Gmail, Yahoo, and the free Dovecot mail server. 13 | Experimental support for Outlook.com is provided. Geary may not yet 14 | work well with some IMAP servers. At this time Geary is still 15 | missing numerous features including offline mode.

16 | 17 |

To learn more about the features we're working on and the future 18 | of Geary, please visit Geary's wiki page.

20 | 21 |
22 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-namespace-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The RFC 2342 NAMESPACE command. 10 | * 11 | * Determines the mailbox name prefix and hierarchy delimiter for the 12 | * personal, other user's and public namespaces. 13 | * 14 | * See [[https://tools.ietf.org/html/rfc2342|RFC 2342]] for details. 15 | */ 16 | public class Geary.Imap.NamespaceCommand : Command { 17 | 18 | public const string NAME = "NAMESPACE"; 19 | 20 | public NamespaceCommand(GLib.Cancellable? should_send) { 21 | base(NAME, null, should_send); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/client/plugin/sent-sound/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'sent-sound' 3 | 4 | send_sound_dependencies = plugin_dependencies 5 | send_sound_dependencies += gsound 6 | 7 | plugin_src = files(plugin_name + '.vala') 8 | plugin_data = plugin_name + plugin_data_suffix 9 | plugin_dest = plugins_dir / plugin_name 10 | 11 | shared_module( 12 | plugin_name, 13 | sources: plugin_src, 14 | dependencies: send_sound_dependencies, 15 | vala_args: geary_vala_args, 16 | c_args: plugin_c_args, 17 | install: true, 18 | install_dir: plugin_dest, 19 | install_rpath: client_lib_dir, 20 | ) 21 | 22 | custom_target( 23 | plugin_data, 24 | input: files(plugin_data + plugin_data_src_suffix), 25 | output: plugin_data, 26 | command: msgfmt_plugin_cmd, 27 | install: true, 28 | install_dir: plugin_dest 29 | ) 30 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-login-command.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * See [[http://tools.ietf.org/html/rfc3501#section-6.2.3]] 9 | */ 10 | 11 | public class Geary.Imap.LoginCommand : Command { 12 | 13 | public const string NAME = "login"; 14 | 15 | public LoginCommand(string user, 16 | string pass, 17 | GLib.Cancellable? should_send) { 18 | base(NAME, { user, pass }, should_send); 19 | } 20 | 21 | public override string to_string() { 22 | return "%s %s ".printf(tag.to_string(), name); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-select-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * See [[http://tools.ietf.org/html/rfc3501#section-6.3.1]] 10 | * 11 | * @see ExamineCommand 12 | */ 13 | public class Geary.Imap.SelectCommand : Command { 14 | 15 | public const string NAME = "select"; 16 | 17 | public MailboxSpecifier mailbox { get; private set; } 18 | 19 | public SelectCommand(MailboxSpecifier mailbox, 20 | GLib.Cancellable? should_send) { 21 | base(NAME, null, should_send); 22 | this.mailbox = mailbox; 23 | this.args.add(mailbox.to_parameter()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-examine-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * See [[http://tools.ietf.org/html/rfc3501#section-6.3.2]] 10 | * 11 | * @see SelectCommand 12 | */ 13 | public class Geary.Imap.ExamineCommand : Command { 14 | 15 | public const string NAME = "examine"; 16 | 17 | public MailboxSpecifier mailbox { get; private set; } 18 | 19 | public ExamineCommand(MailboxSpecifier mailbox, 20 | GLib.Cancellable? should_send) { 21 | base(NAME, null, should_send); 22 | this.mailbox = mailbox; 23 | this.args.add(mailbox.to_parameter()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/client/folder-list/folder-list-special-grouping.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | // An ordered grouping meant to go alongside special folders in the account 8 | // branch. 9 | public class FolderList.SpecialGrouping : Sidebar.Grouping { 10 | // Must be != 0 and unique among SpecialGroupings. Bigger comes later 11 | // in the list. If < 0, it comes before non-SpecialGroupings. 12 | public int position { get; private set; } 13 | 14 | public SpecialGrouping(int position, string name, string? icon, 15 | string? tooltip = null) { 16 | base(name, icon, tooltip); 17 | 18 | this.position = position; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/engine/imap/message/imap-namespace.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * Namespace component in a response for a NAMESPACE command. 10 | * 11 | * @see Geary.Imap.NamespaceCommand 12 | */ 13 | public class Geary.Imap.Namespace : BaseObject { 14 | 15 | 16 | public string prefix { get; private set; } 17 | public string? delim { get; private set; } 18 | 19 | 20 | public Namespace(string prefix, string? delim) { 21 | this.prefix = prefix; 22 | this.delim = delim; 23 | } 24 | 25 | public string to_string() { 26 | return "(%s,%s)".printf(this.prefix, this.delim ?? "NIL"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /help/C/index.page: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | Geary 8 | Geary 9 | Geary 10 | 11 | 12 | 13 | <media type="image" its:translate="no" src="figures/geary.svg" width="48" height="48"></media> 14 | <span>Geary</span> 15 | 16 | 17 |
18 | Introduction 19 |
20 | 21 |
22 | Using Geary 23 |
24 | 25 |
26 | Contributing and getting support 27 |
28 | 29 |
30 | -------------------------------------------------------------------------------- /test/engine/outbox/outbox-email-identifier-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Geary.Outbox.EmailIdentifierTest : TestCase { 9 | 10 | 11 | public EmailIdentifierTest() { 12 | base("Geary.Outbox.EmailIdentifierTest"); 13 | add_test("variant_representation", variant_representation); 14 | } 15 | 16 | public void variant_representation() throws GLib.Error { 17 | EmailIdentifier orig = new EmailIdentifier(123, 321); 18 | GLib.Variant variant = orig.to_variant(); 19 | EmailIdentifier copy = new EmailIdentifier.from_variant(variant); 20 | 21 | assert_true(orig.equal_to(copy)); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-copy-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * See [[http://tools.ietf.org/html/rfc3501#section-6.4.7]] 10 | */ 11 | public class Geary.Imap.CopyCommand : Command { 12 | 13 | public const string NAME = "copy"; 14 | public const string UID_NAME = "uid copy"; 15 | 16 | public CopyCommand(MessageSet message_set, 17 | MailboxSpecifier destination, 18 | GLib.Cancellable? should_send) { 19 | base(message_set.is_uid ? UID_NAME : NAME, null, should_send); 20 | 21 | this.args.add(message_set.to_parameter()); 22 | this.args.add(destination.to_parameter()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/engine/api/geary-credentials-mediator.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2018 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | /** 10 | * A store for authentication tokens. 11 | */ 12 | public interface Geary.CredentialsMediator : GLib.Object { 13 | 14 | /** 15 | * Updates the token for a service's credential from the store. 16 | * 17 | * Returns true if the token was present and loaded, else false. 18 | */ 19 | public abstract async bool load_token(AccountInformation account, 20 | ServiceInformation service, 21 | GLib.Cancellable? cancellable) 22 | throws GLib.Error; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sql/meson.build: -------------------------------------------------------------------------------- 1 | sql_files = [ 2 | 'version-001.sql', 3 | 'version-002.sql', 4 | 'version-003.sql', 5 | 'version-004.sql', 6 | 'version-005.sql', 7 | 'version-006.sql', 8 | 'version-007.sql', 9 | 'version-008.sql', 10 | 'version-009.sql', 11 | 'version-010.sql', 12 | 'version-011.sql', 13 | 'version-012.sql', 14 | 'version-013.sql', 15 | 'version-014.sql', 16 | 'version-015.sql', 17 | 'version-016.sql', 18 | 'version-017.sql', 19 | 'version-018.sql', 20 | 'version-019.sql', 21 | 'version-020.sql', 22 | 'version-021.sql', 23 | 'version-022.sql', 24 | 'version-023.sql', 25 | 'version-024.sql', 26 | 'version-025.sql', 27 | 'version-026.sql', 28 | 'version-027.sql', 29 | 'version-028.sql', 30 | 'version-029.sql', 31 | 'version-030.sql', 32 | ] 33 | 34 | install_data(sql_files, 35 | install_dir: join_paths(data_dir, meson.project_name(), 'sql') 36 | ) 37 | -------------------------------------------------------------------------------- /test/engine/imap-db/imap-db-email-identifier-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Geary.ImapDB.EmailIdentifierTest : TestCase { 9 | 10 | 11 | public EmailIdentifierTest() { 12 | base("Geary.ImapDB.EmailIdentifierTest"); 13 | add_test("variant_representation", variant_representation); 14 | } 15 | 16 | public void variant_representation() throws GLib.Error { 17 | EmailIdentifier orig = new EmailIdentifier( 18 | 123, new Imap.UID(321) 19 | ); 20 | GLib.Variant variant = orig.to_variant(); 21 | EmailIdentifier copy = new EmailIdentifier.from_variant(variant); 22 | 23 | assert_true(orig.equal_to(copy)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-delete-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The RFC 3501 DELETE command. 10 | * 11 | * Deletes the given mailbox. Per the RFC, this must not be used to 12 | * delete mailboxes with child (inferior) mailboxes and that also are 13 | * marked \Noselect. 14 | * 15 | * See [[http://tools.ietf.org/html/rfc3501#section-6.3.4]] 16 | */ 17 | public class Geary.Imap.DeleteCommand : Command { 18 | 19 | public const string NAME = "DELETE"; 20 | 21 | public DeleteCommand(MailboxSpecifier mailbox, 22 | GLib.Cancellable? should_send) { 23 | base(NAME, null, should_send); 24 | this.args.add(mailbox.to_parameter()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/client/accounts/accounts-signature-web-view.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A class for editing signatures in the accounts editor. 10 | */ 11 | public class Accounts.SignatureWebView : Components.WebView { 12 | 13 | 14 | private static WebKit.UserScript? app_script = null; 15 | 16 | public static new void load_resources() 17 | throws GLib.Error { 18 | SignatureWebView.app_script = Components.WebView.load_app_script( 19 | "signature-web-view.js" 20 | ); 21 | } 22 | 23 | 24 | public SignatureWebView(Application.Configuration config) { 25 | base(config); 26 | this.user_content_manager.add_script(SignatureWebView.app_script); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /desktop/geary-attach: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a wrapper script to attach several files to an email in Geary. 4 | # Written by Viko Adi Rahmawan 5 | # License: 3-clause BSD 6 | 7 | #TODO: define a Gettext domain 8 | 9 | # Disable history substitution on "!" symbols so we can have them in strings 10 | set +H 11 | 12 | if [ -z "$1" ] || [ "$1" = '-h' ] || [ "$1" = '--help' ]; then 13 | echo $"Usage: $0 /path/to/file [/path/to/another/file...] 14 | Relative paths are also supported." 15 | exit 1 # so that calling without parameters is counted as a failure 16 | fi 17 | 18 | #we don't do file checking as geary is clever enough 19 | ARG="mailto:?attachment=$1" #add first file 20 | shift 21 | while [ -n "$1" ]; do 22 | ARG="$ARG&attachment=$1" #add more file if 23 | shift 24 | done 25 | 26 | if [ -n "$ARG" ]; then 27 | # Finally execute geary 28 | geary "${ARG}" 29 | else 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /src/engine/app/conversation-monitor/app-append-operation.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2019 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | private class Geary.App.AppendOperation : BatchOperation { 10 | 11 | 12 | public AppendOperation(ConversationMonitor monitor, 13 | Gee.Collection appended_ids) { 14 | base(monitor, appended_ids); 15 | } 16 | 17 | public override async void execute_batch(Gee.Collection batch) 18 | throws GLib.Error { 19 | debug("Appending %d message(s) to %s", 20 | batch.size, this.monitor.base_folder.to_string()); 21 | 22 | yield this.monitor.load_by_sparse_id(batch); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-error.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The base class for objects implementing a client plugin. 10 | * 11 | * To implement a new plugin, have it derive from this type and 12 | * implement any additional extension interfaces (such as {@link 13 | * NotificationExtension}) as required. 14 | */ 15 | 16 | /** 17 | * Errors when plugins request resources from their contexts. 18 | */ 19 | public errordomain Plugin.Error { 20 | 21 | /** Raised when access to a requested resource was denied. */ 22 | PERMISSION_DENIED, 23 | 24 | /** Raised when a requested resource was not found. */ 25 | NOT_FOUND, 26 | 27 | /** Raised when a requested operation could not be carried out. */ 28 | NOT_SUPPORTED; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /desktop/org.gnome.Geary.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Geary 3 | GenericName=Email 4 | Comment=Send and receive email 5 | # Translators: These are desktop search terms. Do not translate semicolons, end line with a semicolon. 6 | Keywords=Mail;E-mail;email;IMAP;GMail;Yahoo;Hotmail;Outlook; 7 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 8 | Icon=@appid@ 9 | TryExec=geary 10 | Exec=geary %U 11 | Type=Application 12 | Terminal=false 13 | Categories=GNOME;GTK;Network;Email; 14 | MimeType=x-scheme-handler/mailto; 15 | StartupNotify=true 16 | DBusActivatable=true 17 | Actions=compose;new-window 18 | X-GNOME-UsesNotifications=true 19 | # Translators: Do NOT translate or transliterate this text (these are enum types)! 20 | X-Purism-FormFactor=Workstation;Mobile; 21 | 22 | [Desktop Action compose] 23 | Name=Compose Message 24 | Exec=geary mailto: 25 | 26 | [Desktop Action new-window] 27 | Name=New Window 28 | Exec=geary --new-window 29 | -------------------------------------------------------------------------------- /src/engine/imap-engine/gmail/imap-engine-gmail-all-mail-folder.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Gmail's All Mail folder supports basic operations as well as true removal of emails. 9 | */ 10 | 11 | private class Geary.ImapEngine.GmailAllMailFolder : MinimalFolder, FolderSupport.Remove { 12 | public GmailAllMailFolder(GmailAccount account, 13 | ImapDB.Folder local_folder) { 14 | base(account, local_folder, ALL_MAIL); 15 | } 16 | 17 | public async void 18 | remove_email_async(Gee.Collection email_ids, 19 | GLib.Cancellable? cancellable = null) 20 | throws GLib.Error { 21 | yield GmailFolder.true_remove_email_async(this, email_ids, cancellable); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-expunge-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * See [[http://tools.ietf.org/html/rfc3501#section-6.4.3]] and 10 | * [[http://tools.ietf.org/html/rfc4315#section-2.1]] 11 | */ 12 | public class Geary.Imap.ExpungeCommand : Command { 13 | 14 | public const string NAME = "expunge"; 15 | public const string UID_NAME = "uid expunge"; 16 | 17 | public ExpungeCommand(GLib.Cancellable? should_send) { 18 | base(NAME, null, should_send); 19 | } 20 | 21 | public ExpungeCommand.uid(MessageSet message_set, 22 | GLib.Cancellable? should_send) { 23 | base(UID_NAME, null, should_send); 24 | assert(message_set.is_uid); 25 | this.args.add(message_set.to_parameter()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /sql/version-024.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Add the DeleteAttachmentFile table, which allows for attachment files to be deleted (garbage 3 | -- collected) after all references to them have been removed from the database without worrying 4 | -- about deleting them first and the database transaction failing. 5 | -- 6 | -- Also add GarbageCollectionTable, a single-row table holding various information about when 7 | -- GC has occurred and when it should occur next. 8 | -- 9 | 10 | CREATE TABLE DeleteAttachmentFileTable ( 11 | id INTEGER PRIMARY KEY, 12 | filename TEXT NOT NULL 13 | ); 14 | 15 | CREATE TABLE GarbageCollectionTable ( 16 | id INTEGER PRIMARY KEY, 17 | last_reap_time_t INTEGER DEFAULT NULL, 18 | last_vacuum_time_t INTEGER DEFAULT NULL, 19 | reaped_messages_since_last_vacuum INTEGER DEFAULT 0 20 | ); 21 | 22 | -- Insert a single row with a well-known rowid and default values, this will be the row used 23 | -- by the ImapDB.GC class. 24 | INSERT INTO GarbageCollectionTable (id) VALUES (0); 25 | 26 | -------------------------------------------------------------------------------- /ui/conversation-list-view.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 24 | 25 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-mark.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Mark interface indicates 10 | * the {@link Geary.Folder} supports marking and unmarking messages 11 | * with system and user-defined flags. 12 | */ 13 | public interface Geary.FolderSupport.Mark : Geary.Folder { 14 | 15 | /** 16 | * Adds and removes flags from a list of messages. 17 | * 18 | * This folder must be opened prior to attempting this operation. 19 | */ 20 | public abstract async void 21 | mark_email_async(Gee.Collection to_mark, 22 | EmailFlags? flags_to_add, 23 | EmailFlags? flags_to_remove, 24 | GLib.Cancellable? cancellable = null) 25 | throws GLib.Error; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/db/db-synchronous-mode.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public enum Geary.Db.SynchronousMode { 8 | OFF = 0, 9 | NORMAL = 1, 10 | FULL = 2; 11 | 12 | public unowned string sql() { 13 | switch (this) { 14 | case OFF: 15 | return "off"; 16 | 17 | case NORMAL: 18 | return "normal"; 19 | 20 | case FULL: 21 | default: 22 | return "full"; 23 | } 24 | } 25 | 26 | public static SynchronousMode parse(string str) { 27 | switch (str.down()) { 28 | case "off": 29 | return OFF; 30 | 31 | case "normal": 32 | return NORMAL; 33 | 34 | case "full": 35 | default: 36 | return FULL; 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/engine/memory/memory-unowned-string-buffer.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Interface which allows access to backing string of {@link Memory.Buffer} without transferring 9 | * ownership, i.e. copying the string. 10 | * 11 | * The presence of this interface indicates that obtaining access to the backing string is cheap. 12 | * 13 | * Not all AbstractBuffers can support this call, but if they can, this interface allows for it. 14 | * The buffers that are returned should ''not'' be modified or freed by the caller. 15 | */ 16 | 17 | public interface Geary.Memory.UnownedStringBuffer : Memory.Buffer { 18 | /** 19 | * Returns an unowned string version of the backing buffer. 20 | * 21 | * The returned string should not be modified or freed. 22 | */ 23 | public abstract unowned string to_unowned_string(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/client/composer/composer-application-interface.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | 9 | /** 10 | * Provides access to application objects and services to the composer. 11 | * 12 | * This interface defines the composer's requirements for integrating 13 | * with the application and enables the composer to be unit tested 14 | * without having to load the complete application. 15 | */ 16 | internal interface Composer.ApplicationInterface : 17 | GLib.Object, Application.AccountInterface { 18 | 19 | 20 | public abstract void report_problem(Geary.ProblemReport report); 21 | 22 | internal abstract async void send_composed_email(Composer.Widget composer); 23 | 24 | internal abstract async void save_composed_email(Composer.Widget composer); 25 | 26 | internal abstract async void discard_composed_email(Composer.Widget composer); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /test/engine/imap/parameter/imap-list-parameter-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | class Geary.Imap.ListParameterTest : TestCase { 9 | 10 | 11 | public ListParameterTest() { 12 | base("Geary.Imap.ListParameterTest"); 13 | add_test("add_to_multiple_parents", add_to_multiple_parents); 14 | } 15 | 16 | // See GitLab Issue #26 17 | public void add_to_multiple_parents() throws GLib.Error { 18 | ListParameter child = new ListParameter(); 19 | 20 | ListParameter parent_1 = new ListParameter(); 21 | ListParameter parent_2 = new ListParameter(); 22 | 23 | parent_1.add(child); 24 | parent_2.add(child); 25 | 26 | assert_equal(parent_1.size, 1, "Parent 1 does not contain child"); 27 | assert_equal(parent_2.size, 1, "Parent 2 does not contain child"); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/client/plugin/mail-merge/mail-merge-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | 9 | int main(string[] args) { 10 | GLib.Test.init(ref args); 11 | Geary.RFC822.init(); 12 | Geary.HTML.init(); 13 | Geary.Logging.init(); 14 | if (GLib.Test.verbose()) { 15 | GLib.Log.set_writer_func(Geary.Logging.default_log_writer); 16 | Geary.Logging.log_to(GLib.stdout); 17 | } 18 | 19 | GLib.TestSuite root = GLib.TestSuite.get_root(); 20 | root.add_suite(new MailMerge.TestReader().steal_suite()); 21 | root.add_suite(new MailMerge.TestProcessor().steal_suite()); 22 | 23 | GLib.MainLoop loop = new GLib.MainLoop(); 24 | int ret = -1; 25 | GLib.Idle.add(() => { 26 | ret = Test.run(); 27 | loop.quit(); 28 | return false; 29 | }); 30 | 31 | loop.run(); 32 | return ret; 33 | } 34 | -------------------------------------------------------------------------------- /src/engine/memory/memory-unowned-byte-array-buffer.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Interface which allows access to a backing ByteArray of {@link Memory.Buffer} without 9 | * transferring ownership, i.e. copying the ByteArray. 10 | * 11 | * The presence of this interface indicates that obtaining access to the backing buffer is cheap. 12 | * 13 | * Not all AbstractBuffers can support this call, but if they can, this interface allows for it. 14 | * The ByteArray that is returned should ''not'' be modified or freed by the caller. 15 | */ 16 | 17 | public interface Geary.Memory.UnownedByteArrayBuffer : Memory.Buffer { 18 | /** 19 | * Returns an unowned pointer to the backing ByteArray. 20 | * 21 | * The returned ByteArray should not be modified or freed. 22 | */ 23 | public abstract unowned ByteArray to_unowned_byte_array(); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-id-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * See [[http://www.ietf.org/rfc/rfc2971.txt]] 10 | */ 11 | public class Geary.Imap.IdCommand : Command { 12 | 13 | public const string NAME = "id"; 14 | 15 | public IdCommand(Gee.HashMap fields, 16 | GLib.Cancellable? should_send) { 17 | base(NAME, null, should_send); 18 | 19 | ListParameter list = new ListParameter(); 20 | foreach (string key in fields.keys) { 21 | list.add(new QuotedStringParameter(key)); 22 | list.add(new QuotedStringParameter(fields.get(key))); 23 | } 24 | 25 | this.args.add(list); 26 | } 27 | 28 | public IdCommand.nil(GLib.Cancellable? should_send) { 29 | base(NAME, null, should_send); 30 | this.args.add(NilParameter.instance); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/engine/db/db-transaction-outcome.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public enum Geary.Db.TransactionOutcome { 8 | ROLLBACK = 0, 9 | COMMIT = 1, 10 | 11 | // coarse synonyms 12 | SUCCESS = COMMIT, 13 | FAILURE = ROLLBACK, 14 | DONE = COMMIT; 15 | 16 | public unowned string sql() { 17 | switch (this) { 18 | case COMMIT: 19 | return "COMMIT TRANSACTION"; 20 | 21 | case ROLLBACK: 22 | default: 23 | return "ROLLBACK TRANSACTION"; 24 | } 25 | } 26 | 27 | public string to_string() { 28 | switch (this) { 29 | case ROLLBACK: 30 | return "rollback"; 31 | 32 | case COMMIT: 33 | return "commit"; 34 | 35 | default: 36 | return "(unknown: %d)".printf(this); 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /bindings/vapi/config.vapi: -------------------------------------------------------------------------------- 1 | /** 2 | * This VAPI describes the contents of the config.h file, which is 3 | * autogenerated by the build system. It contains the values for the specific 4 | * build configuration. 5 | */ 6 | [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] 7 | namespace Config 8 | { 9 | // Keep this list in sync with the config.h configuration_data() in meson 10 | public const string GETTEXT_PACKAGE; 11 | public const string G_LOG_DOMAIN; 12 | public const string APP_ID; 13 | public const string BUILD_ROOT_DIR; 14 | public const string GSETTINGS_DIR; 15 | public const string INSTALL_PREFIX; 16 | public const string ISO_CODE_3166_XML; 17 | public const string ISO_CODE_639_XML; 18 | public const string LANGUAGE_SUPPORT_DIRECTORY; 19 | public const string NAME_SUFFIX; 20 | public const string PLUGINS_DIR; 21 | public const string PROFILE; 22 | public const string REVNO; 23 | public const string SOURCE_ROOT_DIR; 24 | public const string VERSION; 25 | public const string WEB_EXTENSIONS_DIR; 26 | } 27 | -------------------------------------------------------------------------------- /help/C/contributing.page: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Contribute to Geary 11 | 12 |

Want to help improve Geary? There are a number of ways you can 13 | contribute:

14 | 15 | 16 |

Bug 18 | reporting—report new bugs or request new features

19 |

Translating—translate Geary’s user interface and user manual into new languages

20 |

Development—fix bugs and add new features

21 |
22 | 23 |

See the 24 | wiki for more information and options for contributing 25 | financially to Geary's development.

26 |
27 | -------------------------------------------------------------------------------- /src/engine/state/state-mapping.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public delegate uint Geary.State.Transition(uint state, uint event, void *user = null, 8 | Object? object = null, Error? err = null); 9 | 10 | public delegate void Geary.State.PostTransition(void *user = null, Object? object = null, 11 | Error? err = null); 12 | 13 | public class Geary.State.Mapping : BaseObject { 14 | public uint state; 15 | public uint event; 16 | public unowned Transition transition; 17 | 18 | public Mapping(uint state, uint event, Transition transition) { 19 | this.state = state; 20 | this.event = event; 21 | this.transition = transition; 22 | } 23 | } 24 | 25 | namespace Geary.State { 26 | 27 | // A utility Transition for nop transitions (i.e. it merely returns the state passed in). 28 | public uint nop(uint state, uint event) { 29 | return state; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/engine/app/email-store/app-copy-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.CopyOperation : Geary.App.AsyncFolderOperation { 8 | public override Type folder_type { get { return typeof(Geary.FolderSupport.Copy); } } 9 | 10 | public Geary.FolderPath destination; 11 | 12 | public CopyOperation(Geary.FolderPath destination) { 13 | this.destination = destination; 14 | } 15 | 16 | public override async Gee.Collection execute_async( 17 | Geary.Folder folder, Gee.Collection ids, 18 | Cancellable? cancellable) throws Error { 19 | Geary.FolderSupport.Copy? copy = folder as Geary.FolderSupport.Copy; 20 | assert(copy != null); 21 | 22 | yield copy.copy_email_async( 23 | Collection.copy(ids), destination, cancellable 24 | ); 25 | return ids; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/data/basic-multipart-alternative.eml: -------------------------------------------------------------------------------- 1 | From: Alice 2 | Sender: Bob 3 | To: Charlie 4 | CC: Dave 5 | BCC: Eve 6 | Reply-To: \"Alice: Personal Account\" 7 | Subject: Re: Basic text/html message 8 | Date: Fri, 21 Nov 1997 10:01:10 -0600 9 | MIME-Version: 1.0 10 | Content-Type: multipart/alternative; boundary="=-NJextDaQ1tE2ZGhW9Wm0" 11 | Message-ID: <3456@example.net> 12 | In-Reply-To: <1234@local.machine.example> 13 | References: <1234@local.machine.example> 14 | X-Mailer: Geary Test Suite 1.0 15 | 16 | --=-NJextDaQ1tE2ZGhW9Wm0 17 | Content-Type: text/plain; charset=UTF-8; format=flowed 18 | Content-Transfer-Encoding: quoted-printable 19 | 20 | This is the first line. 21 | 22 | This is the second line. 23 | 24 | = 25 | 26 | --=-NJextDaQ1tE2ZGhW9Wm0 27 | Content-Type: text/html; charset=UTF-8 28 | Content-Transfer-Encoding: quoted-printable 29 | 30 |

This is the first line. 31 | 32 |

This is the second line. 33 | 34 | = 35 | 36 | --=-NJextDaQ1tE2ZGhW9Wm0-- 37 | -------------------------------------------------------------------------------- /src/client/components/monitored-progress-bar.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Adapts a progress bar to automatically display progress of a Geary.ProgressMonitor. 9 | */ 10 | public class MonitoredProgressBar : Gtk.ProgressBar { 11 | private Geary.ProgressMonitor? monitor = null; 12 | 13 | public void set_progress_monitor(Geary.ProgressMonitor monitor) { 14 | this.monitor = monitor; 15 | monitor.start.connect(on_start); 16 | monitor.finish.connect(on_finish); 17 | monitor.update.connect(on_update); 18 | 19 | fraction = monitor.progress; 20 | } 21 | 22 | private void on_start() { 23 | fraction = 0.0; 24 | } 25 | 26 | private void on_update(double total_progress, double change, Geary.ProgressMonitor monitor) { 27 | fraction = total_progress; 28 | } 29 | 30 | private void on_finish() { 31 | fraction = 1.0; 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/engine/api/geary-named-flag.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Geary offers a couple of places where the user may mark an object (email, contact) 9 | * with a named flag. The presence of the flag indicates if the state is enabled/on 10 | * or disabled/off. 11 | */ 12 | 13 | public class Geary.NamedFlag : BaseObject, Gee.Hashable { 14 | public string name { get; private set; } 15 | 16 | public NamedFlag(string name) { 17 | this.name = name; 18 | } 19 | 20 | public bool equal_to(Geary.NamedFlag other) { 21 | if (this == other) 22 | return true; 23 | 24 | return name.down() == other.name.down(); 25 | } 26 | 27 | public uint hash() { 28 | return name.down().hash(); 29 | } 30 | 31 | public string serialise() { 32 | return name; 33 | } 34 | 35 | public string to_string() { 36 | return name; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-status-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The IMAP STATUS command. 10 | * 11 | * See [[http://tools.ietf.org/html/rfc3501#section-6.3.10]] 12 | * 13 | * @see StatusData 14 | */ 15 | public class Geary.Imap.StatusCommand : Command { 16 | 17 | 18 | public const string NAME = "STATUS"; 19 | 20 | 21 | public StatusCommand(MailboxSpecifier mailbox, 22 | StatusDataType[] data_items, 23 | GLib.Cancellable? should_send) { 24 | base(NAME, null, should_send); 25 | 26 | this.args.add(mailbox.to_parameter()); 27 | 28 | assert(data_items.length > 0); 29 | ListParameter data_item_list = new ListParameter(); 30 | foreach (StatusDataType data_item in data_items) 31 | data_item_list.add(data_item.to_parameter()); 32 | 33 | this.args.add(data_item_list); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /test/mock/mock-client-service.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017-2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Mock.ClientService : Geary.ClientService { 9 | 10 | 11 | public ClientService(Geary.AccountInformation account, 12 | Geary.ServiceInformation configuration, 13 | Geary.Endpoint remote) { 14 | base(account, configuration, remote); 15 | } 16 | 17 | public override async void start(GLib.Cancellable? cancellable = null) 18 | throws GLib.Error { 19 | throw new Geary.EngineError.UNSUPPORTED("Mock method"); 20 | } 21 | 22 | public override async void stop(GLib.Cancellable? cancellable = null) 23 | throws GLib.Error { 24 | throw new Geary.EngineError.UNSUPPORTED("Mock method"); 25 | } 26 | 27 | public override void became_reachable() { 28 | 29 | } 30 | 31 | public override void became_unreachable() { 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /test/engine/imap/command/imap-create-command-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | class Geary.Imap.CreateCommandTest : TestCase { 9 | 10 | 11 | public CreateCommandTest() { 12 | base("Geary.Imap.CreateCommandTest"); 13 | add_test("basic_create", basic_create); 14 | add_test("special_use", special_use); 15 | } 16 | 17 | public void basic_create() throws Error { 18 | assert_equal( 19 | new CreateCommand(new MailboxSpecifier("owatagusiam/"), null).to_string(), 20 | "---- create owatagusiam/" 21 | ); 22 | } 23 | 24 | public void special_use() throws Error { 25 | assert_equal( 26 | new CreateCommand.special_use( 27 | new MailboxSpecifier("Everything"), 28 | ALL_MAIL, 29 | null 30 | ).to_string(), 31 | "---- create Everything (use (\\All))" 32 | ); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/client/folder-list/folder-list-abstract-folder-entry.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Abstract base class for sidebar entries that represent folders. This covers only 9 | * the basics needed for any type of folder, and is intended to work with both local 10 | * and remote folder types. 11 | */ 12 | public abstract class FolderList.AbstractFolderEntry : Geary.BaseObject, Sidebar.Entry, Sidebar.SelectableEntry { 13 | public Geary.Folder folder { get; private set; } 14 | 15 | protected AbstractFolderEntry(Geary.Folder folder) { 16 | this.folder = folder; 17 | } 18 | 19 | public abstract string get_sidebar_name(); 20 | 21 | public abstract string? get_sidebar_tooltip(); 22 | 23 | public abstract string? get_sidebar_icon(); 24 | 25 | public abstract int get_count(); 26 | 27 | public virtual string to_string() { 28 | return "AbstractFolderEntry: " + get_sidebar_name(); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/engine/memory/memory-unowned-bytes-buffer.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Interface which allows access to backing data of {@link Memory.Buffer} without transferring 9 | * ownership, i.e. copying the buffer. 10 | * 11 | * The presence of this interface indicates that obtaining access to the backing buffer is cheap 12 | * (i.e. get_bytes().get_data() will do the same thing, but generating a Bytes object might have 13 | * a cost). 14 | * 15 | * Not all AbstractBuffers can support this call, but if they can, this interface allows for it. 16 | * The buffers that are returned should ''not'' be modified or freed by the caller. 17 | */ 18 | 19 | public interface Geary.Memory.UnownedBytesBuffer : Memory.Buffer { 20 | /** 21 | * Returns an unowned pointer of the backing buffer. 22 | * 23 | * The returned array should not be modified or freed. 24 | */ 25 | public abstract unowned uint8[] to_unowned_uint8_array(); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /test/engine/api/geary-service-information-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | class Geary.TlsNegotiationMethodTest : TestCase { 9 | 10 | 11 | public TlsNegotiationMethodTest() { 12 | base("Geary.TlsNegotiationMethodTest"); 13 | add_test("to_value", to_value); 14 | add_test("for_value", for_value); 15 | } 16 | 17 | public void to_value() throws GLib.Error { 18 | assert_equal(TlsNegotiationMethod.START_TLS.to_value(), "start-tls"); 19 | } 20 | 21 | public void for_value() throws GLib.Error { 22 | assert_equal( 23 | TlsNegotiationMethod.for_value("start-tls").to_string(), 24 | TlsNegotiationMethod.START_TLS.to_string(), 25 | "start-tls" 26 | ); 27 | assert_equal( 28 | TlsNegotiationMethod.for_value("Start-TLS").to_string(), 29 | TlsNegotiationMethod.START_TLS.to_string(), 30 | "Start-TLS" 31 | ); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/engine/smtp/smtp-error.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | 8 | /** 9 | * Thrown when an error occurs communicating with a SMTP server. 10 | */ 11 | public errordomain Geary.SmtpError { 12 | 13 | /** The client already has a connection to the server. */ 14 | ALREADY_CONNECTED, 15 | 16 | /** The credentials presented for authentication were rejected. */ 17 | AUTHENTICATION_FAILED, 18 | 19 | /** The client does not have a connection to the server. */ 20 | NOT_CONNECTED, 21 | 22 | /** The server does not support an SMTP feature required by the engine. */ 23 | NOT_SUPPORTED, 24 | 25 | /** A response from the server could not be parsed. */ 26 | PARSE_ERROR, 27 | 28 | /** A message could not be sent because a field required by SMTP was missing. */ 29 | REQUIRED_FIELD, 30 | 31 | /** The server reported an error. */ 32 | SERVER_ERROR, 33 | 34 | /** Establishing STARTTLS was attempted, but failed. */ 35 | STARTTLS_FAILED 36 | } 37 | -------------------------------------------------------------------------------- /src/client/components/monitored-spinner.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Adapts a progress spinner to automatically display progress of a Geary.ProgressMonitor. 9 | */ 10 | public class MonitoredSpinner : Gtk.Spinner { 11 | private Geary.ProgressMonitor? monitor = null; 12 | 13 | public void set_progress_monitor(Geary.ProgressMonitor? monitor) { 14 | if (monitor != null) { 15 | this.monitor = monitor; 16 | monitor.start.connect(on_start); 17 | monitor.finish.connect(on_stop); 18 | } else { 19 | this.monitor = null; 20 | stop(); 21 | hide(); 22 | } 23 | } 24 | 25 | public override void show() { 26 | if (monitor != null && monitor.is_in_progress) 27 | base.show(); 28 | } 29 | 30 | private void on_start() { 31 | start(); 32 | show(); 33 | } 34 | 35 | private void on_stop() { 36 | stop(); 37 | hide(); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-empty.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Empty interface to a {@link 10 | * Geary.Folder} indicates that it supports removing (deleting) all 11 | * email quickly. 12 | * 13 | * This generally means that the message is deleted from the server 14 | * and is not recoverable. It does ''not'' mean the messages are 15 | * moved to a Trash folder where they may or may not be automatically 16 | * deleted some time later. Users invoking empty are expecting all 17 | * contents on the remote to be removed entirely, whether or not any 18 | * or all of them have been synchronized locally. 19 | * 20 | * @see FolderSupport.Remove 21 | */ 22 | public interface Geary.FolderSupport.Empty : Folder { 23 | 24 | /** 25 | * Removes all email from the folder. 26 | */ 27 | public abstract async void 28 | empty_folder_async(GLib.Cancellable? cancellable = null) 29 | throws GLib.Error; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/engine/smtp/smtp-response.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public class Geary.Smtp.Response { 8 | public ResponseCode code { get; private set; } 9 | public ResponseLine first_line { get; private set; } 10 | public Gee.List lines { get; private set; } 11 | 12 | public Response(Gee.List lines) { 13 | assert(lines.size > 0); 14 | 15 | code = lines[0].code; 16 | first_line = lines[0]; 17 | this.lines = lines.read_only_view; 18 | } 19 | 20 | [NoReturn] 21 | public void throw_error(string msg) throws SmtpError { 22 | throw new SmtpError.SERVER_ERROR("%s: %s", msg, first_line.to_string()); 23 | } 24 | 25 | public string to_string() { 26 | StringBuilder builder = new StringBuilder(); 27 | 28 | foreach (ResponseLine line in lines) { 29 | builder.append(line.to_string()); 30 | builder.append("\n"); 31 | } 32 | 33 | return builder.str; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/client/components/components-headerbar-application.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017 Software Freedom Conservancy Inc. 3 | * Copyright © 2021 Michael Gratton 4 | * Copyright © 2022 Cédric Bellegarde 5 | * 6 | * This software is licensed under the GNU Lesser General Public License 7 | * (version 2.1 or later). See the COPYING file in this distribution. 8 | */ 9 | 10 | 11 | /** 12 | * The Application HeaderBar 13 | * 14 | * @see Application.MainWindow 15 | */ 16 | [GtkTemplate (ui = "/org/gnome/Geary/components-headerbar-application.ui")] 17 | public class Components.ApplicationHeaderBar : Hdy.HeaderBar { 18 | 19 | [GtkChild] private unowned Gtk.MenuButton app_menu_button; 20 | [GtkChild] public unowned MonitoredSpinner spinner; 21 | 22 | 23 | construct { 24 | Gtk.Builder builder = new Gtk.Builder.from_resource("/org/gnome/Geary/components-menu-application.ui"); 25 | MenuModel app_menu = (MenuModel) builder.get_object("app_menu"); 26 | 27 | this.app_menu_button.popover = new Gtk.Popover.from_model(null, app_menu); 28 | } 29 | 30 | public void show_app_menu() { 31 | this.app_menu_button.clicked(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/client/plugin/meson.build: -------------------------------------------------------------------------------- 1 | # 2 | # Builds individual plugins. The client's plugin classes themselves 3 | # are built back up the tree. 4 | # 5 | 6 | plugin_dependencies = [ 7 | config_dep, 8 | folks, 9 | gdk, 10 | client_dep, 11 | engine_dep, 12 | gee, 13 | gmime, 14 | goa, 15 | gtk, 16 | javascriptcoregtk, 17 | libhandy, 18 | libmath, 19 | libpeas, 20 | webkit2gtk, 21 | ] 22 | 23 | plugin_c_args = geary_c_args 24 | 25 | # Use .desktop.in since xgettext doesn't recognise .plugin files as 26 | # desktop files when translating them at install time. 27 | plugin_data_src_suffix = '.desktop.in' 28 | plugin_data_suffix = '.plugin' 29 | 30 | # LibPeas plugins are not using a valid .desktop keyword 31 | # Force msgfmt to translate Description 32 | msgfmt_plugin_cmd = [ 33 | find_program('msgfmt'), 34 | '--desktop', 35 | '--keyword=Name', 36 | '--keyword=Description', 37 | '-d', po_dir, 38 | '--template=@INPUT@', 39 | '--output=@OUTPUT@' 40 | ] 41 | 42 | subdir('desktop-notifications') 43 | subdir('email-templates') 44 | subdir('folder-highlight') 45 | subdir('mail-merge') 46 | subdir('messaging-menu') 47 | subdir('notification-badge') 48 | subdir('sent-sound') 49 | subdir('special-folders') 50 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-append-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A representation of the IMAP APPEND command. 10 | * 11 | * See [[http://tools.ietf.org/html/rfc3501#section-6.3.11]] 12 | */ 13 | public class Geary.Imap.AppendCommand : Command { 14 | 15 | public const string NAME = "append"; 16 | 17 | public AppendCommand(MailboxSpecifier mailbox, 18 | MessageFlags? flags, 19 | InternalDate? internal_date, 20 | Memory.Buffer message, 21 | GLib.Cancellable? should_send) { 22 | base(NAME, null, should_send); 23 | 24 | this.args.add(mailbox.to_parameter()); 25 | 26 | if (flags != null && flags.size > 0) { 27 | this.args.add(flags.to_parameter()); 28 | } 29 | 30 | if (internal_date != null) { 31 | this.args.add(internal_date.to_parameter()); 32 | } 33 | 34 | this.args.add(new LiteralParameter(message)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/engine/imap/parameter/imap-atom-parameter.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A representation of an IMAP atom. 10 | * 11 | * This class does not check if quoting is required. Use {@link DataFormat.is_quoting_required} 12 | * or {@link StringParameter.get_best_for}. 13 | * 14 | * See {@link StringParameter} for a note about class hierarchy. In particular, note that 15 | * [@link Deserializer} will not create this type of {@link Parameter} because it's unable to 16 | * deduce if a string is an atom or a string from syntax alone. 17 | * 18 | * See [[http://tools.ietf.org/html/rfc3501#section-4.1]] 19 | */ 20 | public class Geary.Imap.AtomParameter : Geary.Imap.UnquotedStringParameter { 21 | 22 | public AtomParameter(string value) { 23 | base (value); 24 | } 25 | 26 | /** 27 | * {@inheritDoc} 28 | */ 29 | public override void serialize(Serializer ser, GLib.Cancellable cancellable) 30 | throws GLib.Error { 31 | ser.push_unquoted_string(ascii); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/imap/parameter/imap-quoted-string-parameter.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A representation of an IMAP quoted string. 10 | * 11 | * This class does not check if quoting is required. Use {@link DataFormat.is_quoting_required} 12 | * or {@link StringParameter.get_best_for}. 13 | * 14 | * {@link Deserializer} will never generate this {@link Parameter}. 15 | * 16 | * See [[http://tools.ietf.org/html/rfc3501#section-4.3]]. 17 | */ 18 | public class Geary.Imap.QuotedStringParameter : Geary.Imap.StringParameter { 19 | public QuotedStringParameter(string ascii) { 20 | base (ascii); 21 | } 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public override string to_string() { 27 | return "\"%s\"".printf(ascii); 28 | } 29 | 30 | /** 31 | * {@inheritDoc} 32 | */ 33 | public override void serialize(Serializer ser, GLib.Cancellable cancellable) 34 | throws GLib.Error { 35 | ser.push_quoted_string(ascii, cancellable); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ui/single-key-shortcuts.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /* 9 | * These match Gmail's as of time of commit. Taken from: 10 | * https://support.google.com/mail/answer/6594 11 | */ 12 | @binding-set SingleKeyShortcuts { 13 | bind "r" { "reply-conversation-sender" () }; 14 | bind "a" { "reply-conversation-all" () }; 15 | bind "f" { "forward-conversation" () }; 16 | 17 | bind "i" { "mark-conversations-read" (1) }; 18 | bind "u" { "mark-conversations-read" (0) }; 19 | bind "s" { "mark-conversations-starred" (1) }; 20 | 21 | bind "l" { "show-copy-menu" () }; 22 | bind "v" { "show-move-menu" () }; 23 | 24 | bind "e" { "archive-conversations" () }; 25 | /* ! */ 26 | bind "exclam" { "junk-conversations" () }; 27 | /* # */ 28 | bind "numbersign" { "delete-conversations" () }; 29 | 30 | /* / */ 31 | bind "slash" { "find" () }; 32 | 33 | bind "k" { "navigate" (step-up) }; 34 | bind "j" { "navigate" (step-down) }; 35 | } 36 | 37 | window.geary-main-window { 38 | -gtk-key-bindings: SingleKeyShortcuts; 39 | } 40 | -------------------------------------------------------------------------------- /ui/components-menu-application.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 |
5 | 6 | _Accounts 7 | app.accounts 8 | 9 | 10 | _Preferences 11 | app.preferences 12 | 13 | 14 | _Keyboard Shortcuts 15 | win.show-help-overlay 16 | <Primary>question 17 | action-missing 18 | 19 | 20 | _Help 21 | app.help 22 | F1 23 | 24 | 25 | _About Geary 26 | app.about 27 | 28 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /src/client/components/folder-popover-row.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 Cédric Bellegarde 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | [GtkTemplate (ui = "/org/gnome/Geary/folder-popover-row.ui")] 8 | public class FolderPopoverRow : Gtk.ListBoxRow { 9 | 10 | [GtkChild] private unowned Gtk.Image image; 11 | [GtkChild] private unowned Gtk.Label label; 12 | 13 | public FolderPopoverRow(Application.FolderContext context, Gee.HashMap map) { 14 | string[] as_array = context.folder.path.as_array(); 15 | 16 | if (map.has_key(as_array[0])) { 17 | as_array[0] = map[as_array[0]]; 18 | } 19 | 20 | var i = 0; 21 | foreach (string name in as_array) { 22 | as_array[i] = GLib.Markup.escape_text(name); 23 | i += 1; 24 | } 25 | 26 | this.set_data("folder", context.folder); 27 | this.image.icon_name = context.icon_name; 28 | 29 | this.label.set_markup(string.joinv(" / ", as_array)); 30 | this.label.query_tooltip.connect(Util.Gtk.query_tooltip_label); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/client/util/util-contact.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Cédric Bellegarde 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | namespace Util.Contact { 9 | 10 | /** 11 | * Returns true if loading images for contact is allowed 12 | */ 13 | public bool should_load_images(Application.Contact contact, Application.Configuration config) { 14 | var email_addresses = contact.email_addresses; 15 | var domains = config.get_images_trusted_domains(); 16 | if (contact == null) { 17 | return false; 18 | // Contact trusted 19 | } else if (contact.load_remote_resources) { 20 | return true; 21 | // All emails are trusted 22 | } else if (domains.length > 0 && domains[0] == "*") { 23 | return true; 24 | // Contact domain trusted 25 | } else { 26 | foreach (Geary.RFC822.MailboxAddress email in email_addresses) { 27 | if (email.domain in domains) { 28 | return true; 29 | } 30 | } 31 | } 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/app/email-store/app-mark-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.MarkOperation : Geary.App.AsyncFolderOperation { 8 | public override Type folder_type { get { return typeof(Geary.FolderSupport.Mark); } } 9 | 10 | public Geary.EmailFlags? flags_to_add; 11 | public Geary.EmailFlags? flags_to_remove; 12 | 13 | public MarkOperation(Geary.EmailFlags? flags_to_add, Geary.EmailFlags? flags_to_remove) { 14 | this.flags_to_add = flags_to_add; 15 | this.flags_to_remove = flags_to_remove; 16 | } 17 | 18 | public override async Gee.Collection execute_async( 19 | Geary.Folder folder, Gee.Collection ids, 20 | Cancellable? cancellable) throws Error { 21 | Geary.FolderSupport.Mark? mark = folder as Geary.FolderSupport.Mark; 22 | assert(mark != null); 23 | 24 | yield mark.mark_email_async( 25 | Collection.copy(ids), flags_to_add, flags_to_remove, cancellable 26 | ); 27 | return ids; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-copy.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Copy interface to a {@link 10 | * Geary.Folder} indicates it supports a copy email operation. 11 | * 12 | * A copied email will not be removed from the current folder but will 13 | * appear in the destination. 14 | * 15 | * Copy does not imply {@link Geary.FolderSupport.Move}, or 16 | * vice-versa. 17 | */ 18 | public interface Geary.FolderSupport.Copy : Folder { 19 | 20 | /** 21 | * Copies messages into another folder. 22 | * 23 | * If the destination is this {@link Folder}, the operation will 24 | * not make a copy of the message but will return success. 25 | * 26 | * This folder must be opened prior to attempting this operation. 27 | */ 28 | public abstract async void 29 | copy_email_async(Gee.Collection to_copy, 30 | FolderPath destination, 31 | GLib.Cancellable? cancellable = null) 32 | throws GLib.Error; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/db/db-transaction-type.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public enum Geary.Db.TransactionType { 8 | DEFERRED, 9 | IMMEDIATE, 10 | EXCLUSIVE, 11 | 12 | // coarse synonyms 13 | RO = DEFERRED, 14 | RW = IMMEDIATE, 15 | WR = EXCLUSIVE, 16 | WO = EXCLUSIVE; 17 | 18 | public unowned string sql() { 19 | switch (this) { 20 | case IMMEDIATE: 21 | return "BEGIN IMMEDIATE"; 22 | 23 | case EXCLUSIVE: 24 | return "BEGIN EXCLUSIVE"; 25 | 26 | case DEFERRED: 27 | default: 28 | return "BEGIN DEFERRED"; 29 | } 30 | } 31 | 32 | public string to_string() { 33 | switch (this) { 34 | case DEFERRED: 35 | return "DEFERRED"; 36 | 37 | case IMMEDIATE: 38 | return "IMMEDIATE"; 39 | 40 | case EXCLUSIVE: 41 | return "EXCLUSIVE"; 42 | 43 | default: 44 | return "(unknown: %d)".printf(this); 45 | } 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /test/test-case.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** Base class for Geary unit tests. */ 9 | public class TestCase : ValaUnit.TestCase { 10 | 11 | /** GLib.File URI for resources in test/data. */ 12 | public const string RESOURCE_URI = "resource:///org/gnome/GearyTest"; 13 | 14 | 15 | public TestCase(string name) { 16 | base(name); 17 | } 18 | 19 | public void delete_file(File parent) throws GLib.Error { 20 | FileInfo info = parent.query_info( 21 | "standard::*", 22 | FileQueryInfoFlags.NOFOLLOW_SYMLINKS 23 | ); 24 | 25 | if (info.get_file_type () == FileType.DIRECTORY) { 26 | FileEnumerator enumerator = parent.enumerate_children( 27 | "standard::*", 28 | FileQueryInfoFlags.NOFOLLOW_SYMLINKS 29 | ); 30 | 31 | info = null; 32 | while (((info = enumerator.next_file()) != null)) { 33 | delete_file(parent.get_child(info.get_name())); 34 | } 35 | } 36 | 37 | parent.delete(); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/engine/app/email-store/app-list-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.ListOperation : Geary.App.AsyncFolderOperation { 8 | public override Type folder_type { get { return typeof(Geary.Folder); } } 9 | 10 | public Gee.HashSet results; 11 | public Geary.Email.Field required_fields; 12 | public Geary.Folder.ListFlags flags; 13 | 14 | public ListOperation(Geary.Email.Field required_fields, Geary.Folder.ListFlags flags) { 15 | results = new Gee.HashSet(); 16 | this.required_fields = required_fields; 17 | this.flags = flags; 18 | } 19 | 20 | public override async Gee.Collection execute_async( 21 | Geary.Folder folder, Gee.Collection ids, 22 | Cancellable? cancellable) throws Error { 23 | Gee.List? list = yield folder.list_email_by_sparse_id_async( 24 | ids, required_fields, flags, cancellable); 25 | if (list != null) 26 | results.add_all(list); 27 | return ids; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/engine/imap-engine/imap-engine-send-replay-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | 8 | /** 9 | * A replay operation for a user-initiated operation. 10 | */ 11 | private abstract class Geary.ImapEngine.SendReplayOperation : Geary.ImapEngine.ReplayOperation { 12 | protected SendReplayOperation(string name, ReplayOperation.OnError on_remote_error = OnError.THROW) { 13 | base (name, ReplayOperation.Scope.LOCAL_AND_REMOTE, on_remote_error); 14 | } 15 | 16 | protected SendReplayOperation.only_local(string name, ReplayOperation.OnError on_remote_error = OnError.THROW) { 17 | base (name, ReplayOperation.Scope.LOCAL_ONLY, on_remote_error); 18 | } 19 | 20 | protected SendReplayOperation.only_remote(string name, ReplayOperation.OnError on_remote_error = OnError.THROW) { 21 | base (name, ReplayOperation.Scope.REMOTE_ONLY, on_remote_error); 22 | } 23 | 24 | public override void notify_remote_removed_position(Imap.SequenceNumber removed) { 25 | // we've worked very hard to keep positional addressing out of the SendReplayOperations 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/engine/imap-engine/gmail/imap-engine-gmail-spam-trash-folder.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * Gmail's Spam and Trash folders support basic operations and 10 | * removing messages with a traditional IMAP STORE/EXPUNGE operation. 11 | */ 12 | private class Geary.ImapEngine.GmailSpamTrashFolder : 13 | MinimalFolder, 14 | FolderSupport.Remove, 15 | FolderSupport.Empty { 16 | 17 | public GmailSpamTrashFolder(GmailAccount account, 18 | ImapDB.Folder local_folder, 19 | Folder.SpecialUse use) { 20 | base(account, local_folder, use); 21 | } 22 | 23 | public async void 24 | remove_email_async(Gee.Collection email_ids, 25 | GLib.Cancellable? cancellable = null) 26 | throws GLib.Error { 27 | yield expunge_email_async(email_ids, cancellable); 28 | } 29 | 30 | public async void empty_folder_async(Cancellable? cancellable = null) 31 | throws Error { 32 | yield expunge_all_async(cancellable); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /test/mock/mock-email-identifier.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Mock.EmailIdentifer : Geary.EmailIdentifier { 9 | 10 | 11 | private int id; 12 | 13 | 14 | public EmailIdentifer(int id) { 15 | this.id = id; 16 | } 17 | 18 | public override uint hash() { 19 | return GLib.int_hash(this.id); 20 | } 21 | 22 | public override bool equal_to(Geary.EmailIdentifier other) { 23 | return ( 24 | this.get_type() == other.get_type() && 25 | this.id == ((EmailIdentifer) other).id 26 | ); 27 | } 28 | 29 | 30 | public override string to_string() { 31 | return "%s(%d)".printf( 32 | this.get_type().name(), 33 | this.id 34 | ); 35 | } 36 | 37 | public override GLib.Variant to_variant() { 38 | return new GLib.Variant.int32(id); 39 | } 40 | 41 | public override int natural_sort_comparator(Geary.EmailIdentifier other) { 42 | EmailIdentifer? other_mock = other as EmailIdentifer; 43 | return (other_mock == null) ? 1 : this.id - other_mock.id; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/engine/app/email-store/app-fetch-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.FetchOperation : Geary.App.AsyncFolderOperation { 8 | public override Type folder_type { get { return typeof(Geary.Folder); } } 9 | 10 | public Geary.Email? result = null; 11 | public Geary.Email.Field required_fields; 12 | public Geary.Folder.ListFlags flags; 13 | 14 | public FetchOperation(Geary.Email.Field required_fields, Geary.Folder.ListFlags flags) { 15 | this.required_fields = required_fields; 16 | this.flags = flags; 17 | } 18 | 19 | public override async Gee.Collection execute_async( 20 | Geary.Folder folder, Gee.Collection ids, 21 | Cancellable? cancellable) throws Error { 22 | assert(result == null); 23 | Geary.EmailIdentifier? id = Collection.first(ids); 24 | assert(id != null); 25 | 26 | result = yield folder.fetch_email_async( 27 | id, required_fields, flags, cancellable); 28 | return Geary.iterate(id).to_array_list(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/engine/smtp/smtp-login-authenticator.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * SASL's LOGIN authentication schema implemented as an {@link Authenticator}. 9 | * 10 | * LOGIN is obsolete but still widely in use and provided for backward compatibility. 11 | * 12 | * See [[https://tools.ietf.org/html/draft-murchison-sasl-login-00]] 13 | */ 14 | 15 | public class Geary.Smtp.LoginAuthenticator : Geary.Smtp.Authenticator { 16 | public LoginAuthenticator(Credentials credentials) { 17 | base ("LOGIN", credentials); 18 | } 19 | 20 | public override Request initiate() { 21 | return new Request(Command.AUTH, { "login" }); 22 | } 23 | 24 | public override Memory.Buffer? challenge(int step, Response response) throws SmtpError { 25 | switch (step) { 26 | case 0: 27 | return new Memory.StringBuffer(Base64.encode(credentials.user.data)); 28 | 29 | case 1: 30 | return new Memory.StringBuffer(Base64.encode((credentials.token ?? "").data)); 31 | 32 | default: 33 | return null; 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/engine/imap-engine/other/imap-engine-other-account.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2019 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | private class Geary.ImapEngine.OtherAccount : Geary.ImapEngine.GenericAccount { 10 | 11 | public OtherAccount(AccountInformation config, 12 | ImapDB.Account local, 13 | Endpoint incoming_remote, 14 | Endpoint outgoing_remote) { 15 | base(config, local, incoming_remote, outgoing_remote); 16 | } 17 | 18 | protected override MinimalFolder new_folder(ImapDB.Folder local_folder) { 19 | FolderPath path = local_folder.get_path(); 20 | Folder.SpecialUse use = NONE; 21 | if (Imap.MailboxSpecifier.folder_path_is_inbox(path)) { 22 | use = INBOX; 23 | } else { 24 | use = local_folder.get_properties().attrs.get_special_use(); 25 | // There can be only one Inbox 26 | if (use == INBOX) { 27 | use = NONE; 28 | } 29 | } 30 | 31 | return new OtherFolder(this, local_folder, use); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-move.vala: -------------------------------------------------------------------------------- 1 | /* 2 | *Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Move interface indicates 10 | * that the {@link Geary.Folder} supports a move email operation. 11 | * Moved messages are removed from this Folder. 12 | * 13 | * Move does not imply {@link Geary.FolderSupport.Copy}, or 14 | * vice-versa. 15 | */ 16 | public interface Geary.FolderSupport.Move : Folder { 17 | 18 | /** 19 | * Moves messages to another folder. 20 | * 21 | * If the destination is this {@link Folder}, the operation will 22 | * not move the message in any way but will return success. 23 | * 24 | * This folder must be opened prior to attempting this operation. 25 | * 26 | * @return A {@link Geary.Revokable} that may be used to revoke 27 | * (undo) this operation later. 28 | */ 29 | public abstract async Revokable? 30 | move_email_async(Gee.Collection to_move, 31 | FolderPath destination, 32 | GLib.Cancellable? cancellable = null) 33 | throws GLib.Error; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /help/C/star.page: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Star a message or mark it as read/unread 11 |
12 | Star messages 13 |

You can star messages to indicate that they're important to you. 14 | To mark a conversation with a star, click its star icon in the conversation list. You can star an individual message by clicking the star at the upper right of the message itself.

15 |

With Gmail accounts, starred messages appear in the Starred folder in the folder list.

16 |
17 |
18 | Mark messages as read or unread 19 |

Geary marks messages as read automatically as you read them. 20 | To manually toggle a conversation as read or unread, click the circle icon in the conversation list.

21 | 22 |

Alternately, the Mark as Unread in the Mark menu on the toolbar can 23 | be used to toggle the read status of the selected conversation(s).

24 | 25 |

To mark an individual message as read, select Mark as Read from the dropdown menu.

26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /ui/components-menu-conversation.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mark as _Read 6 | win.mark-conversation-read 7 | action-disabled 8 | 9 | 10 | Mark as _Unread 11 | win.mark-conversation-unread 12 | action-disabled 13 | 14 | 15 | _Star 16 | win.mark-conversation-starred 17 | action-disabled 18 | 19 | 20 | U_nstar 21 | win.mark-conversation-unstarred 22 | action-disabled 23 | 24 | 25 | Toggle as _Junk 26 | win.toggle-conversation-junk 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/client/components/stock.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * With GtkStock deprecated in GTK+ 3.10, these strings offer replacements for commonly-needed 9 | * text labels. 10 | * 11 | * Plain text use all-caps constant names and an underscore indicating where in the English text the 12 | * mnemonic lies. This can be used to ensure that the mnemonic doesn't interfere with other custom 13 | * strings in the grouping. 14 | */ 15 | 16 | namespace Stock { 17 | 18 | public const string _OK = _("_OK"); 19 | public const string _CANCEL = _("_Cancel"); 20 | 21 | public const string _ABOUT = _("_About"); 22 | public const string _ADD = _("_Add"); 23 | public const string _CLOSE = _("_Close"); 24 | public const string _DISCARD = _("_Discard"); 25 | public const string _HELP = _("_Help"); 26 | public const string _OPEN_BUTTON = _("_Open"); 27 | public const string _PREFERENCES = _("_Preferences"); 28 | public const string _PRINT_MENU = _("_Print…"); 29 | public const string _QUIT = _("_Quit"); 30 | public const string _REMOVE = _("_Remove"); 31 | public const string _SAVE = _("_Save"); 32 | public const string _KEEP = _("_Keep"); 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/client/util/util-files.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | namespace Files { 8 | 9 | public const int64 KILOBYTE = 1024; 10 | public const int64 MEGABYTE = KILOBYTE * 1024; 11 | public const int64 GIGABYTE = MEGABYTE * 1024; 12 | public const int64 TERABYTE = GIGABYTE * 1024; 13 | 14 | public string get_filesize_as_string(int64 filesize) { 15 | int64 scale = 1; 16 | string units = _("bytes"); 17 | if (filesize > TERABYTE) { 18 | scale = TERABYTE; 19 | units = C_("Abbreviation for terabyte", "TB"); 20 | } else if (filesize > GIGABYTE) { 21 | scale = GIGABYTE; 22 | units = C_("Abbreviation for gigabyte", "GB"); 23 | } else if (filesize > MEGABYTE) { 24 | scale = MEGABYTE; 25 | units = C_("Abbreviation for megabyte", "MB"); 26 | } else if (filesize > KILOBYTE) { 27 | scale = KILOBYTE; 28 | units = C_("Abbreviation for kilobyte", "KB"); 29 | } 30 | 31 | if (scale == 1) { 32 | return "%s %s".printf(filesize.to_string(), units); 33 | } else { 34 | return "%.2f %s".printf((float) filesize / (float) scale, units); 35 | } 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /test/client/application/application-configuration-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Application.ConfigurationTest : TestCase { 9 | 10 | private Configuration test_config = null; 11 | 12 | public ConfigurationTest() { 13 | base("ConfigurationTest"); 14 | add_test("desktop_environment", desktop_environment); 15 | } 16 | 17 | public override void set_up() { 18 | Environment.unset_variable("XDG_CURRENT_DESKTOP"); 19 | this.test_config = new Configuration(Client.SCHEMA_ID); 20 | } 21 | 22 | public void desktop_environment() throws Error { 23 | assert(this.test_config.desktop_environment == 24 | Configuration.DesktopEnvironment.UNKNOWN); 25 | 26 | Environment.set_variable("XDG_CURRENT_DESKTOP", "BLARG", true); 27 | assert(this.test_config.desktop_environment == 28 | Configuration.DesktopEnvironment.UNKNOWN); 29 | 30 | Environment.set_variable("XDG_CURRENT_DESKTOP", "Unity", true); 31 | assert(this.test_config.desktop_environment == 32 | Configuration.DesktopEnvironment.UNITY); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /test/client/components/components-web-view-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | public class Components.WebViewTest : TestCase { 9 | 10 | public WebViewTest() { 11 | base("Components.WebViewTest"); 12 | add_test("init_web_context", init_web_context); 13 | add_test("load_resources", load_resources); 14 | } 15 | 16 | public void init_web_context() throws Error { 17 | Application.Configuration config = new Application.Configuration( 18 | Application.Client.SCHEMA_ID 19 | ); 20 | config.enable_debug = true; 21 | WebView.init_web_context( 22 | config, 23 | File.new_for_path(Config.BUILD_ROOT_DIR).get_child("src"), 24 | File.new_for_path("/tmp"), // XXX use something better here 25 | false // https://bugs.webkit.org/show_bug.cgi?id=213174 26 | ); 27 | } 28 | 29 | public void load_resources() throws GLib.Error { 30 | try { 31 | WebView.load_resources(GLib.File.new_for_path("/tmp")); 32 | } catch (GLib.Error err) { 33 | assert_not_reached(); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-archive.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of this interface to {@link Geary.Folder} indicates 10 | * that it supports an archive operation (which may or may not be in 11 | * addition to a remove operation via {@link 12 | * Geary.FolderSupport.Remove}). 13 | * 14 | * An archive operation acts like remove except that the mail is still 15 | * available on the server, usually in an All Mail folder and perhaps 16 | * others. It does not imply that the mail message was moved to the 17 | * Trash folder. 18 | */ 19 | public interface Geary.FolderSupport.Archive : Folder { 20 | 21 | /** 22 | * Archives the specified emails from the folder. 23 | * 24 | * This folder must be opened prior to attempting this operation. 25 | * 26 | * @return A {@link Geary.Revokable} that may be used to revoke 27 | * (undo) this operation later. 28 | */ 29 | public abstract async Revokable? 30 | archive_email_async(Gee.Collection email_ids, 31 | GLib.Cancellable? cancellable = null) 32 | throws GLib.Error; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/mime/mime-data-format.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Utility methods for manipulating and examining data particular to MIME. 9 | */ 10 | 11 | namespace Geary.Mime.DataFormat { 12 | 13 | private const char[] CONTENT_TYPE_TOKEN_SPECIALS = { 14 | '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=' 15 | }; 16 | 17 | public enum Encoding { 18 | QUOTING_REQUIRED, 19 | QUOTING_OPTIONAL, 20 | UNALLOWED 21 | } 22 | 23 | public Encoding get_encoding_requirement(string str) { 24 | if (String.is_empty(str)) 25 | return Encoding.QUOTING_REQUIRED; 26 | 27 | Encoding encoding = Encoding.QUOTING_OPTIONAL; 28 | int index = 0; 29 | for (;;) { 30 | char ch = str[index++]; 31 | if (ch == String.EOS) 32 | break; 33 | 34 | if (ch.iscntrl()) 35 | return Encoding.UNALLOWED; 36 | 37 | // don't return immediately, it's possible unallowed characters may still be ahead 38 | if (ch.isspace() || ch in CONTENT_TYPE_TOKEN_SPECIALS) 39 | encoding = Encoding.QUOTING_REQUIRED; 40 | } 41 | 42 | return encoding; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-search-command.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A representation of the IMAP SEARCH command. 10 | * 11 | * See [[http://tools.ietf.org/html/rfc3501#section-6.4.4]]. 12 | */ 13 | public class Geary.Imap.SearchCommand : Command { 14 | 15 | public const string NAME = "search"; 16 | public const string UID_NAME = "uid search"; 17 | 18 | public SearchCommand(SearchCriteria criteria, 19 | GLib.Cancellable? should_send) { 20 | base(NAME, null, should_send); 21 | 22 | // Extend rather than append the criteria, so the top-level 23 | // criterion appear in the top-level list and not as a child 24 | // list 25 | this.args.extend(criteria); 26 | } 27 | 28 | public SearchCommand.uid(SearchCriteria criteria, 29 | GLib.Cancellable? should_send) { 30 | base(UID_NAME, null, should_send); 31 | 32 | // Extend rather than append the criteria, so the top-level 33 | // criterion appear in the top-level list and not as a child 34 | // list 35 | this.args.extend(criteria); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/client/folder-list/folder-list-inbox-folder-entry.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | // A FolderEntry for inboxes in the Inboxes branch. 8 | public class FolderList.InboxFolderEntry : FolderList.FolderEntry { 9 | 10 | 11 | private string display_name = ""; 12 | 13 | 14 | public InboxFolderEntry(Application.FolderContext context) { 15 | base(context); 16 | this.display_name = context.folder.account.information.display_name; 17 | context.folder.account.information.changed.connect(on_information_changed); 18 | } 19 | 20 | ~InboxFolderEntry() { 21 | folder.account.information.changed.disconnect(on_information_changed); 22 | } 23 | 24 | public override string get_sidebar_name() { 25 | return this.display_name; 26 | } 27 | 28 | public Geary.AccountInformation get_account_information() { 29 | return folder.account.information; 30 | } 31 | 32 | private void on_information_changed(Geary.AccountInformation config) { 33 | if (this.display_name != config.display_name) { 34 | this.display_name = config.display_name; 35 | entry_changed(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/engine/imap/api/imap-folder.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2018 Michael Gratton . 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | /** 10 | * Represents a mailbox on an IMAP server. 11 | * 12 | * Everything we can glean from an IMAP LIST for a specific folder is 13 | * encapsulated here. Any information requires the folder to be 14 | * selected, and hence there is no other information about 15 | * non-selectable folders that can be obtained. 16 | * 17 | * Note the mailbox name is not represented since that may differ 18 | * based on the client session being used to connect to the server. 19 | */ 20 | internal class Geary.Imap.Folder : Geary.BaseObject { 21 | 22 | /** The full path to this folder. */ 23 | public FolderPath path { get; private set; } 24 | 25 | /** IMAP properties reported by the server. */ 26 | public Imap.FolderProperties properties { get; private set; } 27 | 28 | 29 | internal Folder(FolderPath path, Imap.FolderProperties properties) { 30 | this.path = path; 31 | this.properties = properties; 32 | } 33 | 34 | public string to_string() { 35 | return "Imap.Folder(%s)".printf(path.to_string()); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/client/composer/composer-container.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * A generic interface for widgets that have a single composer child. 9 | */ 10 | public interface Composer.Container { 11 | 12 | /** The top-level window for the container, if any. */ 13 | public abstract Gtk.ApplicationWindow? top_window { get; } 14 | 15 | /** The container's current composer, if any. */ 16 | internal abstract Widget composer { get; set; } 17 | 18 | /** Causes the composer's top-level window to be presented. */ 19 | public virtual void present() { 20 | Gtk.ApplicationWindow top = top_window; 21 | if (top != null) { 22 | top.present(); 23 | } 24 | } 25 | 26 | /** Returns the top-level window's current focus widget, if any. */ 27 | public virtual Gtk.Widget? get_focus() { 28 | Gtk.Widget? focus = null; 29 | Gtk.ApplicationWindow top = top_window; 30 | if (top != null) { 31 | focus = top.get_focus(); 32 | } 33 | return focus; 34 | } 35 | 36 | /** 37 | * Removes the composer and destroys the container. 38 | */ 39 | public abstract void close(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-trusted-extension.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A plugin extension point for trusted plugins. 10 | * 11 | * In-tree plugins may implement this interface if they require access 12 | * to the client application's internal machinery. 13 | * 14 | * Since the client application and engine objects have no API 15 | * stability guarantee, Geary will refuse to load out-of-tree plugins 16 | * that implement this extension point. 17 | */ 18 | public interface Plugin.TrustedExtension : PluginBase { 19 | 20 | /** 21 | * Client application object. 22 | * 23 | * This will be set during (or just after) plugin construction, 24 | * before {@link PluginBase.activate} is called. 25 | */ 26 | public abstract global::Application.Client client_application { 27 | get; set construct; 28 | } 29 | 30 | /** 31 | * Client plugin manager object. 32 | * 33 | * This will be set during (or just after) plugin construction, 34 | * before {@link PluginBase.activate} is called. 35 | */ 36 | public abstract global::Application.PluginManager client_plugins { 37 | get; set construct; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/engine/imap/command/imap-list-return-parameter.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * RETURN parameters for {@link ListCommand}. 9 | * 10 | * LIST's extended syntax allows for special RETURN parameters to be included indicating additional 11 | * information for the server to return as part of the LIST results. ListReturnParameters allows 12 | * for the well-known parameters to be easily generated and added to ListCommand. 13 | * 14 | * See the LIST-STATUS ([[https://tools.ietf.org/html/rfc5819]]) and SPECIAL-USE 15 | * ([[https://tools.ietf.org/html/rfc6154]]) RFCs for examples of this in use. 16 | */ 17 | 18 | public class Geary.Imap.ListReturnParameter : ListParameter { 19 | /** 20 | * See [[https://tools.ietf.org/html/rfc6154]] 21 | */ 22 | public const string SPECIAL_USE = "special-use"; 23 | 24 | /** 25 | * Creates an empty {@link ListReturnParameter}. 26 | * 27 | * If passed in without additions, this will be ignored by {@link ListCommand}. 28 | */ 29 | public ListReturnParameter() { 30 | } 31 | 32 | public void add_special_use() { 33 | add(StringParameter.get_best_for_unchecked(SPECIAL_USE)); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/engine/app/conversation-monitor/app-external-append-operation.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2019 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | private class Geary.App.ExternalAppendOperation : BatchOperation { 10 | 11 | 12 | private Geary.Folder folder; 13 | 14 | 15 | public ExternalAppendOperation(ConversationMonitor monitor, 16 | Geary.Folder folder, 17 | Gee.Collection appended_ids) { 18 | base(monitor, appended_ids); 19 | this.folder = folder; 20 | } 21 | 22 | public override async void execute_batch(Gee.Collection batch) 23 | throws GLib.Error { 24 | if (!this.monitor.get_search_folder_blacklist().contains(folder.path) && 25 | !this.monitor.conversations.is_empty) { 26 | debug("Appending %d out of folder message(s) to %s", 27 | batch.size, 28 | this.folder.to_string()); 29 | 30 | yield this.monitor.external_load_by_sparse_id( 31 | this.folder, batch, Geary.Folder.ListFlags.NONE 32 | ); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/engine/imap/parameter/imap-unquoted-string-parameter.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A representation of an IMAP string that is not quoted. 10 | * 11 | * This class does not check if quoting is required. Use {@link DataFormat.is_quoting_required} 12 | * or {@link StringParameter.get_best_for}. 13 | * 14 | * The difference between this class and {@link AtomParameter} is that this can be used in any 15 | * circumstance where a string can (or is) represented without quotes or literal data, whereas an 16 | * atom has strict definitions about where it's found. 17 | * 18 | * See [[http://tools.ietf.org/html/rfc3501#section-4.1]] 19 | */ 20 | public class Geary.Imap.UnquotedStringParameter : Geary.Imap.StringParameter { 21 | 22 | public UnquotedStringParameter(string ascii) { 23 | base (ascii); 24 | } 25 | 26 | /** 27 | * {@inheritDoc} 28 | */ 29 | public override void serialize(Serializer ser, GLib.Cancellable cancellable) 30 | throws GLib.Error { 31 | ser.push_unquoted_string(ascii, cancellable); 32 | } 33 | 34 | /** 35 | * {@inheritDoc} 36 | */ 37 | public override string to_string() { 38 | return ascii; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /icons/edit-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | Gnome Symbolic Icon Theme 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | Gnome Symbolic Icon Theme 25 | 26 | 27 | 28 | 32 | 33 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-contact-store.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * Provides plugins with access to contact information. 10 | * 11 | * Plugins may obtain instances of this object from their context 12 | * objects, for example {@link 13 | * NotificationContext.get_contacts_for_folder}. 14 | */ 15 | public interface Plugin.ContactStore : Geary.BaseObject { 16 | 17 | 18 | /** Searches for contacts based on a specific string */ 19 | public abstract async Gee.Collection search( 20 | string query, 21 | uint min_importance, 22 | uint limit, 23 | GLib.Cancellable? cancellable 24 | ) throws GLib.Error; 25 | 26 | 27 | /** 28 | * Returns a contact for a specific mailbox. 29 | * 30 | * Returns a contact that has the given mailbox address listed as 31 | * a primary or secondary email. A contact will always be 32 | * returned, so if no matching contact already exists a new, 33 | * non-persistent contact will be returned. 34 | */ 35 | public abstract async global::Application.Contact load( 36 | Geary.RFC822.MailboxAddress mailbox, 37 | GLib.Cancellable? cancellable 38 | ) throws GLib.Error; 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /ui/composer-web-view.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2017 Michael Gratton 4 | */ 5 | 6 | body { 7 | margin: 0 !important; 8 | border: 0 !important; 9 | padding: 0 !important; 10 | font-size: medium !important; 11 | } 12 | 13 | body.plain, body.plain * { 14 | font-family: monospace !important; 15 | font-weight: normal; 16 | font-style: normal; 17 | font-size: medium !important; 18 | color: var(--fg-color) !important; 19 | background-color: var(--bg-color) !important; 20 | text-decoration: none; 21 | } 22 | 23 | body.plain a { 24 | cursor: text; 25 | } 26 | 27 | body > *.geary-no-display { 28 | display: none !important; 29 | } 30 | 31 | body > div#geary-body { 32 | margin: 0 !important; 33 | border: 0 !important; 34 | padding: 12px !important; 35 | outline: 0px !important; 36 | } 37 | 38 | body > div#geary-signature, 39 | body > div#geary-quote { 40 | margin: 0 6px !important; 41 | border: 0 !important; 42 | padding: 6px !important; 43 | } 44 | 45 | body > div:focus-within { 46 | background-color: white; 47 | } 48 | 49 | body > div#geary-signature:focus-within, 50 | body > div#geary-quote:focus-within { 51 | outline: 1px dashed #ccc !important; 52 | } 53 | 54 | blockquote { 55 | margin: 0 10px; 56 | border: 0; 57 | border-left: 3px #aaa solid; 58 | padding: 0 5px; 59 | } 60 | 61 | pre { 62 | white-space: break-spaces; 63 | margin: 0; 64 | } 65 | -------------------------------------------------------------------------------- /ui/components-headerbar-application.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 36 | 37 | -------------------------------------------------------------------------------- /src/engine/api/geary-email-properties.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * EmailProperties holds (in general) immutable metadata about an Email. EmailFlags used to be 9 | * held here and retrieved via Email.Field.PROPERTIES, but as they're mutable, they were broken out 10 | * for efficiency reasons. 11 | * 12 | * EmailProperties may be expanded in the future to supply details like when the message was added 13 | * to the local store, checksums, and so forth. 14 | */ 15 | 16 | public abstract class Geary.EmailProperties : BaseObject { 17 | /** 18 | * date_received may be the date/time received on the server or in the local store, depending 19 | * on whether the information is available on the server. For example, with IMAP, this is 20 | * the INTERNALDATE supplied by the server. 21 | */ 22 | public DateTime date_received { get; protected set; } 23 | 24 | /** 25 | * Total size of the email (header and body) in bytes. 26 | */ 27 | public int64 total_bytes { get; protected set; } 28 | 29 | protected EmailProperties(DateTime date_received, int64 total_bytes) { 30 | this.date_received = date_received; 31 | this.total_bytes = total_bytes; 32 | } 33 | 34 | public abstract string to_string(); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/engine/app/conversation-monitor/app-local-search-operation.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | private class Geary.App.LocalSearchOperation : Geary.Nonblocking.BatchOperation { 8 | // IN 9 | public Geary.Account account; 10 | public RFC822.MessageID message_id; 11 | public Geary.Email.Field required_fields; 12 | public Gee.Collection? blacklist; 13 | public Geary.EmailFlags? flag_blacklist; 14 | 15 | // OUT 16 | public Gee.MultiMap? emails = null; 17 | 18 | public LocalSearchOperation(Geary.Account account, RFC822.MessageID message_id, 19 | Geary.Email.Field required_fields, Gee.Collection blacklist, 20 | Geary.EmailFlags? flag_blacklist) { 21 | this.account = account; 22 | this.message_id = message_id; 23 | this.required_fields = required_fields; 24 | this.blacklist = blacklist; 25 | this.flag_blacklist = flag_blacklist; 26 | } 27 | 28 | public override async Object? execute_async(Cancellable? cancellable) throws Error { 29 | emails = yield account.local_search_message_id_async(message_id, required_fields, 30 | false, blacklist, flag_blacklist); 31 | 32 | return null; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/smtp/smtp-plain-authenticator.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * SASL's PLAIN authentication schema implemented as an {@link Authenticator}. 9 | * 10 | * See [[http://tools.ietf.org/html/rfc4616]] 11 | */ 12 | 13 | public class Geary.Smtp.PlainAuthenticator : Geary.Smtp.Authenticator { 14 | private static uint8[] nul = { '\0' }; 15 | 16 | public PlainAuthenticator(Credentials credentials) { 17 | base ("PLAIN", credentials); 18 | } 19 | 20 | public override Request initiate() { 21 | return new Request(Command.AUTH, { "PLAIN" }); 22 | } 23 | 24 | public override Memory.Buffer? challenge(int step, Response response) throws SmtpError { 25 | // only a single challenge is issued in PLAIN 26 | if (step > 0) 27 | return null; 28 | 29 | Memory.GrowableBuffer growable = new Memory.GrowableBuffer(); 30 | // skip the "authorize" field, which we don't support 31 | growable.append(nul); 32 | growable.append(credentials.user.data); 33 | growable.append(nul); 34 | growable.append((credentials.token ?? "").data); 35 | 36 | // convert to Base64 37 | return new Memory.StringBuffer(Base64.encode(growable.get_bytes().get_data())); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/engine/smtp/smtp-capabilities.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public class Geary.Smtp.Capabilities : Geary.GenericCapabilities { 8 | 9 | public const string STARTTLS = "starttls"; 10 | public const string AUTH = "auth"; 11 | 12 | public const string AUTH_PLAIN = "plain"; 13 | public const string AUTH_LOGIN = "login"; 14 | public const string AUTH_OAUTH2 = "xoauth2"; 15 | public const string 8BITMIME = "8bitmime"; 16 | 17 | public const string NAME_SEPARATOR = " "; 18 | public const string VALUE_SEPARATOR = " "; 19 | 20 | public Capabilities() { 21 | base (NAME_SEPARATOR, VALUE_SEPARATOR); 22 | } 23 | 24 | /** 25 | * Returns number of response lines added. 26 | */ 27 | public int add_ehlo_response(Response response) { 28 | // First line in response is server information, not capabilities 29 | int count = 0; 30 | for (int ctr = 1; ctr < response.lines.size; ctr++) { 31 | if (add_response_line(response.lines[ctr])) 32 | count++; 33 | } 34 | 35 | return count; 36 | } 37 | 38 | public bool add_response_line(ResponseLine line) { 39 | return !String.is_empty(line.explanation) ? parse_and_add_capability(line.explanation) : false; 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/engine/imap/response/imap-server-response.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * A response sent from the server to client. 9 | * 10 | * ServerResponses can take various shapes, including tagged/untagged and some common forms where 11 | * status and status text are supplied. 12 | * 13 | * See [[http://tools.ietf.org/html/rfc3501#section-7]] for more information. 14 | */ 15 | 16 | public abstract class Geary.Imap.ServerResponse : RootParameters { 17 | 18 | 19 | public Tag tag { get; private set; } 20 | public Quirks quirks { get; private set; } 21 | 22 | 23 | protected ServerResponse(Tag tag, Quirks quirks) { 24 | this.tag = tag; 25 | this.quirks = quirks; 26 | } 27 | 28 | /** 29 | * Converts the {@link RootParameters} into a ServerResponse. 30 | * 31 | * The supplied root is "stripped" of its children. 32 | */ 33 | protected ServerResponse.migrate(RootParameters root, 34 | Quirks quirks) 35 | throws ImapError { 36 | base.migrate(root); 37 | this.quirks = quirks; 38 | 39 | if (!has_tag()) { 40 | throw new ImapError.INVALID("Server response does not have a tag token: %s", to_string()); 41 | } 42 | this.tag = get_tag(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-remove.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Remove interface to a 10 | * {@link Geary.Folder} indicates that it supports removing (deleting) 11 | * email. 12 | * 13 | * This generally means that the message is deleted from the server 14 | * and is not recoverable. It _may_ mean the message is moved to a 15 | * Trash folder where it may or may not be automatically deleted some 16 | * time later; this behavior is server-specific and not always 17 | * determinable by Geary (or worked around, either). 18 | * 19 | * The remove operation is distinct from the archive operation, 20 | * available via {@link Geary.FolderSupport.Archive}. 21 | * 22 | * A Folder that does not support Remove does not imply that email 23 | * might not be removed later, such as by the server. 24 | */ 25 | public interface Geary.FolderSupport.Remove : Folder { 26 | 27 | /** 28 | * Removes the specified emails from the folder. 29 | * 30 | * This folder must be opened prior to attempting this operation. 31 | */ 32 | public abstract async void 33 | remove_email_async(Gee.Collection email_ids, 34 | GLib.Cancellable? cancellable = null) 35 | throws GLib.Error; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-folder.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * An object representing a folder for use by plugins. 10 | * 11 | * Instances of these may be obtained from {@link FolderStore}. 12 | */ 13 | public interface Plugin.Folder : Geary.BaseObject { 14 | 15 | 16 | /** 17 | * Returns a unique identifier for this account and folder. 18 | * 19 | * The value returned is persistent across application restarts. 20 | */ 21 | public abstract string persistent_id { get; } 22 | 23 | /** Returns the human-readable name of this folder. */ 24 | public abstract string display_name { get; } 25 | 26 | /** Returns the type of this folder. */ 27 | public abstract Geary.Folder.SpecialUse used_as { get; } 28 | 29 | /** Returns the account the folder belongs to, if any. */ 30 | public abstract Account? account { get; } 31 | 32 | /** 33 | * Returns a variant identifying this account and folder. 34 | * 35 | * This value can be used to obtain folders from {@link 36 | * FolderStore}, and is suitable to be used as the `show-folder` 37 | * application action parameter. 38 | * 39 | * @see FolderStore.get_folder_for_variant 40 | * @see FolderStore.folder_variant_type 41 | */ 42 | public abstract GLib.Variant to_variant(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/client/plugin/mail-merge/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'mail-merge' 3 | 4 | plugin_src = files( 5 | plugin_name + '.vala' 6 | ) 7 | plugin_data = plugin_name + plugin_data_suffix 8 | plugin_dest = plugins_dir / plugin_name 9 | 10 | lib_src = files( 11 | 'mail-merge-folder.vala', 12 | 'mail-merge-csv.vala', 13 | 'mail-merge-processor.vala', 14 | ) 15 | 16 | test_src = files( 17 | 'mail-merge-test-processor.vala', 18 | 'mail-merge-test-reader.vala', 19 | 'mail-merge-test.vala' 20 | ) 21 | 22 | lib = static_library( 23 | 'util', 24 | sources: lib_src, 25 | dependencies: plugin_dependencies, 26 | vala_args: geary_vala_args, 27 | c_args: plugin_c_args, 28 | install: false 29 | ) 30 | 31 | plugin = shared_module( 32 | plugin_name, 33 | sources: plugin_src, 34 | dependencies: plugin_dependencies, 35 | link_with: lib, 36 | vala_args: geary_vala_args, 37 | c_args: plugin_c_args, 38 | install: true, 39 | install_dir: plugin_dest, 40 | install_rpath: client_lib_dir 41 | ) 42 | 43 | custom_target( 44 | plugin_data, 45 | input: files(plugin_data + plugin_data_src_suffix), 46 | output: plugin_data, 47 | command: msgfmt_plugin_cmd, 48 | install: true, 49 | install_dir: plugin_dest 50 | ) 51 | 52 | plugin_test = executable( 53 | 'plugin-test', 54 | test_src, 55 | dependencies: plugin_dependencies + [ vala_unit_dep ], 56 | link_with: lib, 57 | vala_args: geary_vala_args, 58 | c_args: plugin_c_args, 59 | install: false 60 | ) 61 | 62 | test(plugin_name + '-test', plugin_test) 63 | -------------------------------------------------------------------------------- /bindings/vapi/enchant-2.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cheader_filename = "enchant.h")] 2 | namespace Enchant { 3 | public delegate void BrokerDescribeFn (string provider_name, string provider_desc, string provider_dll_file); 4 | public delegate void DictDescribeFn (string lang_tag, string provider_name, string provider_desc, string provider_file); 5 | 6 | [Compact] 7 | [CCode (free_function = "enchant_broker_free")] 8 | public class Broker { 9 | [CCode (cname = "enchant_broker_init")] 10 | public Broker (); 11 | 12 | public unowned Dict request_dict (string tag); 13 | public unowned Dict request_pwl_dict (string pwl); 14 | public void free_dict (Dict dict); 15 | public int dict_exists (string tag); 16 | public void set_ordering (string tag, string ordering); 17 | public void describe (BrokerDescribeFn fn); 18 | public void list_dicts (DictDescribeFn fn); 19 | public unowned string get_error (); 20 | } 21 | 22 | [Compact] 23 | public class Dict { 24 | public int check (string word, long len = -1); 25 | public unowned string[] suggest (string word, long len = -1); 26 | public void free_string_list ([CCode (array_length = false)] string[] string_list); 27 | public void add_to_session (string word, long len = -1); 28 | public int is_in_session (string word, long len = -1); 29 | public void store_replacement ( string mis, long mis_len, string cor, long cor_len); 30 | public void add_to_pwl ( string word, long len = -1); 31 | public void describe (DictDescribeFn fn); 32 | public unowned string get_error (); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bindings/vapi/enchant.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cheader_filename = "enchant.h")] 2 | namespace Enchant { 3 | public delegate void BrokerDescribeFn (string provider_name, string provider_desc, string provider_dll_file); 4 | public delegate void DictDescribeFn (string lang_tag, string provider_name, string provider_desc, string provider_file); 5 | 6 | [Compact] 7 | [CCode (free_function = "enchant_broker_free")] 8 | public class Broker { 9 | [CCode (cname = "enchant_broker_init")] 10 | public Broker (); 11 | 12 | public unowned Dict request_dict (string tag); 13 | public unowned Dict request_pwl_dict (string pwl); 14 | public void free_dict (Dict dict); 15 | public int dict_exists (string tag); 16 | public void set_ordering (string tag, string ordering); 17 | public void describe (BrokerDescribeFn fn); 18 | public void list_dicts (DictDescribeFn fn); 19 | public unowned string get_error (); 20 | } 21 | 22 | [Compact] 23 | public class Dict { 24 | public int check (string word, long len = -1); 25 | public unowned string[] suggest (string word, long len = -1); 26 | public void free_string_list ([CCode (array_length = false)] string[] string_list); 27 | public void add_to_session (string word, long len = -1); 28 | public int is_in_session (string word, long len = -1); 29 | public void store_replacement ( string mis, long mis_len, string cor, long cor_len); 30 | public void add_to_pwl ( string word, long len = -1); 31 | public void describe (DictDescribeFn fn); 32 | public unowned string get_error (); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/imap-engine/gmail/imap-engine-gmail-drafts-folder.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * A draft folder for Gmail. 10 | * 11 | * Gmail's drafts folders supports basic operations as well as true 12 | * removal of messages and creating new ones (IMAP APPEND). 13 | */ 14 | private class Geary.ImapEngine.GmailDraftsFolder : 15 | MinimalFolder, FolderSupport.Create, FolderSupport.Remove { 16 | 17 | public GmailDraftsFolder(GmailAccount account, 18 | ImapDB.Folder local_folder) { 19 | base(account, local_folder, DRAFTS); 20 | } 21 | 22 | public new async EmailIdentifier? 23 | create_email_async(RFC822.Message rfc822, 24 | EmailFlags? flags, 25 | DateTime? date_received, 26 | GLib.Cancellable? cancellable = null) 27 | throws GLib.Error { 28 | return yield base.create_email_async( 29 | rfc822, flags, date_received, cancellable 30 | ); 31 | } 32 | 33 | public async void 34 | remove_email_async(Gee.Collection email_ids, 35 | GLib.Cancellable? cancellable = null) 36 | throws GLib.Error { 37 | yield GmailFolder.true_remove_email_async(this, email_ids, cancellable); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /help/C/label.page: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Label or move a conversation 11 |
12 | Label a conversation 13 |

Geary lets you apply one or more labels to each conversation. Geary labels 14 | correspond to labels in Gmail, or ordinary folders in other mail services.

15 |

To label one or more conversations, first select the conversation(s), then 16 | do either of the following:

17 | 18 |

Click the Label button on the toolbar and select a label from the resulting 19 | drop-down menu.

20 |

Hold down the Ctrl key and drag the conversation(s) from the 21 | conversation list to the label in the sidebar.

22 |
23 |
24 |
25 | Move a conversation to a folder or label 26 |

To move one or more conversations to a folder or label, first select the 27 | conversation(s), then do either of the following:

28 | 29 |

Click the Move button on the toolbar and select a folder or label from the resulting 30 | drop-down menu.

31 |

Drag the conversation(s) from the 32 | conversation list to the folder or label in the sidebar.

33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /test/client/application/application-client-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | 9 | class Application.ClientTest : TestCase { 10 | 11 | 12 | private Client? test_article = null; 13 | 14 | 15 | public ClientTest() { 16 | base("Application.ClientTest"); 17 | add_test("paths_when_installed", paths_when_installed); 18 | } 19 | 20 | public override void set_up() { 21 | this.test_article = new Client(); 22 | } 23 | 24 | public override void tear_down() { 25 | this.test_article = null; 26 | } 27 | 28 | public void paths_when_installed() throws GLib.Error { 29 | string[] args = new string[] { 30 | Config.INSTALL_PREFIX + "/bin/geary", 31 | // Specify this so the app doesn't actually attempt 32 | // to start up 33 | "-v" 34 | }; 35 | unowned string[] unowned_args = args; 36 | int status; 37 | this.test_article.local_command_line(ref unowned_args, out status); 38 | 39 | assert_equal( 40 | this.test_article.get_resource_directory().get_path(), 41 | Config.INSTALL_PREFIX + "/share/geary" 42 | ); 43 | assert_equal( 44 | this.test_article.get_desktop_directory().get_path(), 45 | Config.INSTALL_PREFIX + "/share/applications" 46 | ); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/engine/nonblocking/nonblocking-reporting-semaphore.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public class Geary.Nonblocking.ReportingSemaphore : Geary.Nonblocking.Semaphore { 8 | public G result { get; private set; } 9 | public Error? err { get; private set; default = null; } 10 | 11 | private G default_result; 12 | 13 | public ReportingSemaphore(G default_result, Cancellable? cancellable = null) { 14 | base (cancellable); 15 | 16 | this.default_result = default_result; 17 | result = default_result; 18 | } 19 | 20 | public override void reset() { 21 | result = default_result; 22 | err = null; 23 | 24 | base.reset(); 25 | } 26 | 27 | public void notify_result(G result, Error? err) throws Error { 28 | this.result = result; 29 | this.err = err; 30 | 31 | notify(); 32 | } 33 | 34 | public void throw_if_error() throws Error { 35 | if (err != null) 36 | throw err; 37 | } 38 | 39 | public async G wait_for_result_async(Cancellable? cancellable = null) throws Error { 40 | // check before waiting 41 | throw_if_error(); 42 | 43 | // wait 44 | yield base.wait_async(cancellable); 45 | 46 | // if notified of error while waiting, throw that 47 | throw_if_error(); 48 | 49 | return result; 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /icons/meson.build: -------------------------------------------------------------------------------- 1 | system_icons_dir = join_paths(data_dir, 'icons', 'hicolor') 2 | 3 | icon_files = files( 4 | 'mail-archive-symbolic.svg', 5 | 'close-symbolic.svg', 6 | 'detach-symbolic.svg', 7 | 'text-x-generic-symbolic.svg', 8 | 'edit-symbolic.svg', 9 | 'font-size-symbolic.svg', 10 | 'font-color-symbolic.svg', 11 | 'format-ordered-list-symbolic.svg', 12 | 'format-ordered-list-symbolic-rtl.svg', 13 | 'format-text-remove-symbolic.svg', 14 | 'format-toolbar-toggle-symbolic.svg', 15 | 'format-unordered-list-symbolic.svg', 16 | 'format-unordered-list-symbolic-rtl.svg', 17 | 'mail-drafts-symbolic.svg', 18 | 'mail-drafts-symbolic-rtl.svg', 19 | 'mail-inbox-symbolic.svg', 20 | 'mail-outbox-symbolic.svg', 21 | 'mail-sent-symbolic.svg', 22 | 'mail-sent-symbolic-rtl.svg', 23 | 'tag-symbolic.svg', 24 | 'tag-symbolic-rtl.svg', 25 | ) 26 | 27 | colour_app_icon_dirs = [ 28 | '16x16', 29 | '24x24', 30 | '32x32', 31 | '48x48', 32 | '256x256', 33 | '512x512', 34 | ] 35 | 36 | install_data(icon_files, 37 | install_dir: join_paths(system_icons_dir, 'scalable', 'actions'), 38 | ) 39 | 40 | scalable_dir = join_paths('hicolor', 'scalable', 'apps') 41 | 42 | install_data( 43 | join_paths(scalable_dir, '@0@.svg'.format(geary_id)), 44 | install_dir: join_paths(data_dir, 'icons', scalable_dir), 45 | ) 46 | 47 | symbolic_dir = join_paths('hicolor', 'symbolic', 'apps') 48 | 49 | install_data( 50 | join_paths(symbolic_dir, 'org.gnome.Geary-symbolic.svg'), 51 | install_dir: join_paths(data_dir, 'icons', symbolic_dir), 52 | rename: '@0@-symbolic.svg'.format(geary_id) 53 | ) 54 | -------------------------------------------------------------------------------- /src/engine/imap/message/imap-flag.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * A generic IMAP message or mailbox flag. 9 | * 10 | * In IMAP, message and mailbox flags have similar syntax, which is encapsulated here. 11 | * 12 | * @see MessageFlag 13 | * @see MailboxAttribute 14 | */ 15 | 16 | public abstract class Geary.Imap.Flag : BaseObject, Gee.Hashable { 17 | public string value { get; private set; } 18 | 19 | /** 20 | * Constructs a new flag. 21 | * 22 | * The given keyword must be an IMAP atom. 23 | */ 24 | protected Flag(string name) { 25 | this.value = name; 26 | } 27 | 28 | public bool is_system() { 29 | return value[0] == '\\'; 30 | } 31 | 32 | public bool equals_string(string value) { 33 | return Ascii.stri_equal(this.value, value); 34 | } 35 | 36 | public bool equal_to(Geary.Imap.Flag flag) { 37 | return (flag == this) ? true : flag.equals_string(value); 38 | } 39 | 40 | /** 41 | * Returns the {@link Flag} as an appropriate {@link Parameter}. 42 | */ 43 | public StringParameter to_parameter() throws ImapError { 44 | return new UnquotedStringParameter(value); 45 | } 46 | 47 | public uint hash() { 48 | return Ascii.stri_hash(value); 49 | } 50 | 51 | public string to_string() { 52 | return value; 53 | } 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/client/plugin/messaging-menu/meson.build: -------------------------------------------------------------------------------- 1 | 2 | plugin_name = 'messaging-menu' 3 | 4 | if libmessagingmenu_dep.found() 5 | messaging_menu_dependencies = plugin_dependencies 6 | 7 | # The libmessagingmenu dependency in the root meson.build file 8 | # determines if the lib is present, but since the library uses a 9 | # broken name for its VAPI we have to fake it and find the C and 10 | # Vala libs manually 11 | messaging_menu_dependencies += declare_dependency( 12 | include_directories: include_directories( 13 | libmessagingmenu_dep.get_variable(pkgconfig: 'includedir') 14 | ), 15 | dependencies: [ 16 | valac.find_library('MessagingMenu-1.0', dirs: [ '/usr/share/vala/vapi' ]), 17 | cc.find_library('messaging-menu'), 18 | ] 19 | ) 20 | 21 | plugin_src = files(plugin_name + '.vala') 22 | plugin_data = plugin_name + plugin_data_suffix 23 | plugin_dest = plugins_dir / plugin_name 24 | 25 | shared_module( 26 | # Use a non-standard name for the lib since the standard one 27 | # conflicts with libmessagingmenu and causes linking to fail 28 | 'unity-' + plugin_name, 29 | sources: plugin_src, 30 | dependencies: messaging_menu_dependencies, 31 | vala_args: geary_vala_args, 32 | c_args: plugin_c_args, 33 | install: true, 34 | install_dir: plugin_dest, 35 | install_rpath: client_lib_dir, 36 | ) 37 | 38 | custom_target( 39 | plugin_data, 40 | input: files(plugin_data + plugin_data_src_suffix), 41 | output: plugin_data, 42 | command: msgfmt_plugin_cmd, 43 | install: true, 44 | install_dir: plugin_dest 45 | ) 46 | endif 47 | -------------------------------------------------------------------------------- /src/engine/memory/memory-file-buffer.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | //extern Bytes *g_bytes_new_with_free_func(void *data, size_t size, DestroyNotify destroy, void *user); 8 | 9 | /** 10 | * Makes a file available as a {@link Memory.Buffer}. 11 | */ 12 | 13 | public class Geary.Memory.FileBuffer : Memory.Buffer, Memory.UnownedBytesBuffer { 14 | private File file; 15 | private MappedFile mmap; 16 | 17 | public override size_t size { 18 | get { 19 | return mmap.get_length(); 20 | } 21 | } 22 | 23 | public override size_t allocated_size { 24 | get { 25 | return mmap.get_length(); 26 | } 27 | } 28 | 29 | /** 30 | * The File is immediately opened when this is called. 31 | */ 32 | public FileBuffer(File file, bool readonly) throws Error { 33 | if (file.get_path() == null) 34 | throw new IOError.NOT_FOUND("File for Geary.Memory.FileBuffer not found"); 35 | 36 | this.file = file; 37 | mmap = new MappedFile(file.get_path(), !readonly); 38 | } 39 | 40 | public override Bytes get_bytes() { 41 | return Bytes.new_with_owner(to_unowned_uint8_array(), mmap); 42 | } 43 | 44 | public unowned uint8[] to_unowned_uint8_array() { 45 | unowned uint8[] buffer = (uint8[]) mmap.get_contents(); 46 | buffer.length = (int) mmap.get_length(); 47 | 48 | return buffer; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/engine/api/geary-contact-store.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2019 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | /** 10 | * Interface for objects that provide contact information storage. 11 | * 12 | * Implementations of this class will typically be backed by a 13 | * database. As such, to avoid IO overhead, batch calls together using 14 | * collections of contacts wherever possible. 15 | */ 16 | public interface Geary.ContactStore : GLib.Object { 17 | 18 | /** Returns the contact matching the given email address, if any */ 19 | public abstract async Contact? get_by_rfc822(Geary.RFC822.MailboxAddress address, 20 | GLib.Cancellable? cancellable) 21 | throws GLib.Error; 22 | 23 | /** Searches for contacts based on a specific string */ 24 | public abstract async Gee.Collection search(string query, 25 | uint min_importance, 26 | uint limit, 27 | GLib.Cancellable? cancellable) 28 | throws GLib.Error; 29 | 30 | /** Updates (or adds) a set of contacts in the underlying store */ 31 | public abstract async void update_contacts(Gee.Collection updated, 32 | GLib.Cancellable? cancellable) 33 | throws GLib.Error; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/engine/imap/api/imap-email-properties.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public class Geary.Imap.EmailProperties : Geary.EmailProperties, Gee.Hashable { 8 | 9 | 10 | public InternalDate? internaldate { get; private set; } 11 | public RFC822Size? rfc822_size { get; private set; } 12 | 13 | public EmailProperties(InternalDate internaldate, 14 | RFC822Size rfc822_size) { 15 | base (internaldate.value, rfc822_size.value); 16 | this.internaldate = internaldate; 17 | this.rfc822_size = rfc822_size; 18 | } 19 | 20 | public bool equal_to(Geary.Imap.EmailProperties other) { 21 | if (this == other) 22 | return true; 23 | 24 | // for simplicity and robustness, internaldate and rfc822_size must be present in both 25 | // to be considered equal 26 | if (internaldate == null || other.internaldate == null) 27 | return false; 28 | 29 | if (rfc822_size == null || other.rfc822_size == null) 30 | return false; 31 | 32 | return true; 33 | } 34 | 35 | public uint hash() { 36 | return to_string().hash(); 37 | } 38 | 39 | public override string to_string() { 40 | return "internaldate:%s/size:%s".printf((internaldate != null) ? internaldate.to_string() : "(none)", 41 | (rfc822_size != null) ? rfc822_size.to_string() : "(none)"); 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/engine/api/geary-engine-error.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2018 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | public errordomain Geary.EngineError { 10 | 11 | /** An account, folder or other object has not been opened. */ 12 | OPEN_REQUIRED, 13 | 14 | /** An account, folder or other object has already been opened. */ 15 | ALREADY_OPEN, 16 | 17 | /** An object with the same name or id already exists. */ 18 | ALREADY_EXISTS, 19 | 20 | /** An account, folder or other object has already been closed. */ 21 | ALREADY_CLOSED, 22 | 23 | /** An account, folder or other object must be closed first. */ 24 | CLOSE_REQUIRED, 25 | 26 | /** An object with the given name or id does not exist. */ 27 | NOT_FOUND, 28 | 29 | /** The parameters for a function or method call are somehow invalid. */ 30 | BAD_PARAMETERS, 31 | 32 | /** An email did not contain all required fields. */ 33 | INCOMPLETE_MESSAGE, 34 | 35 | /** A remote resource is no longer available. */ 36 | SERVER_UNAVAILABLE, 37 | 38 | /** The account database or other local resource is corrupted. */ 39 | CORRUPT, 40 | 41 | /** The account database or other local resource cannot be accessed. */ 42 | PERMISSIONS, 43 | 44 | /** The account database or other local resource has a bad version. */ 45 | VERSION, 46 | 47 | /** A remote resource does not support a given operation. */ 48 | UNSUPPORTED 49 | } 50 | -------------------------------------------------------------------------------- /src/engine/imap-engine/replay-ops/imap-engine-user-close.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2018 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | /** 10 | * Operation to close the folder. 11 | * 12 | * This is a replay queue operation to allow existing local ops to 13 | * complete, and to ease the implementation. See comments in {@link 14 | * MinimalFolder.close_async}. 15 | */ 16 | private class Geary.ImapEngine.UserClose : Geary.ImapEngine.ReplayOperation { 17 | 18 | /** Determines the state of the close operation. */ 19 | public Trillian is_closing = Trillian.UNKNOWN; 20 | 21 | private MinimalFolder owner; 22 | private Cancellable? cancellable; 23 | 24 | 25 | public UserClose(MinimalFolder owner, Cancellable? cancellable) { 26 | base("UserClose", Scope.LOCAL_ONLY); 27 | this.owner = owner; 28 | this.cancellable = cancellable; 29 | } 30 | 31 | public override async ReplayOperation.Status replay_local_async() throws Error { 32 | bool closing = yield this.owner.close_internal( 33 | Folder.CloseReason.LOCAL_CLOSE, 34 | Folder.CloseReason.REMOTE_CLOSE, 35 | this.cancellable 36 | ); 37 | this.is_closing = Trillian.from_boolean(closing); 38 | return ReplayOperation.Status.COMPLETED; 39 | } 40 | 41 | public override string describe_state() { 42 | return "is_closing: %s".printf(this.is_closing.to_string()); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/client/components/components-headerbar-conversation-list.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017 Software Freedom Conservancy Inc. 3 | * Copyright © 2021 Michael Gratton 4 | * Copyright © 2022 Cédric Bellegarde 5 | * 6 | * This software is licensed under the GNU Lesser General Public License 7 | * (version 2.1 or later). See the COPYING file in this distribution. 8 | */ 9 | 10 | 11 | /** 12 | * The conversation list headerbar. 13 | * 14 | * @see Application.MainWindow 15 | */ 16 | [GtkTemplate (ui = "/org/gnome/Geary/components-headerbar-conversation-list.ui")] 17 | public class Components.ConversationListHeaderBar : Hdy.HeaderBar { 18 | 19 | public string account { get; set; } 20 | public string folder { get; set; } 21 | public bool search_open { get; set; default = false; } 22 | public bool selection_open { get; set; default = false; } 23 | 24 | [GtkChild] private unowned Gtk.ToggleButton search_button; 25 | [GtkChild] private unowned Gtk.ToggleButton selection_button; 26 | [GtkChild] public unowned Gtk.Button back_button; 27 | 28 | 29 | construct { 30 | this.bind_property("account", this, "title", BindingFlags.SYNC_CREATE); 31 | this.bind_property("folder", this, "subtitle", BindingFlags.SYNC_CREATE); 32 | 33 | this.bind_property( 34 | "search-open", 35 | this.search_button, "active", 36 | SYNC_CREATE | BIDIRECTIONAL 37 | ); 38 | this.bind_property( 39 | "selection-open", 40 | this.selection_button, "active", 41 | SYNC_CREATE | BIDIRECTIONAL 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/client/util/util-gio.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Utility functions for GIO objects. 9 | */ 10 | namespace GioUtil { 11 | 12 | public const string GEARY_RESOURCE_PREFIX = "/org/gnome/Geary/"; 13 | 14 | /** 15 | * Creates a GTK builder given the name of a GResource. 16 | * 17 | * The given `name` will automatically have 18 | * `GEARY_RESOURCE_PREFIX` pre-pended to it. 19 | */ 20 | public Gtk.Builder create_builder(string name) { 21 | Gtk.Builder builder = new Gtk.Builder(); 22 | try { 23 | builder.add_from_resource(GEARY_RESOURCE_PREFIX + name); 24 | } catch(GLib.Error error) { 25 | critical("Unable load GResource \"%s\" for Gtk.Builder: %s".printf( 26 | name, error.message 27 | )); 28 | } 29 | return builder; 30 | } 31 | 32 | /** 33 | * Loads a GResource file as a string. 34 | * 35 | * The given `name` will automatically have 36 | * `GEARY_RESOURCE_PREFIX` pre-pended to it. 37 | */ 38 | public string read_resource(string name) throws Error { 39 | InputStream input_stream = resources_open_stream( 40 | GEARY_RESOURCE_PREFIX + name, 41 | ResourceLookupFlags.NONE 42 | ); 43 | DataInputStream data_stream = new DataInputStream(input_stream); 44 | size_t length; 45 | return data_stream.read_upto("\0", 1, out length); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/engine/api/geary-folder-supports-create.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * The addition of the Geary.FolderSupport.Create interface on a 10 | * {@link Geary.Folder} indicates it supports creating email. 11 | * 12 | * Created emails are uploaded to the Folder and stored there. 13 | * 14 | * Note that creating an email in the Outbox will queue it for 15 | * sending. Thus, it may be removed without user interaction at some 16 | * point in the future. 17 | */ 18 | public interface Geary.FolderSupport.Create : Folder { 19 | 20 | /** 21 | * Creates (appends) the message to this folder. 22 | * 23 | * The Folder must be opened prior to attempting this operation. 24 | * 25 | * The optional {@link EmailFlags} allows for those flags to be 26 | * set when saved. Some Folders may ignore those flags 27 | * (i.e. Outbox) if not applicable. 28 | * 29 | * The optional DateTime allows for the message's "date received" 30 | * time to be set when saved. Like EmailFlags, this is optional 31 | * if not applicable. 32 | * 33 | * @see FolderProperties.create_never_returns_id 34 | */ 35 | public abstract async EmailIdentifier? 36 | create_email_async(RFC822.Message rfc822, 37 | EmailFlags? flags, 38 | DateTime? date_received, 39 | GLib.Cancellable? cancellable = null) 40 | throws GLib.Error; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/engine/state/state-machine-descriptor.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | public delegate string Geary.State.StateEventToString(uint state_or_event); 8 | 9 | public class Geary.State.MachineDescriptor : BaseObject { 10 | public string name { get; private set; } 11 | public uint start_state { get; private set; } 12 | public uint state_count { get; private set; } 13 | public uint event_count { get; private set; } 14 | 15 | private unowned StateEventToString? state_to_string; 16 | private unowned StateEventToString? event_to_string; 17 | 18 | public MachineDescriptor(string name, uint start_state, uint state_count, uint event_count, 19 | StateEventToString? state_to_string, StateEventToString? event_to_string) { 20 | this.name = name; 21 | this.start_state = start_state; 22 | this.state_count = state_count; 23 | this.event_count = event_count; 24 | this.state_to_string = state_to_string; 25 | this.event_to_string = event_to_string; 26 | 27 | // starting state should be valid 28 | assert(start_state < state_count); 29 | } 30 | 31 | public string get_state_string(uint state) { 32 | return (state_to_string != null) ? state_to_string(state) : "%s STATE %u".printf(name, state); 33 | } 34 | 35 | public string get_event_string(uint event) { 36 | return (event_to_string != null) ? event_to_string(event) : "%s EVENT %u".printf(name, event); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /icons/tag-symbolic-rtl.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | Gnome Symbolic Icon Theme 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | Gnome Symbolic Icon Theme 25 | 26 | 27 | 28 | 32 | tag-symbolic 34 | 35 | 36 | -------------------------------------------------------------------------------- /icons/tag-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | Gnome Symbolic Icon Theme 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | Gnome Symbolic Icon Theme 25 | 26 | 27 | 28 | 32 | tag-symbolic 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/client/plugin/plugin-email-store.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | /** 9 | * Provides plugins with access to email. 10 | * 11 | * Plugins that implement the {@link EmailExtension} interface may 12 | * obtain instances of this object by calling {@link 13 | * EmailContext.get_email_store} on their {@link EmailExtension.email} 14 | * property. 15 | */ 16 | public interface Plugin.EmailStore : Geary.BaseObject { 17 | 18 | 19 | /** 20 | * The type of variant email identifiers. 21 | * 22 | * @see EmailIdentifier.to_variant 23 | * @see get_email_identifier_for_variant 24 | */ 25 | public abstract GLib.VariantType email_identifier_variant_type { get; } 26 | 27 | /** Emitted when an email has been displayed in the UI. */ 28 | public signal void email_displayed(Email sent); 29 | 30 | /** Emitted when an email has been sent. */ 31 | public signal void email_sent(Email sent); 32 | 33 | /** Returns the email with the given identifiers. */ 34 | public async abstract Gee.Collection get_email( 35 | Gee.Collection ids, 36 | GLib.Cancellable? cancellable 37 | ) throws GLib.Error; 38 | 39 | /** 40 | * Returns the email identifier specified by the given variant, if any. 41 | * 42 | * @see EmailIdentifier.to_variant 43 | * @see email_identifier_variant_type 44 | */ 45 | public abstract EmailIdentifier? get_email_identifier_for_variant(GLib.Variant id); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /geary.doap: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Geary 9 | geary 10 | Send and receive email 11 | Geary is an email application built 12 | around conversations, for the GNOME desktop. It allows you to 13 | read, find and send email with a straightforward, modern 14 | interface. 15 | 16 | 17 | 18 | 19 | 20 | 21 | Vala 22 | 23 | 24 | 25 | Cédric Bellegarde 26 | 27 | cbellegarde 28 | 29 | 30 | 31 | 32 | Niels De Graef 33 | 34 | nielsdg 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test/engine/util-ascii-test.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Michael Gratton 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | class Geary.Ascii.Test : TestCase { 9 | 10 | public Test() { 11 | base("Geary.Ascii.Test"); 12 | add_test("index_of", index_of); 13 | add_test("last_index_of", last_index_of); 14 | } 15 | 16 | public void index_of() throws Error { 17 | assert_equal(Ascii.index_of("", 'a'), -1); 18 | assert_equal(Ascii.index_of("a", 'a'), 0); 19 | assert_equal(Ascii.index_of("aa", 'a'), 0); 20 | 21 | assert_equal(Ascii.index_of("abcabc", 'a'), 0); 22 | assert_equal(Ascii.index_of("abcabc", 'b'), 1); 23 | assert_equal(Ascii.index_of("abcabc", 'c'), 2); 24 | 25 | assert_equal(Ascii.index_of("@", '@'), 0); 26 | 27 | assert_equal(Ascii.index_of("abc", 'd'), -1); 28 | } 29 | 30 | public void last_index_of() throws Error { 31 | assert_equal(Ascii.last_index_of("", 'a'), -1); 32 | assert_equal(Ascii.last_index_of("a", 'a'), 0); 33 | assert_equal(Ascii.last_index_of("aa", 'a'), 1); 34 | 35 | assert_equal(Ascii.last_index_of("abcabc", 'a'), 3); 36 | assert_equal(Ascii.last_index_of("abcabc", 'b'), 4); 37 | assert_equal(Ascii.last_index_of("abcabc", 'c'), 5); 38 | 39 | assert_equal(Ascii.last_index_of("@", '@'), 0); 40 | 41 | assert_equal(Ascii.last_index_of("abc", 'd'), -1); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /meson.options: -------------------------------------------------------------------------------- 1 | # 2 | # General build options 3 | # 4 | 5 | option( 6 | 'profile', 7 | type: 'combo', 8 | choices: [ 9 | 'auto', 10 | 'development', 11 | 'beta', 12 | 'release' 13 | ], 14 | description: 'Specifies the application type to be built' 15 | ) 16 | option( 17 | 'revno', 18 | type: 'string', 19 | description: 'Custom revision string (default extracted from "git describe")' 20 | ) 21 | option( 22 | 'iso_639_xml', 23 | type: 'string', 24 | value: '', 25 | description: 'Full path to the ISO 639 XML file.' 26 | ) 27 | option( 28 | 'iso_3166_xml', 29 | type: 'string', 30 | value: '', 31 | description: 'Full path to the ISO 3166 XML file.' 32 | ) 33 | option( 34 | 'valadoc', 35 | type: 'feature', 36 | value: 'auto', 37 | description: 'Build API documentation' 38 | ) 39 | 40 | # 41 | # Development options 42 | # 43 | 44 | option( 45 | 'ref_tracking', 46 | type: 'feature', 47 | value: 'disabled', 48 | description: 'Enable Geary.BaseObject reference tracking' 49 | ) 50 | 51 | # 52 | # Optional features 53 | # 54 | 55 | option( 56 | 'contractor', 57 | type: 'feature', 58 | value: 'disabled', 59 | description: 'Install an Elementary OS a contractor file' 60 | ) 61 | option( 62 | 'libunwind', 63 | type: 'feature', 64 | value: 'enabled', 65 | description: 'Use libunwind for back traces in problem reports.' 66 | ) 67 | option( 68 | 'tnef', 69 | type: 'feature', 70 | value: 'enabled', 71 | description: 'Support Microsoft-proprietary TNEF attachments.' 72 | ) 73 | option( 74 | 'delayed_replay_queue', 75 | type: 'boolean', 76 | value: false, 77 | description: 'Add delay in session opening (for debug purpose only)' 78 | ) 79 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/New bug.md: -------------------------------------------------------------------------------- 1 | **Bug Summary** 2 | 3 | Provide a short summary of the bug you encountered. Please replace all 4 | comments such as this with the requested information. 5 | 6 | 7 | **Your installation** 8 | 9 | To obtain installation information, copy it from Geary's Problem 10 | Report dialog if shown (or else open the Geary Inspector by typing 11 | Shift + Alt + I) by selecting System, and clicking the Copy 12 | button, then pasting here. 13 | 14 | * Geary version: 15 | * Installation method: 16 | * Desktop environment: 17 | * Operating system and version: 18 | * Email provider: 19 | 20 | 21 | **Steps to reproduce** 22 | 23 | 1. Step one 24 | 2. Step two 25 | 3. ... 26 | 27 | 28 | **What happened?** 29 | 30 | What did Geary do that was unexpected? 31 | 32 | 33 | **What did you expect to happen?** 34 | 35 | What did you expect Geary to do? 36 | 37 | 38 | **Relevant logs and/or screenshots** 39 | 40 | To obtain log information, save it from Geary's Problem Report dialog 41 | if shown (or else open the Geary Inspector by typing Shift + Alt + I), 42 | by clicking the Save As button and attaching the resulting file 43 | to this issue. 44 | 45 | If the bug is a crash, please obtain a stack trace and attach it to 46 | this issue so it can be debugged by following the instructions on this 47 | page: https://wiki.gnome.org/Apps/Geary/ReportingABug#Stack_Trace 48 | 49 | 50 | 51 | /label ~"1. Bug" 52 | -------------------------------------------------------------------------------- /help/C/shortcuts.page: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Keyboard shortcuts 11 | 12 |
13 | Overview 14 |

Geary has keyboard shortcuts for most common operations. Use 15 | the built-in help to discover the full list. To open the shortcuts 16 | help, select Keyboard Shortcuts from 17 | the application menu on the main window's toolbar, or using the 18 | keyboard shortcuts listed below.

19 | 20 |

The following keyboard shortcuts can be used to access on-line 21 | help from Geary:

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 |

Display this help manual

F1

Display all keyboard shortcuts

30 | Ctrl? 31 |

34 |
35 | 36 |
37 | Single key shortcuts 38 | 39 |

You can enable keyboard shortcuts for email actions that do not 40 | require pressing Ctrl. These match the shortcuts used 41 | by GMail. See for details.

42 | 43 |

The full list of single key shortcuts enabled by this 44 | preference can be found via the keyboard shortcuts help, 45 | above.

46 |
47 | 48 | 49 |
50 | -------------------------------------------------------------------------------- /src/engine/app/conversation-monitor/app-remove-operation.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 Software Freedom Conservancy Inc. 3 | * Copyright 2019 Michael Gratton 4 | * 5 | * This software is licensed under the GNU Lesser General Public License 6 | * (version 2.1 or later). See the COPYING file in this distribution. 7 | */ 8 | 9 | private class Geary.App.RemoveOperation : BatchOperation { 10 | 11 | 12 | private Folder source_folder; 13 | 14 | 15 | public RemoveOperation(ConversationMonitor monitor, 16 | Folder source_folder, 17 | Gee.Collection removed_ids) { 18 | base(monitor, removed_ids); 19 | this.source_folder = source_folder; 20 | } 21 | 22 | public override async void execute_batch(Gee.Collection batch) 23 | throws GLib.Error { 24 | debug("Removing %d messages(s) from %s", 25 | batch.size, this.source_folder.to_string() 26 | ); 27 | 28 | Gee.Set removed = new Gee.HashSet(); 29 | Gee.MultiMap trimmed = 30 | new Gee.HashMultiMap(); 31 | this.monitor.conversations.remove_all_emails_by_identifier( 32 | source_folder.path, 33 | batch, 34 | removed, 35 | trimmed 36 | ); 37 | 38 | this.monitor.removed( 39 | removed, 40 | trimmed, 41 | (this.source_folder == this.monitor.base_folder) ? batch : null 42 | ); 43 | 44 | // Queue an update since many emails may have been removed 45 | this.monitor.check_window_count(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/engine/memory/memory-string-buffer.vala: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Software Freedom Conservancy Inc. 2 | * 3 | * This software is licensed under the GNU Lesser General Public License 4 | * (version 2.1 or later). See the COPYING file in this distribution. 5 | */ 6 | 7 | /** 8 | * Allows for a common string to be represented as an {@link Memory.Buffer}. 9 | */ 10 | 11 | public class Geary.Memory.StringBuffer : Memory.Buffer, Memory.UnownedStringBuffer, 12 | Memory.UnownedBytesBuffer { 13 | public override size_t size { 14 | get { 15 | return length; 16 | } 17 | } 18 | 19 | public override size_t allocated_size { 20 | get { 21 | return length; 22 | } 23 | } 24 | 25 | private string str; 26 | private size_t length; 27 | private Bytes? bytes = null; 28 | 29 | public StringBuffer(string str) { 30 | this.str = str; 31 | length = str.data.length; 32 | } 33 | 34 | /** 35 | * {@inheritDoc} 36 | */ 37 | public override Bytes get_bytes() { 38 | return (bytes != null) ? bytes : bytes = new Bytes(str.data); 39 | } 40 | 41 | /** 42 | * {@inheritDoc} 43 | */ 44 | public override string to_string() { 45 | return str; 46 | } 47 | 48 | /** 49 | * {@inheritDoc} 50 | */ 51 | public override string get_valid_utf8() { 52 | return str.validate() ? str : ""; 53 | } 54 | 55 | /** 56 | * {@inheritDoc} 57 | */ 58 | public unowned string to_unowned_string() { 59 | return str; 60 | } 61 | 62 | /** 63 | * {@inheritDoc} 64 | */ 65 | public unowned uint8[] to_unowned_uint8_array() { 66 | return str.data; 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /bindings/vapi/libytnef.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Oliver Giles 3 | * 4 | * This software is licensed under the GNU Lesser General Public License 5 | * (version 2.1 or later). See the COPYING file in this distribution. 6 | */ 7 | 8 | [CCode (cheader_filename = "ytnef.h")] 9 | namespace Ytnef { 10 | [CCode (cname ="variableLength", has_type_id = false)] 11 | public struct VariableLength { 12 | [CCode (array_length_cname = "size")] 13 | uint8[] data; 14 | } 15 | 16 | [CCode (cname = "MAPI_UNDEFINED")] 17 | public VariableLength* MAPI_UNDEFINED; 18 | 19 | [CCode (cname = "int", cprefix = "PT_", has_type_id = false)] 20 | public enum PropType { 21 | STRING8 22 | } 23 | 24 | [CCode (cname = "int", cprefix = "PR_", has_type_id = false)] 25 | public enum PropID { 26 | DISPLAY_NAME, 27 | ATTACH_LONG_FILENAME 28 | } 29 | 30 | [CCode (cname = "PROP_TAG")] 31 | public static int PROP_TAG(PropType type, PropID id); 32 | 33 | [CCode (cname = "MAPIProps", has_type_id = false)] 34 | public struct MAPIProps { 35 | } 36 | 37 | [CCode (cname = "Attachment", has_type_id = false)] 38 | public struct Attachment { 39 | VariableLength Title; 40 | VariableLength FileData; 41 | MAPIProps MAPI; 42 | Attachment? next; 43 | } 44 | 45 | [CCode (cname = "TNEFStruct", destroy_function="TNEFFree", has_type_id = false)] 46 | public struct TNEFStruct { 47 | [CCode (cname = "TNEFInitialize")] 48 | public TNEFStruct(); 49 | Attachment starting_attach; 50 | } 51 | 52 | [CCode (cname = "TNEFParseMemory", has_type_id = false)] 53 | public static int ParseMemory(uint8[] data, ref TNEFStruct tnef); 54 | 55 | [CCode (cname = "MAPIFindProperty")] 56 | public static unowned VariableLength* MAPIFindProperty(MAPIProps MAPI, uint tag); 57 | } 58 | 59 | --------------------------------------------------------------------------------